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 8357393
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T10:27:45+00:00 2026-06-09T10:27:45+00:00

class Member(models.Model):# member db table userID = models.CharField(max_length=80,primary_key=True) #user id password = models.CharField(max_length=32)# password

  • 0
class Member(models.Model):# member db table
    userID      = models.CharField(max_length=80,primary_key=True) #user id 
    password    = models.CharField(max_length=32)# password
    nickname    = models.CharField(max_length=100)# user nickname
    penalty     = models.PositiveSmallIntegerField(max_length=10,default=0,null=True)
    participation=models.ForeignKey('Room',default=None,blank=True,null=True)

def __unicode__(self):
        return self.userID

def doJoin(request):
    if request.is_ajax() and request.method == 'POST':
        # check validation
        userID = request.POST['userID']
        userNickname = request.POST['nickname']
        if (checkID(userID) == False) and (checkNickname(userNickname) == False) :
            #save to the database
            newUser = Member()
            newUser.userID = userID
            newUser.nickname = userNickname
            newUser.password = request.POST['password']
            print newUser.userID , newUser.nickname , newUser.password , newUser.penalty , newUser.participation
            newUser.save() #<------------error line!!!!

            return HttpResponse('true')
        else:
            return HttpResponse('false')
    else:
        HttpResponse('false')

line about 8

In function doJoin:

newUser.save() # <--- error... so sad...

What should I do? Help me please.

What’s wrong in this source?

  • 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-09T10:27:47+00:00Added an answer on June 9, 2026 at 10:27 am

    Do you have debugging turned off? If you’re getting a 500 and you have debugging turned on, you’ll get a stack trace with the exception.

    What are checkID() and checkNickname() doing? If those are performing some sort of validation, you really should be doing that in a form class instead of in the view. I also wouldn’t be pulling values directly out of the request.POST to populate your model. I would highly recommend retrieving those values from a form’s cleaned_data dictionary.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this class in my model: class ServiceCharge(models.Model): name = models.CharField(max_length=30) amount =
model.py: class Tribes(Group): members = models.ManyToManyField(User, related_name='tribes', verbose_name=_('members')) i want to store a number
i have a model using m2m feature: class Classroom(models.Model): user = models.ForeignKey(User, related_name =
I have the models User and Group, and the join table Membership which uses
I'm using CakePHP 2.0. I have 2 models/controllers (Category/Coupon): // File: Model/Coupon.php // Table
I created a new model class as my_model.php inside /models folder, and a function
Class member var named id below is of type int. Need to set from
I've got the class member: LineND::LineND(double a ...) { coefficients.push_back(a); va_list arguments; va_start(arguments, a);
Is it possible to access a class member without an instance of the class?
What are the difference between a public class member class data { public: std::list<data>

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.