Skip to content

Commit

Permalink
Merge pull request #27 from BuildForSDG/ft-userapp
Browse files Browse the repository at this point in the history
Ft-userapp
  • Loading branch information
happyjosh-tech authored May 24, 2020
2 parents 21fd17f + 4f83712 commit 9449ec7
Show file tree
Hide file tree
Showing 10 changed files with 77 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/goal3/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@
# See https://docs.djangoproject.com/en/3.0/howto/deployment/checklist/

# SECURITY WARNING: keep the secret key used in production secret!
import os
import dotenv
import dotenv

# Add .env variables anywhere before SECRET_KEY
dotenv_file = os.path.join(BASE_DIR, ".env")
Expand All @@ -39,6 +38,7 @@
# Application definition

INSTALLED_APPS = [
'usersapp.apps.UsersappConfig',
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
Expand Down
2 changes: 1 addition & 1 deletion src/goal3/urls.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""goal3 URL Configuration
"""goal3 URL Configuration.
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/3.0/topics/http/urls/
Expand Down
Empty file added src/usersapp/__init__.py
Empty file.
3 changes: 3 additions & 0 deletions src/usersapp/admin.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from django.contrib import admin

# Register your models here.
5 changes: 5 additions & 0 deletions src/usersapp/apps.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
from django.apps import AppConfig


class UsersappConfig(AppConfig):
name = 'usersapp'
38 changes: 38 additions & 0 deletions src/usersapp/migrations/0001_initial.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Generated by Django 3.0.6 on 2020-05-22 18:30

from django.db import migrations, models


class Migration(migrations.Migration):

initial = True

dependencies = [
]

operations = [
migrations.CreateModel(
name='Incident',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('location', models.CharField(max_length=45)),
('date', models.DateField()),
('description', models.TextField(blank=True, null=True)),
('vehicle_type', models.CharField(max_length=20)),
('vehicle_involved', models.CharField(max_length=20)),
('traffic_lane', models.CharField(blank=True, max_length=20, null=True)),
('road_type', models.CharField(blank=True, max_length=20, null=True)),
('junction_type', models.CharField(blank=True, max_length=20, null=True)),
('time', models.TimeField()),
('causes', models.CharField(blank=True, max_length=30, null=True)),
('collision_type', models.CharField(blank=True, max_length=100, null=True)),
('number_of_victims', models.CharField(blank=True, max_length=20, null=True)),
('number_of_injury', models.CharField(blank=True, max_length=10, null=True)),
('number_of_death', models.CharField(blank=True, max_length=10, null=True)),
('number_of_damage_vehicle', models.CharField(blank=True, max_length=10, null=True)),
('currently_allocated_to', models.CharField(blank=True, max_length=100, null=True)),
('gender', models.CharField(blank=True, max_length=20, null=True)),
('age', models.CharField(blank=True, max_length=20, null=True)),
],
),
]
Empty file.
22 changes: 22 additions & 0 deletions src/usersapp/models.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
from django.db import models

# Create your models here.
class Incident(models.Model) :
location=models.CharField(max_length=45,null=False,blank=False)
date=models.DateField()
description=models.TextField(blank=True,null=True)
vehicle_type=models.CharField(max_length=20,null=False,blank=False)
vehicle_involved=models.CharField(max_length=20,null=False,blank=False)
traffic_lane=models.CharField(max_length=20,null=True,blank=True)
road_type=models.CharField(max_length=20,null=True,blank=True)
junction_type=models.CharField(max_length=20,null=True,blank=True)
time=models.TimeField( )
causes=models.CharField(max_length=30,null=True,blank=True)
collision_type=models.CharField(max_length=100,null=True,blank=True)
number_of_victims=models.CharField(max_length=20,null=True,blank=True)
number_of_injury=models.CharField(max_length=10,null=True,blank=True)
number_of_death=models.CharField(max_length=10,null=True,blank=True)
number_of_damage_vehicle=models.CharField(max_length=10,null=True,blank=True)
currently_allocated_to=models.CharField(max_length=100,null=True,blank=True)
gender=models.CharField(max_length=20,null=True,blank=True)
age=models.CharField(max_length=20,null=True,blank=True)
3 changes: 3 additions & 0 deletions src/usersapp/tests.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from django.test import TestCase

# Create your tests here.
3 changes: 3 additions & 0 deletions src/usersapp/views.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from django.shortcuts import render

# Create your views here.

0 comments on commit 9449ec7

Please sign in to comment.