Sunday, October 18, 2009

Re: Linking items from the same model

On 17 oct, 21:00, Oleg Oltar <oltarase...@gmail.com> wrote:
> I tried to do it. It works really nice.
>
> I wonder how can I query all articles related to the current one in a
> view... Need some examples.

others = current_article.related.all() # or any queryset method

> Also currently I see all articles in a listbox...And as far as I have more
> then 200 in the database it's quite hard to select something. Maybe its
> possible to arrange some filters to the list?

I strongly suggest you spend some time reading the FineManual(tm).
wrt/ your questions, the following links might help you...

http://docs.djangoproject.com/en/dev/ref/models/querysets/
http://docs.djangoproject.com/en/dev/topics/forms
http://docs.djangoproject.com/en/dev/topics/forms/modelforms/
http://docs.djangoproject.com/en/dev/ref/contrib/admin/

--~--~---------~--~----~------------~-------~--~----~
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+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate