28 lines
614 B
Python
28 lines
614 B
Python
from agenda_culturel.models import Category
|
|
|
|
|
|
def run():
|
|
# concert, théâtre, jeune public, danse, arts du spectacle, exposition
|
|
# conférence, nature,
|
|
# divers
|
|
|
|
categories = [
|
|
("Théâtre"),
|
|
("Concert"),
|
|
("Danse"),
|
|
("Arts du spectacle"),
|
|
("Jeune public"),
|
|
("Exposition"),
|
|
("Conférence"),
|
|
("Nature"),
|
|
("Autre"),
|
|
]
|
|
|
|
if len(Category.objects.all()) <= 1:
|
|
print("On créée des catégories")
|
|
for c in categories:
|
|
cat = Category(
|
|
name=c[0]
|
|
)
|
|
cat.save()
|