Comment sqlite-only changes
This commit is contained in:
parent
3ad1de64f7
commit
a5529c9333
1 changed files with 8 additions and 8 deletions
|
@ -73,15 +73,15 @@ class Command(BaseCommand):
|
|||
|
||||
# À décommenter pour utilisation locale (avec SQLite)
|
||||
|
||||
def _manual_ids(cls, to_create):
|
||||
pid = getattr(cls.objects.order_by("-id").first(), "id", 1)
|
||||
for p in to_create:
|
||||
pid += 1
|
||||
p.id = pid
|
||||
# def _manual_ids(cls, to_create):
|
||||
# pid = getattr(cls.objects.order_by("-id").first(), "id", 1)
|
||||
# for p in to_create:
|
||||
# pid += 1
|
||||
# p.id = pid
|
||||
|
||||
_manual_ids(User, users_to_create)
|
||||
_manual_ids(Profile, profiles_to_create)
|
||||
_manual_ids(Profile.department.through, dept_m2m_to_create)
|
||||
# _manual_ids(User, users_to_create)
|
||||
# _manual_ids(Profile, profiles_to_create)
|
||||
# _manual_ids(Profile.department.through, dept_m2m_to_create)
|
||||
|
||||
User.objects.bulk_create(users_to_create)
|
||||
for profile in profiles_to_create:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue