Am 2007-09-26 um 17:47 schrieb Nabuco:
> I have two tables (video, videokeyword) involved in a many2many
> relationship which results in a 3rd table (video_keywords_list). A
> video element can have many keyword elements, and otherwise, a keyword
> element can have (be present) in many video elem
Within the Meta class of the Model you can set the default ordering of
objects when getting a list of them.
class Meta:
ordering = ['field_to_order_by']
-richard
On 9/26/07, Vitaliy <[EMAIL PROTECTED]> wrote:
>
>
> For example i have this model:
>
> class Post(models.Model):
>#some file
For example i have this model:
class Post(models.Model):
#some fileds
class Comment(models.Model):
post = models.ForeignKey(Post)
#some fields
to get all comments for Post I use this:
somePostObject.comment_set.all
is there any posibiliy to set default commet set ordergin ?
--~--~
3 matches
Mail list logo