mirror of https://gitlab.crans.org/bde/nk20
création de l'interface admin temporaire
This commit is contained in:
parent
4de2e987ef
commit
a481adbae4
|
@ -1,3 +1,29 @@
|
||||||
from django.contrib import admin
|
from django.contrib import admin
|
||||||
|
from note_kfet.admin import admin_site
|
||||||
|
|
||||||
# Register your models here.
|
from .models import QR_code, Basic_food, Transformed_food, Allergen
|
||||||
|
|
||||||
|
|
||||||
|
@admin.register(QR_code, site = admin_site)
|
||||||
|
class QR_codeAdmin(admin.ModelAdmin):
|
||||||
|
"""
|
||||||
|
TEMPORARY
|
||||||
|
"""
|
||||||
|
|
||||||
|
@admin.register(Basic_food, site = admin_site)
|
||||||
|
class Basic_foodAdmin(admin.ModelAdmin):
|
||||||
|
"""
|
||||||
|
TEMPORARY
|
||||||
|
"""
|
||||||
|
|
||||||
|
@admin.register(Transformed_food, site = admin_site)
|
||||||
|
class Transformed_foodAdmin(admin.ModelAdmin):
|
||||||
|
"""
|
||||||
|
TEMPORARY
|
||||||
|
"""
|
||||||
|
|
||||||
|
@admin.register(Allergen, site = admin_site)
|
||||||
|
class AllergenAdmin(admin.ModelAdmin):
|
||||||
|
"""
|
||||||
|
TEMPORARY
|
||||||
|
"""
|
||||||
|
|
|
@ -0,0 +1,19 @@
|
||||||
|
# Generated by Django 2.2.28 on 2024-05-21 09:03
|
||||||
|
|
||||||
|
from django.db import migrations, models
|
||||||
|
import django.db.models.deletion
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('food', '0001_initial'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.AlterField(
|
||||||
|
model_name='transformed_food',
|
||||||
|
name='transformed_ingredient',
|
||||||
|
field=models.ForeignKey(blank=True, on_delete=django.db.models.deletion.CASCADE, related_name='+', to='food.Transformed_food', verbose_name='transformed ingredient'),
|
||||||
|
),
|
||||||
|
]
|
|
@ -0,0 +1,19 @@
|
||||||
|
# Generated by Django 2.2.28 on 2024-05-21 09:10
|
||||||
|
|
||||||
|
from django.db import migrations, models
|
||||||
|
import django.db.models.deletion
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('food', '0002_auto_20240521_1103'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.AlterField(
|
||||||
|
model_name='transformed_food',
|
||||||
|
name='transformed_ingredient',
|
||||||
|
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='+', to='food.Transformed_food', verbose_name='transformed ingredient'),
|
||||||
|
),
|
||||||
|
]
|
|
@ -211,6 +211,8 @@ class Transformed_food(models.Model):
|
||||||
transformed_ingredient = models.ForeignKey(
|
transformed_ingredient = models.ForeignKey(
|
||||||
"self",
|
"self",
|
||||||
on_delete = models.CASCADE,
|
on_delete = models.CASCADE,
|
||||||
|
blank = True,
|
||||||
|
null = True,
|
||||||
related_name = '+',
|
related_name = '+',
|
||||||
verbose_name = _('transformed ingredient'),
|
verbose_name = _('transformed ingredient'),
|
||||||
)
|
)
|
||||||
|
|
|
@ -0,0 +1,7 @@
|
||||||
|
from django.urls import path
|
||||||
|
|
||||||
|
from . import views
|
||||||
|
|
||||||
|
urlpatterns = [
|
||||||
|
path('', views.index, name='index')
|
||||||
|
]
|
|
@ -1,3 +1,5 @@
|
||||||
from django.shortcuts import render
|
from django.shortcuts import render
|
||||||
|
from django.http import HttpResponse
|
||||||
|
|
||||||
# Create your views here.
|
def index(request):
|
||||||
|
return HttpResponse('test')
|
||||||
|
|
|
@ -21,6 +21,7 @@ urlpatterns = [
|
||||||
path('activity/', include('activity.urls')),
|
path('activity/', include('activity.urls')),
|
||||||
path('treasury/', include('treasury.urls')),
|
path('treasury/', include('treasury.urls')),
|
||||||
path('wei/', include('wei.urls')),
|
path('wei/', include('wei.urls')),
|
||||||
|
path('food/',include('food.urls')),
|
||||||
|
|
||||||
# Include Django Contrib and Core routers
|
# Include Django Contrib and Core routers
|
||||||
path('i18n/', include('django.conf.urls.i18n')),
|
path('i18n/', include('django.conf.urls.i18n')),
|
||||||
|
|
Loading…
Reference in New Issue