Django

Code

Changeset 8097

Show
Ignore:
Timestamp:
07/26/08 20:18:18 (6 months ago)
Author:
mtredinnick
Message:

Changed one of the model_formsets tests to be immune to the differences in the
natural collation ordering used by different databases (normally, this test
would fail on PostgreSQL, but not because the code was incorrect). This is
purely a test tweak.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/trunk/tests/modeltests/model_formsets/models.py

    r8091 r8097  
    2121    authors = models.ManyToManyField(Author) 
    2222    created = models.DateField(editable=False) 
    23      
     23 
    2424    def __unicode__(self): 
    2525        return self.name 
     
    290290As you can see, 'Le Spleen de Paris' is now a book belonging to Charles Baudelaire. 
    291291 
    292 >>> for book in author.book_set.order_by('title'): 
     292>>> for book in author.book_set.order_by('id'): 
    293293...     print book.title 
     294Les Fleurs du Mal 
    294295Le Spleen de Paris 
    295 Les Fleurs du Mal 
    296296 
    297297The save_as_new parameter lets you re-associate the data to a new instance.