Django

Code

Show
Ignore:
Timestamp:
06/11/08 23:13:16 (7 months ago)
Author:
adrian
Message:

Fixed #7026 -- Fixed misleading/incorrect exception text when adding to a many-to-many set on an object that doesn't yet have a primary-key value. Thanks for the report, ryan@peaceworks.ca

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/trunk/tests/modeltests/many_to_many/models.py

    r7477 r7622  
    4040# Create an Article. 
    4141>>> a1 = Article(id=None, headline='Django lets you build Web apps easily') 
     42 
     43# You can't associate it with a Publication until it's been saved. 
     44>>> a1.publications.add(p1) 
     45Traceback (most recent call last): 
     46... 
     47ValueError: 'Article' instance needs to have a primary key value before a many-to-many relationship can be used. 
     48 
     49# Save it! 
    4250>>> a1.save() 
    4351