Changes between Initial Version and Version 1 of Ticket #935
- Timestamp:
- Nov 27, 2005, 2:54:43 PM (19 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #935 – Description
initial v1 1 1 if I take a model like: 2 2 {{{ 3 3 class Account(meta.Model): 4 4 user = meta.OneToOneField(auth.User, core=True) 5 5 kid_name = meta.CharField(...) 6 6 }}} 7 7 which extends the User model, and then have: 8 8 {{{ 9 9 class Transaction(meta.Model): 10 10 account = meta.ForeignKey(Account) … … 12 12 date = meta.DateField(default=datetime.datetime.today()) 13 13 note = meta.CharField(maxlength=200, default='') 14 14 }}} 15 15 16 16 to associate many transactions w/ each account, everything works fine, including the admin pages. 17 17 18 18 If I add "edit_inline=True, core=True" to the account ForeignKey description, then creating Accounts through the admin interface fails with an error: 19 19 {{{ 20 20 AttributeError at /admin/accounts/accounts/add/ 21 21 'Account' object has no attribute 'user' … … 25 25 Exception Value: 'Account' object has no attribute 'user' 26 26 Exception Location: /Users/davidascher/django/django/core/meta/__init__.py in manipulator_save, line 1754 27 }}} 27 28 28 29 The request object looks like: … … 32 33 Adding the account through the API works just fine: 33 34 35 {{{ 34 36 >>> u = users.get_list()[0] 35 37 >>> a = Account(user=u, kid_name='foo') 36 38 >>> a.save() 39 }}} 37 40 38 41 Puzzledly,