séparation des application pols et vehicles
This commit is contained in:
@@ -38,6 +38,7 @@ INSTALLED_APPS = [
|
|||||||
'django.contrib.messages',
|
'django.contrib.messages',
|
||||||
'django.contrib.staticfiles',
|
'django.contrib.staticfiles',
|
||||||
'polls.apps.PollsConfig',
|
'polls.apps.PollsConfig',
|
||||||
|
'vehicles.apps.VehiclesConfig',
|
||||||
]
|
]
|
||||||
|
|
||||||
MIDDLEWARE = [
|
MIDDLEWARE = [
|
||||||
|
BIN
db.sqlite3
BIN
db.sqlite3
Binary file not shown.
@@ -1,6 +1,7 @@
|
|||||||
from django.contrib import admin
|
from django.contrib import admin
|
||||||
|
|
||||||
from polls.models import Question, Choice, Vehicles
|
from polls.models import Question, Choice
|
||||||
|
from vehicles.models import *
|
||||||
|
|
||||||
|
|
||||||
# Register your models here.
|
# Register your models here.
|
||||||
|
16
polls/migrations/0003_delete_vehicles.py
Normal file
16
polls/migrations/0003_delete_vehicles.py
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
# Generated by Django 4.0 on 2021-12-18 17:54
|
||||||
|
|
||||||
|
from django.db import migrations
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('polls', '0002_rename_questionid_choice_question'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.DeleteModel(
|
||||||
|
name='Vehicles',
|
||||||
|
),
|
||||||
|
]
|
@@ -1,31 +1,10 @@
|
|||||||
import datetime
|
import datetime
|
||||||
|
|
||||||
from django.db import models
|
from django.db import models
|
||||||
from django.conf import settings
|
|
||||||
from django.utils import timezone
|
from django.utils import timezone
|
||||||
|
|
||||||
|
|
||||||
# Create your models here.
|
# Create your models here.
|
||||||
class Vehicles(models.Model):
|
|
||||||
sName = models.CharField (max_length=250)
|
|
||||||
bEnabled = models.BooleanField( default=0 )
|
|
||||||
|
|
||||||
class Vhc_problems(models.Model):
|
|
||||||
Vehicle = models.ForeignKey( Vehicles, on_delete=models.CASCADE)
|
|
||||||
sTitle = models.CharField( max_length=250)
|
|
||||||
sDesc = models.TextField()
|
|
||||||
bEnabled = models.BooleanField( default=1)
|
|
||||||
dtStart = models.DateTimeField()
|
|
||||||
dtEnd = models.DateTimeField()
|
|
||||||
sAuthor = models.CharField( max_length=120)
|
|
||||||
Author = models.ForeignKey( settings.AUTH_USER_MODEL, on_delete=models.DO_NOTHING )
|
|
||||||
dtUpdated = models.DateTimeField('date updated')
|
|
||||||
dtCreated = models.DateTimeField('date published')
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class Question(models.Model):
|
class Question(models.Model):
|
||||||
question_txt = models.CharField( max_length=250)
|
question_txt = models.CharField( max_length=250)
|
||||||
pub_date = models.DateTimeField('date published')
|
pub_date = models.DateTimeField('date published')
|
||||||
|
0
rh/__init__.py
Normal file
0
rh/__init__.py
Normal file
3
rh/admin.py
Normal file
3
rh/admin.py
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
from django.contrib import admin
|
||||||
|
|
||||||
|
# Register your models here.
|
6
rh/apps.py
Normal file
6
rh/apps.py
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
from django.apps import AppConfig
|
||||||
|
|
||||||
|
|
||||||
|
class RhConfig(AppConfig):
|
||||||
|
default_auto_field = 'django.db.models.BigAutoField'
|
||||||
|
name = 'rh'
|
0
rh/migrations/__init__.py
Normal file
0
rh/migrations/__init__.py
Normal file
3
rh/models.py
Normal file
3
rh/models.py
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
from django.db import models
|
||||||
|
|
||||||
|
# Create your models here.
|
3
rh/tests.py
Normal file
3
rh/tests.py
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
from django.test import TestCase
|
||||||
|
|
||||||
|
# Create your tests here.
|
3
rh/views.py
Normal file
3
rh/views.py
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
from django.shortcuts import render
|
||||||
|
|
||||||
|
# Create your views here.
|
0
vehicles/__init__.py
Normal file
0
vehicles/__init__.py
Normal file
3
vehicles/admin.py
Normal file
3
vehicles/admin.py
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
from django.contrib import admin
|
||||||
|
|
||||||
|
# Register your models here.
|
6
vehicles/apps.py
Normal file
6
vehicles/apps.py
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
from django.apps import AppConfig
|
||||||
|
|
||||||
|
|
||||||
|
class VehiclesConfig(AppConfig):
|
||||||
|
default_auto_field = 'django.db.models.BigAutoField'
|
||||||
|
name = 'vehicles'
|
40
vehicles/migrations/0001_initial.py
Normal file
40
vehicles/migrations/0001_initial.py
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
# Generated by Django 4.0 on 2021-12-18 17:54
|
||||||
|
|
||||||
|
from django.db import migrations, models
|
||||||
|
import django.db.models.deletion
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
initial = True
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('auth', '0012_alter_user_first_name_max_length'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.CreateModel(
|
||||||
|
name='Vehicles',
|
||||||
|
fields=[
|
||||||
|
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||||
|
('sName', models.CharField(max_length=250)),
|
||||||
|
('bEnabled', models.BooleanField(default=0)),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
migrations.CreateModel(
|
||||||
|
name='Vhc_problems',
|
||||||
|
fields=[
|
||||||
|
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||||
|
('sTitle', models.CharField(max_length=250)),
|
||||||
|
('sDesc', models.TextField()),
|
||||||
|
('bEnabled', models.BooleanField(default=1)),
|
||||||
|
('dtStart', models.DateTimeField()),
|
||||||
|
('dtEnd', models.DateTimeField()),
|
||||||
|
('sAuthor', models.CharField(max_length=120)),
|
||||||
|
('dtUpdated', models.DateTimeField(verbose_name='date updated')),
|
||||||
|
('dtCreated', models.DateTimeField(verbose_name='date published')),
|
||||||
|
('Author', models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, to='auth.user')),
|
||||||
|
('Vehicle', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='vehicles.vehicles')),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
]
|
0
vehicles/migrations/__init__.py
Normal file
0
vehicles/migrations/__init__.py
Normal file
23
vehicles/models.py
Normal file
23
vehicles/models.py
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
import datetime
|
||||||
|
|
||||||
|
from django.db import models
|
||||||
|
from django.conf import settings
|
||||||
|
from django.utils import timezone
|
||||||
|
|
||||||
|
|
||||||
|
class Vehicles(models.Model):
|
||||||
|
sName = models.CharField (max_length=250)
|
||||||
|
bEnabled = models.BooleanField( default=0 )
|
||||||
|
|
||||||
|
class Vhc_problems(models.Model):
|
||||||
|
Vehicle = models.ForeignKey( Vehicles, on_delete=models.CASCADE)
|
||||||
|
sTitle = models.CharField( max_length=250)
|
||||||
|
sDesc = models.TextField()
|
||||||
|
bEnabled = models.BooleanField( default=1)
|
||||||
|
dtStart = models.DateTimeField()
|
||||||
|
dtEnd = models.DateTimeField()
|
||||||
|
sAuthor = models.CharField( max_length=120)
|
||||||
|
Author = models.ForeignKey( settings.AUTH_USER_MODEL, on_delete=models.DO_NOTHING )
|
||||||
|
dtUpdated = models.DateTimeField('date updated')
|
||||||
|
dtCreated = models.DateTimeField('date published')
|
||||||
|
|
3
vehicles/tests.py
Normal file
3
vehicles/tests.py
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
from django.test import TestCase
|
||||||
|
|
||||||
|
# Create your tests here.
|
3
vehicles/views.py
Normal file
3
vehicles/views.py
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
from django.shortcuts import render
|
||||||
|
|
||||||
|
# Create your views here.
|
Reference in New Issue
Block a user