fixtures.py 402 B

1234567891011121314
  1. from django.utils.importlib import import_module
  2. def load_app_fixtures(app):
  3. """
  4. See if application has fixtures module defining load_fixtures function
  5. If it does, execute that function
  6. """
  7. app += '.fixtures'
  8. try:
  9. fixture = import_module(app)
  10. fixture.load_fixture()
  11. return True
  12. except (ImportError, AttributeError):
  13. return False