Hello djangoers.

This is related to my last post (cry for help would be more proper) on
an AddManipulator 'losing' a primary key's value.

I guess the problem's here (pasted from dynamic trace), on
django/db/models/manipulators.py in save (line 101):

auto_now_add    False
f                       <django.db.models.fields.BooleanField object
at 0x2aaaaebd6d90>
new_data          <MultiValueDict: {'go': ['Potrdi'], 'user_id': [3L],
'receive_modif_cars_newsletter': [True],
'receive_new_cars_newsletter': [True], 'newsletter_email':
['[EMAIL PROTECTED]']}>
new_object       <UserProfile: >
param              True
params              {'newsletter_email': '[EMAIL PROTECTED]',
'receive_modif_cars_newsletter': True,  'receive_new_cars_newsletter':
True,  'user_id': None}
self                     <django.db.models.manipulators.AddManipulator
object at 0x2aaaab8cd3d0>

I hope you understand what I pasted. Let me clarify:

new_data is your typical MultiValueDict, and it HAS the user_id value
properly set (or so I believe). But something happens at the "params"
dict, since there 'user_id' is set to None, and naturally the creation
fails.

So I managed to get 'new_data' filled properly to the AddManipulator's
save method, but still a key field is lost.

What might I be doing wrong, I wonder? I repeat, this only happens on
my production server, on Bluehost with Linux+MySql. On my test/dev box
(windows+sqlite) it works without a hitch.

Here's the UserProfile model, for all it's worth:

class UserProfile(models.Model):
        user = models.OneToOneField(User)                       
        newsletter_email = models.EmailField("E-mail to send newsletters",
blank=False, null=False)
        receive_new_cars_newsletter = models.BooleanField("Subscribed to
daily 'new cars' newsletter?", null=False, blank=False, default=True)
        receive_new_cars_newsletter = models.BooleanField("Subscribed to
daily 'new cars' newsletter?", null=False, blank=False, default=True)
        receive_modif_cars_newsletter = models.BooleanField("Subscribed to
daily 'new cars' newsletter?", null=False, blank=False, default=True)
        
        def __str__(self):
                try:
                        return ("%s" % self.user)
                except:
                        return("")

I hope anyone can lend a hand... i'm running into more and more
walls...! THanks a million,
        
-- 
Carlos Yoder
http://blog.argentinaslovenia.com/

--~--~---------~--~----~------------~-------~--~----~
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