séparation des application pols et vehicles

This commit is contained in:
Ambulance Clerc
2021-12-18 18:56:14 +01:00
parent 46254605fc
commit 769078f261
20 changed files with 115 additions and 22 deletions

View File

@@ -1,6 +1,7 @@
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.

View 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',
),
]

View File

@@ -1,31 +1,10 @@
import datetime
from django.db import models
from django.conf import settings
from django.utils import timezone
# 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):
question_txt = models.CharField( max_length=250)
pub_date = models.DateTimeField('date published')