Anton
1 year ago
3 changed files with 49 additions and 19 deletions
@ -1,4 +1,9 @@ |
|||||||
from django.contrib import admin |
from django.contrib import admin |
||||||
from .models import Content |
from .models import Orders |
||||||
|
|
||||||
admin.site.register(Content) |
|
||||||
|
class OrdersAdmin(admin.ModelAdmin): |
||||||
|
list_display = ('name', 'time_create') |
||||||
|
|
||||||
|
|
||||||
|
admin.site.register(Orders, OrdersAdmin,) |
@ -1,9 +1,19 @@ |
|||||||
from django.db import models |
from django.db import models |
||||||
|
|
||||||
class Content(models.Model): |
|
||||||
name = models.CharField(max_length=100) |
class Orders(models.Model): |
||||||
description = models.TextField() |
name = models.CharField(max_length=100, verbose_name='наименование', null=True) |
||||||
type = models.CharField(max_length=100) |
description = models.TextField(verbose_name='описание', null=True) |
||||||
|
time_create = models.DateTimeField(auto_now_add=True, null=True) |
||||||
|
|
||||||
class Meta: |
class Meta: |
||||||
app_label = 'adminpanel' |
app_label = 'adminpanel' |
||||||
|
verbose_name_plural = 'Заказы' |
||||||
|
|
||||||
|
def __str__(self): |
||||||
|
return self.name |
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in new issue