i want add these additional field but i am getting this error. somebody plz 
help me




model.py

from django.db import models

# Create your models here.
from django.db import models

# Create your models here.
from django.db import models

# Create your models here.
from django.contrib.auth.models import User
from django.db import models

# Create your models here.
from django.db.models.signals import post_save
from django.dispatch import receiver


class ExtendedUser(models.Model):
    user = models.OneToOneField(User, on_delete=models.CASCADE)
    job_title = models.CharField(max_length=50)
    allow_in_search = models.BooleanField(default=True)
    experience = models.CharField(max_length=50)
    age = models.IntegerField()
    current_salary = models.IntegerField()
    expected_salary = models.IntegerField()
    education_level = models.CharField(max_length=50)
    languages = models.CharField(max_length=50)
    categories = models.CharField(max_length=500)
    description = models.CharField(max_length=1000)
    facebook = models.CharField(max_length=50)
    twitter = models.CharField(max_length=50)
    google = models.CharField(max_length=50)
    linkdin = models.CharField(max_length=50)
    phone_number = models.IntegerField()
    website = models.CharField(max_length=50)
    city = models.CharField(max_length=50)
    country = models.CharField(max_length=20)

    def __str__(self):
        return self.user.username



views.py


from django.shortcuts import render

# Create your views here.
from django.shortcuts import render

# Create your views here.
from django.shortcuts import render

# Create your views here.
from django.contrib.auth.models import User
from django.http import HttpResponse
from django.shortcuts import render, redirect
from .models import ExtendedUser



# Create your views here.
def user_profile(request):
    if request.method == 'POST':
        job_title = request.POST['job_title1']
        allow_in_search = request.POST['allow_in_search']
        experience = request.POST['experience']
        age = request.POST['age']
        current_salary = request.POST['current_salary']
        expected_salary = request.POST['expected_salary']
        education_level = request.POST['education_levels']
        languages = request.POST['languages']
        categories = request.POST['categories']
        description = request.POST['description']
        facebook = request.POST['facebook']
        twitter = request.POST['twitter']
        linkdin = request.POST['linkdin']
        phone_number = request.POST['phone_number']
        website = request.POST['website']
        city = request.POST['city']
        country = request.POST['country']


        newExtendedUser = ExtendedUser(user=User, job_title=job_title, 
allow_in_search=allow_in_search, experience=experience,
                                       age=age,
                                       current_salary=current_salary, 
expected_salary=expected_salary,
                                       education_level=education_level,
                                       languages=languages, 
categories=categories, description=description,
                                       facebook=facebook,
                                       twitter=twitter, linkdin=linkdin, 
phone_number=phone_number, website=website,
                                       city=city, country=country)

        newExtendedUser.save()
        return redirect('/')

        return HttpResponse("success")
    else:
        return render(request, 'user_profile.html')

-- 
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 django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/ad987f4c-873c-4de5-b31d-2b4d96d38d91%40googlegroups.com.

Reply via email to