On 3/30/06, yml <[EMAIL PROTECTED]> wrote:
>
> I don't set any value for the profile_id. This attribute where added by
> django, I guess in order to have a "primary key".
> If I comment the line with set_localisation (which is my many to many
> relation) I do not get this error so I do not see why I should care
> about this with this additional attribute.
>
> since I am creating a new profile how can I know whick is the next
> available integer for my primary key. I was expecting to have it
> automatically managed by Dango.
>

If you print new_data['localisation'], I think you can get a list of
string format ids. So in M-R branch, you should get all the objects
according to the ids, just like:

objs = localisations.get_in_bulk(new_data['localisation'])

I'm not sure that if the new_data['localisation'] is a integer list,
because the ID field is a integer data type, so maybe you should
convert a string list to a integer list, just like:

a = map(int, new_data['localisation'])

and

temp.set_localisation(objs)

--
I like python!
My Blog: http://www.donews.net/limodou
My Site: http://www.djangocn.org
NewEdit Maillist: http://groups.google.com/group/NewEdit

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~----------~----~----~----~------~----~------~--~---

Reply via email to