Changes between Initial Version and Version 1 of Ticket #935


Ignore:
Timestamp:
Nov 27, 2005, 2:54:43 PM (19 years ago)
Author:
Adrian Holovaty
Comment:

(Fixed formatting in description)

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #935 – Description

    initial v1  
    11if I take a model like:
    2 
     2{{{
    33class Account(meta.Model):
    44    user = meta.OneToOneField(auth.User, core=True)
    55    kid_name = meta.CharField(...)
    6 
     6}}}
    77which extends the User model, and then have:
    8 
     8{{{
    99class Transaction(meta.Model):
    1010    account = meta.ForeignKey(Account)
     
    1212    date = meta.DateField(default=datetime.datetime.today())
    1313    note = meta.CharField(maxlength=200, default='')
    14 
     14}}}
    1515
    1616to associate many transactions w/ each account, everything works fine, including the admin pages.
    1717
    1818If 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{{{
    2020AttributeError at /admin/accounts/accounts/add/
    2121'Account' object has no attribute 'user'
     
    2525Exception Value:        'Account' object has no attribute 'user'
    2626Exception Location:     /Users/davidascher/django/django/core/meta/__init__.py in manipulator_save, line 1754
     27}}}
    2728
    2829The request object looks like:
     
    3233Adding the account through the API works just fine:
    3334
     35{{{
    3436>>> u = users.get_list()[0]
    3537>>> a = Account(user=u, kid_name='foo')
    3638>>> a.save()               
     39}}}
    3740
    3841Puzzledly,
Back to Top