Code

Changes between Version 6 and Version 7 of RemovingTheMagic


Ignore:
Timestamp:
12/07/05 07:59:39 (9 years ago)
Author:
adrian
Comment:

Changed "objects_" behavior

Legend:

Unmodified
Added
Removed
Modified
  • RemovingTheMagic

    v6 v7  
    7979}}} 
    8080 
    81 If a model already has an {{{objects}}} attribute, the field-accessor attribute is renamed to {{{objects_}}}. 
     81If a model already has an {{{objects}}} attribute, you'll need to specify an alternate name for the magic {{{objects}}}. 
    8282 
    8383{{{ 
     
    8787    last_name = models.CharField(maxlength=30) 
    8888    objects = models.TextField() 
     89    class META: 
     90        manager = Manager(name='more_objects') 
    8991 
    90 p = Person(first_name='Mary', last_name='Jones', objects_='Hello there.') 
     92 
     93p = Person(first_name='Mary', last_name='Jones', objects='Hello there.') 
    9194p.save() 
    92 p.objects_ == 'Hello there.' 
     95p.objects == 'Hello there.' 
     96Person.more_objects.get_list() 
    9397}}} 
    9498