html-over-websockets-with-d.../scripts/create_categories.py

11 lines
227 B
Python
Raw Normal View History

2021-11-12 13:21:37 +01:00
from app.website.models import Category
from faker import Faker
2021-11-12 13:52:41 +01:00
2021-11-12 13:21:37 +01:00
def run():
fake = Faker()
# 5 categories
for word in [fake.unique.sentence(nb_words=1)[0:-1] for i in range(5)]:
2021-11-12 13:52:41 +01:00
Category(name=word).save()