Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified db.sqlite3
Binary file not shown.
3 changes: 2 additions & 1 deletion restaurants/admin.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from django.contrib import admin
from .models import Restaurant

# Register your models here.
admin.site.register(Restaurant)
24 changes: 24 additions & 0 deletions restaurants/migrations/0001_initial.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Generated by Django 2.2.8 on 2020-10-02 14:29

from django.db import migrations, models


class Migration(migrations.Migration):

initial = True

dependencies = [
]

operations = [
migrations.CreateModel(
name='Restaurant',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('name', models.CharField(max_length=200)),
('description', models.TextField()),
('opening_time', models.DateTimeField(blank=True, null=True)),
('closing_time', models.DateTimeField(blank=True, null=True)),
],
),
]
10 changes: 9 additions & 1 deletion restaurants/models.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
from django.db import models

# Create your models here.
class Restaurant(models.Model):
name = models.CharField(max_length=200)
description = models.TextField()
opening_time = models.DateTimeField(blank=True, null=True)
closing_time = models.DateTimeField(blank=True, null=True)


def __str__(self):
return self.name