Limiting the entry that loaded in django admin.

23 views
Skip to first unread message

bolang

unread,
Dec 3, 2012, 11:13:02 PM12/3/12
to django...@googlegroups.com
Hi all,
need some input here.

I have a site with > 15000 images, using django photologue.

When we create a Post (that has Images field in it) from django admin,
all of the images will be loaded in a dropdown.

Before this, it was not create any problem.
Now, after the number of images getting bigger, big chance we got
timeout when try
to create/edit Post.

I think it is possible to limit the loaded images (although i don't know
how to do it).
But, which images that should be loaded?

Any advice?


Thanks before.

Andrew Macgregor

unread,
Dec 3, 2012, 11:24:56 PM12/3/12
to django...@googlegroups.com

Chris Cogdon

unread,
Dec 4, 2012, 12:08:51 AM12/4/12
to django...@googlegroups.com
raw_id_fields is the first step.

also look at django-ajax-selects, which gives you a lot of interesting abilities.

bolang

unread,
Dec 4, 2012, 12:12:10 AM12/4/12
to django...@googlegroups.com
On 12/04/2012 11:24 AM, Andrew Macgregor wrote:

> Try using raw_id_fields:
> https://docs.djangoproject.com/en/dev/ref/contrib/admin/#django.contrib.admin.ModelAdmin.raw_id_fields
> Cheers, Andrew.

It works!
Thanks Andrew,

bolang

unread,
Dec 4, 2012, 4:09:29 AM12/4/12
to django...@googlegroups.com
On 12/04/2012 12:08 PM, Chris Cogdon wrote:
raw_id_fields is the first step.

also look at django-ajax-selects, which gives you a lot of interesting abilities.]

Thanks Chris for the tips.
Will try it!


On Monday, December 3, 2012 8:13:02 PM UTC-8, Bo Lang wrote:
Hi all,
need some input here.

I have a site with > 15000 images, using django photologue.

When we create a Post (that has Images field in it) from django admin,
all of the images will be loaded in a dropdown.

Before this, it was not create any problem.
Now, after the number of images getting bigger,  big chance we got
timeout when try
to create/edit Post.

I think it is possible to limit the loaded images (although i don't know
how to do it).
But, which images that should be loaded?

Any advice?


Thanks before.
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/R9y_b6rbt3wJ.
To post to this group, send email to django...@googlegroups.com.
To unsubscribe from this group, send email to django-users...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

Reply all
Reply to author
Forward
0 new messages