It's funny. Everyone I ask about this problem says to use the other
type of Field (either OneToOne or ForeignKey). I have tried both. See
this thread for my problems with OneToOne:
http://groups.google.com/group/django-users/browse_thread/thread/9789d5e4bf24a4c3/
I just recently upgraded from 0.9
On Thu, 2006-09-28 at 17:08 +, gkelly wrote:
> Can a ForeignKey be a primary key?
Possibly not.
> I'm getting the following error.
>
> Here is the relevant part of the model:
>
> class UserProfile(models.Model):
> user = models.ForeignKey(User, primary_key=True,
> edit_inline=models.S
Can a ForeignKey be a primary key? I'm getting the following error.
Here is the relevant part of the model:
class UserProfile(models.Model):
user = models.ForeignKey(User, primary_key=True,
edit_inline=models.STACKED, num_in_admin=1,min_num_in_admin=1,
max_num_in_admin=1,num_extra_on_change=
Thanks for looking into this more. What you said makes sense, and I was
almost on my way to that conclusion. Specifying primary_key=True is
probably what I need. I'll give it a try.
Thanks,
Grant
--~--~-~--~~~---~--~~
You received this message because you are sub
On 9/27/06, gkelly <[EMAIL PROTECTED]> wrote:
>
> > The easiest fix I can think of would be to put a hidden field in your
> > form that holds the id of the current user. This will put a 'user'
> > entry into your form data, which will allow the create/update generic
> > views to submit without err
> The easiest fix I can think of would be to put a hidden field in your
> form that holds the id of the current user. This will put a 'user'
> entry into your form data, which will allow the create/update generic
> views to submit without error.
I definitely do not want to do this for security re
On 9/26/06, froke <[EMAIL PROTECTED]> wrote:
> When I submit the form, I get the following in errors
> (update_object.errors):
> 'user': ['This field is required.']
When you submit your form, you are using create_object/update_object
to create/update your UserProfile instance, based upon the form
Please look at http://pastebin.ca/182266 for my code.
I'm trying to extend the User model (by using a ForeignKey) to a
UserProfile.
I have a template with a form to update some of the fields (all except:
user, updated).
When I submit the form, I get the following in errors
(update_object.errors
8 matches
Mail list logo