I have around 15 or so models in my system, and I find it pretty
tedious to have to explicitly import each and every one into my
forms.py etc.

Is there no way to call all models implicitly. For example:

from mysite.myapp import models

PS. I tried looking round the documentation. I found this:
http://www.djangobook.com/en/1.0/chapter08/

********************

As explained in Chapter 3, each entry in the URLconf includes its
associated view function, passed directly as a function object. This
means it’s necessary to import the view functions at the top of the
module.

But as a Django application grows in complexity, its URLconf grows,
too, and keeping those imports can be tedious to manage. (For each new
view function, you have to remember to import it, and the import
statement tends to get overly long if you use this approach.) It’s
possible to avoid that tedium by importing the views module itself.
This example URLconf is equivalent to the previous one:

from django.conf.urls.defaults import *
from mysite import views

urlpatterns = patterns('',
    (r'^now/$', views.current_datetime),
    (r'^now/plus(\d{1,2})hours/$', views.hours_ahead),
    (r'^now/minus(\d{1,2})hours/$', views.hours_behind),
    (r'^now/in_chicago/$', views.now_in_chicago),
    (r'^now/in_london/$', views.now_in_london),
)
********************


So I know it is possible with views (although I also know that it is
not even necessary to import views at all in the urlconf)

Thanks,
--~--~---------~--~----~------------~-------~--~----~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to