Thanks for the replies. Couldn't there be any way to do this without
using a get_form function? I found a tutorial on James's blog (http://
www.b-list.org/weblog/2006/jun/07/django-tips-write-better-template-tags/)
and it uses something like {% get_latest comments.Comment 5 as
recent_comments %} to point to a model and return the 5 latest
comments. I guess this would be something for the users mailing list
now. I just thought it would be neat if Django automatically did this.

On Jan 11, 4:32 pm, Malcolm Tredinnick <[email protected]>
wrote:
> On Sun, 2009-01-11 at 13:06 -0800, issya wrote:
> > Would it be possible to get a feature added that is like
> > django.db.models.get_model? With the get_model function you can use it
> > in a template tag and get a model out of it. I am sure you already
> > know this though. :) But it would be great to be able to do the same
> > thing with a form.
>
> get_model() only works because all models are "registered" with Django
> (which is primarily required to implement backwards-relations, but can
> also be exploited by something like the admin to get a list of models).
> There's no concept of forms being registered. That is, Django has
> precisely no idea what forms exist in your Python files. So get_form()
> wouldn't work without adding extra requirements.
>
> Even registering the forms automatically (if we only restricted things
> to python files in installed apps, which would be a restriction on what
> is possible now) would be quite painful.
>
> So I don't think this is a very practical idea.
>
> Regards,
> Malcolm
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to