Changes between Initial Version and Version 1 of Ticket #8576


Ignore:
Timestamp:
Aug 26, 2008, 5:38:40 PM (16 years ago)
Author:
Ramiro Morales
Comment:

reformatted description

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #8576 – Description

    initial v1  
    11Got the assertions failed recently:
    2 
     2{{{
    33  File "C:\Projects\houserules\www\hrdb\events\hrpercustomerobject.py", line 14, in <module>
    44    class HRPerCustomerObject(models.Model):
     
    99AssertionError: AutoFields must have primary_key=True.
    1010make: *** [_reset] Error 1
    11 
     11}}}
    1212and
    13 
     13{{{
    1414  File "C:\Projects\houserules\www\django\db\models\options.py", line 117, in _prepare
    1515    model.add_to_class('id', auto)
     
    2020AssertionError: A model can't have more than one AutoField.
    2121make: *** [_reset] Error 1
    22 
     22}}}
    2323Depending on the logic and the scenario, it may be really worthy to have several AutoFields in a model (for example, when one or both of them in some cases is controlled manually), one of which will definitely not be a primary key.
    2424I roughly described one of possible scenarios in [http://oebfare.com/logger/django/2008/08/26/ IRC], though this may be not the only one.
Back to Top