Re: Can I sort a related model reference in a template?

2011-03-14 Thread Tom Evans
On Sat, Mar 12, 2011 at 1:27 PM, Shawn Milochik wrote: > You can put a sort order in the model's meta info. That way you'll always > have a default sort. > If you do this, every query you execute returning that model will be sorted. This can lead to serious performance issues

Re: Can I sort a related model reference in a template?

2011-03-12 Thread Micah Carrick
Yeash. Don't know how I missed that. Thanks! On Sat, Mar 12, 2011 at 5:27 AM, Shawn Milochik wrote: > You can put a sort order in the model's meta info. That way you'll always > have a default sort. > > -- > You received this message because you are subscribed to the Google

Re: Can I sort a related model reference in a template?

2011-03-12 Thread Shawn Milochik
You can put a sort order in the model's meta info. That way you'll always have a default sort. -- 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,

Can I sort a related model reference in a template?

2011-03-12 Thread Micah Carrick
If I have a Product model which has a one-to-many relationship with ProductImage model... I can get the images in the template using product.productimage_set.all, however, is there any way to sort that or will I instead have to query the product images in the view? -- *Green Tackle* -