I am new to Django and trying to create an App with two User Types 
(Freelancers and Customers). I understand how to create a User profile 
Class and it works well for me:

class UserProfile(models.Model):
    user = models.OneToOneField(User)
    description = models.CharField(max_length=100, default='')
    country = models.CharField(max_length=100, default='')
    website = models.URLField(default='')
    phone = models.IntegerField(default=0)
def create_profile(sender, **kwargs):
    if kwargs['created']:
        user_profile = UserProfile.objects.create(user=kwargs['instance'])


post_save.connect(create_profile, sender=User)

This works well for me on a one user type user. But now I am building an 
app with 2 types of users (freelancers and customers), what is the best 
approach to get this done. Both users will have different view and info. 
Should I:

   - Create 2 different apps, and repeat the normal registeration and login 
   for each.
   - If I do the above, hope the freelancers when logged in won't access 
   customers view.
   - How do I add user type to the user profile if I decide to use one app 
   and model for it.  Please I need a step by step beginner approach, or a 
   link to relevant source. Thanks.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/7c9f19a0-0e25-4529-9353-6e69b1d9e695%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to