Changes between Initial Version and Version 1 of Ticket #8576
- Timestamp:
- Aug 26, 2008, 5:38:40 PM (16 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #8576 – Description
initial v1 1 1 Got the assertions failed recently: 2 2 {{{ 3 3 File "C:\Projects\houserules\www\hrdb\events\hrpercustomerobject.py", line 14, in <module> 4 4 class HRPerCustomerObject(models.Model): … … 9 9 AssertionError: AutoFields must have primary_key=True. 10 10 make: *** [_reset] Error 1 11 11 }}} 12 12 and 13 13 {{{ 14 14 File "C:\Projects\houserules\www\django\db\models\options.py", line 117, in _prepare 15 15 model.add_to_class('id', auto) … … 20 20 AssertionError: A model can't have more than one AutoField. 21 21 make: *** [_reset] Error 1 22 22 }}} 23 23 Depending 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. 24 24 I roughly described one of possible scenarios in [http://oebfare.com/logger/django/2008/08/26/ IRC], though this may be not the only one.