Skip to content

Commit

Permalink
Updating django import script "all_models"
Browse files Browse the repository at this point in the history
  • Loading branch information
Victor Ferraz committed Feb 14, 2016
1 parent a1b6477 commit fdae3ff
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions iprofile/scripts/django/all_models.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
# -*- coding: utf-8 -*-


def load(__builtin__):
def load(__builtin__, exclude=[]):
from django.apps import apps

for _, models in apps.all_models.items():
for model in models.values():
setattr(__builtin__, model.__name__, model)
for app, models in apps.all_models.items():
if app not in exclude:
for model in models.values():
setattr(__builtin__, model.__name__, model)

0 comments on commit fdae3ff

Please sign in to comment.