I too "protect" code from being interpreted at import time by putting import statements directly in the tasks that need them. I don't think there is anything wrong with this approach the from a Python perspective other than possibly these:
* imports are parsed at runtime and thus an import occurs for each time the code is run <=== performance problem * import errors aren't discovered until runtime I too am looking for a better way to do this. Brian On Mon, Mar 7, 2011 at 8:25 AM, Shawn Milochik <sh...@milochik.com> wrote: > If there's a "correct" way to do this I'd love to hear it also. > > At present I do the model imports in tasks.py within the task that > requires the model. This is because in my models.py I import tasks > from tasks.py. > > Shawn > > -- > You received this message because you are subscribed to the Google Groups > "Django users" group. > To post to this group, send email to django-users@googlegroups.com. > To unsubscribe from this group, send email to > django-users+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/django-users?hl=en. > > -- Brian Bouterse ITng Services -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.