Signals or no signals I think your profile model is wrong. By making
it a subclass of User you're effectively getting all the fields of the
User model.
Write your profile model like this instead:
class Employee(models.Model):
user = models.ForeginKey(User)
address = models.CharField(...)
Found My mistake, create parent_link:
class Employee(User):
user = models.OneToOneField(User, parent_link=True)
address = models.CharField(max_length=50, null=True, blank=True)
phone1 = models.CharField(max_length=15, null=True, blank=True)
phone2 =
Hi!
I've got user profile, that uses multi-table inheritance:
class Employee(User):
address = models.CharField(max_length=50, null=True, blank=True)
phone1 = models.CharField(max_length=15, null=True, blank=True)
phone2 = models.CharField(max_length=15, null=True, blank=True)
Hi,
Thank cooteteom and Spajderix!
Both of Your code works!
Thank you very much!
On Aug 4, 6:01 pm, cootetom wrote:
> Hi,
>
> When you create the profile assign request.user to the user, so:
>
> profile_obj = UserProfile(user = request.user)
>
> Also in the UserProfile
Hi,
you have to create new "User" object, assign values to it and then
assign this object to profile_obj. Example:
from django.contrib.auth.models import User
new_user = User()
profile_obj = UserProfile()
new_user.username = 'someusername'
new_user.password = 'somepassword'
new_user.save()
Hi,
When you create the profile assign request.user to the user, so:
profile_obj = UserProfile(user = request.user)
Also in the UserProfile model make sure that the entries that are
allowed to be blank are set up to allow that, eg:
address = models.CharField(max_length=60, blank = True)
Hi all,
I have built a model like this:
class UserProfile(models.Model):
address = models.CharField(max_length=60)
birthday = models.DateField()
user = models.ForeignKey(User)
I render the model by the ModelForm:
class UserProfileForm(ModelForm):
class Meta:
model =
7 matches
Mail list logo