Re: [Django] #14438: Deserializer raises ValidationError if natural key is given as string

2011-11-30 Thread Django
#14438: Deserializer raises ValidationError if natural key is given as string
-+-
 Reporter:  zimnyx   |Owner:  nobody
 Type:  Bug  |   Status:  closed
Component:  Core |  Version:  1.2
  (Serialization)|   Resolution:  duplicate
 Severity:  Normal   | Triage Stage:
 Keywords:   |  Unreviewed
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by kenth):

 * status:  reopened => closed
 * resolution:   => duplicate


Comment:

 The problem you're running into is that your natural key is not in a
 "tuple". This is the same root cause of the problem in #16208. I'm closing
 this one duplicate & posting fix there.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #14438: Deserializer raises ValidationError if natural key is given as string

2010-10-11 Thread Django
#14438: Deserializer raises ValidationError if natural key is given as string
+---
  Reporter:  zimnyx | Owner:  nobody
Status:  closed | Milestone:
 Component:  Serialization  |   Version:  SVN   
Resolution:  worksforme |  Keywords:
 Stage:  Unreviewed | Has_patch:  0 
Needs_docs:  0  |   Needs_tests:  0 
Needs_better_patch:  0  |  
+---
Changes (by ramiro):

  * status:  new => closed
  * resolution:  => worksforme

Comment:

 I've tested  this locally and the YAML generated is correct (see fixtures6
 and fixures8 in Django's `tests/modeltests/fixtures` test case, Visa has a
 FK to Person that has a one-field natural key).

 {{{
 - fields:
 permissions:
 - [add_user, auth, user]
 - [change_user, auth, user]
 - [delete_user, auth, user]
 person: [Django Reinhardt]
   model: fixtures.visa
   pk: 1
 - fields:
 permissions:
 - [add_user, auth, user]
 person: [Stephane Grappelli]
   model: fixtures.visa
   pk: 2
 - fields:
 permissions: []
 person: [Prince]
   model: fixtures.visa
   pk: 3
 }}}

 I suspect the problem is the `natural_key` method of the model your FK
 points to isn't returning a tuple. This is documented:
 http://docs.djangoproject.com/en/1.2/topics/serialization/#serialization-
 of-natural-keys

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-upda...@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #14438: Deserializer raises ValidationError if natural key is given as string

2010-10-11 Thread Django
#14438: Deserializer raises ValidationError if natural key is given as string
+---
  Reporter:  zimnyx | Owner:  nobody
Status:  new| Milestone:
 Component:  Serialization  |   Version:  SVN   
Resolution: |  Keywords:
 Stage:  Unreviewed | Has_patch:  0 
Needs_docs:  0  |   Needs_tests:  0 
Needs_better_patch:  0  |  
+---
Changes (by zimnyx):

  * needs_better_patch:  => 0
  * needs_tests:  => 0
  * needs_docs:  => 0

Comment:

 and in case of m2m relation, in yaml you have to use:
 {{{
 colors: [[red], [green], [blue]]
 }}}

 because:
 {{{
 colors: [red, green, blue]
 }}}
 will also fail with similar ValidationError.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-upda...@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.