Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8014457
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T19:56:31+00:00 2026-06-04T19:56:31+00:00

I am trying to make multiple profile for Userena – each User can only

  • 0

I am trying to make multiple profile for Userena – each User can only have one Profile type. Following other discussions, I am using multiple table inhertience, but when I do this, I cannot get data to be saved into the derived models. Everything ends up being CommonProfile, which should not be possible/permitted. Example code follows:

in models.py:

# models.py
# This is an example of how i've attempted to get 
# multiple user profiles working with Userena
from django.contrib.auth.models import User
from django.db import models
from userena.models import UserenaLanguageBaseProfile

class CommonProfile(UserenaLanguageBaseProfile):
    """Common fields for 2 user profiles: Spam and Eggs"""
    user = models.OneToOneField(User)
    common_field = models.CharField(max_length=100)

    @property
    def is_spam(self):
        """Find out if this is a Spam user"""
        try:
            self.spamprofile
            return True
        except SpamProfile.DoesNotExist:
            return False

    def get_real_type(self):
        """return the real model"""
        if self.is_spam:
            return self.spamprofile
        else:
            return self.eggsprofile

class SpamProfile(CommonProfile):
    spam_field = models.CharField(max_length=20)

class EggsField(CommonProfile):
    eggs_field = models.SmallIntegerField()

in forms.py

# forms.py
# This is the form to sign up a Spam Type Person

from django import forms
from userena.forms import SignupFormTos
from . models import CommonProfile, SpamProfile

class SpamSignupForm(SignupFormTos):
    """signup a Spam Person"""
    common_field = forms.CharField(label='what is your quest')
    spam_field = forms.CharField(label='what kind of spam are you')

    def clean(self):
        cleaned_data = super(SpamSignupForm,self).clean()
        #do stuf, same idea for clean_<field>
        return cleaned_data

    def save(self):
        """Save the SpamProfile"""
        user = super(SpamSignupForm,self).save()
        common_profile = user.get_profile()
        spam_profile = SpamProfile(commonprofile_ptr=common_profile)
        spam_profile.spam_field = self.cleaned_data['spam_field']
        spam_profile.save()
        return spam_profile
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T19:56:32+00:00Added an answer on June 4, 2026 at 7:56 pm

    I had the same problem this weekend. Try in your save function

    def save:
      #your other code
       spam_field = self.cleaned_data['spam_field']
       new_spam_user = SpamProfile.objects.create_user(spam_field)
    
       return new_user
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to make multiple consecutive HttpWebRequest in WP7. Each one uses info (an
I've been trying to make a module, command-line-like application. Each module can hold multiple
Im trying to make multiple quizes that will keep track of each quiz on
I am trying to make a PointCloud mapping user with multiple kinects on Processing.
I am trying to make a matplotlib figure that will have multiple horizontal boxplots
I have been trying to make wall post from multiple pages but when i
I have a C# application and I'm trying to make it support multiple languages
I'm trying to make an app that can work on multiple devices. Desktop, Mobile
I am trying to make a program about recipes. The user would have to
I'm trying to make system of multiple dialogs in one page using jquery dialog...

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.