Skip to content

Commit 9261e5e

Browse files
committed
Django Tutorial Commit 1
Version 1.0
1 parent 8460d44 commit 9261e5e

File tree

6,862 files changed

+838375
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

6,862 files changed

+838375
-0
lines changed

Django/BookStore/BookOutlet/__init__.py

Whitespace-only changes.
172 Bytes
Binary file not shown.
665 Bytes
Binary file not shown.
551 Bytes
Binary file not shown.
1.65 KB
Binary file not shown.
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
from django.contrib import admin
2+
from .models import *
3+
4+
# Register your models here.
5+
class BookAdmin(admin.ModelAdmin):
6+
list_display = ('title', 'rating', 'author')
7+
8+
admin.site.register(Book, BookAdmin)
9+
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
from django.apps import AppConfig
2+
3+
4+
class BookoutletConfig(AppConfig):
5+
default_auto_field = "django.db.models.BigAutoField"
6+
name = "BookOutlet"
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Generated by Django 5.0.6 on 2024-05-23 11:13
2+
3+
from django.db import migrations, models
4+
5+
6+
class Migration(migrations.Migration):
7+
initial = True
8+
9+
dependencies = []
10+
11+
operations = [
12+
migrations.CreateModel(
13+
name="Book",
14+
fields=[
15+
(
16+
"id",
17+
models.BigAutoField(
18+
auto_created=True,
19+
primary_key=True,
20+
serialize=False,
21+
verbose_name="ID",
22+
),
23+
),
24+
("title", models.CharField(max_length=50)),
25+
("rating", models.IntegerField()),
26+
],
27+
),
28+
]
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# Generated by Django 5.0.6 on 2024-05-23 11:26
2+
3+
import django.core.validators
4+
from django.db import migrations, models
5+
6+
7+
class Migration(migrations.Migration):
8+
dependencies = [
9+
("BookOutlet", "0001_initial"),
10+
]
11+
12+
operations = [
13+
migrations.AddField(
14+
model_name="book",
15+
name="author",
16+
field=models.CharField(max_length=100, null=True),
17+
),
18+
migrations.AddField(
19+
model_name="book",
20+
name="is_bestselling",
21+
field=models.BooleanField(default=False),
22+
),
23+
migrations.AlterField(
24+
model_name="book",
25+
name="rating",
26+
field=models.IntegerField(
27+
validators=[
28+
django.core.validators.MinValueValidator(1),
29+
django.core.validators.MaxValueValidator(5),
30+
]
31+
),
32+
),
33+
]

Django/BookStore/BookOutlet/migrations/__init__.py

Whitespace-only changes.

0 commit comments

Comments
 (0)