Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- OperationalError at /admin/login/person/
- (1054, "Unknown column 'login_person.status_info' in 'field list'")
- Request Method: GET
- Request URL: http://127.0.0.1:8000/admin/login/person/
- Django Version: 1.11
- Exception Type: OperationalError
- Exception Value:
- (1054, "Unknown column 'login_person.status_info' in 'field list'")
- Exception Location: D:UsersPubuduAppDataLocalProgramsPythonPython36libsite-packagesMySQLdbconnections.py in query, line 292
- Python Executable: D:UsersPubuduAppDataLocalProgramsPythonPython36python.exe
- Python Version: 3.6.1
- Python Path:
- ['C:\Users\Pubudu\workspace\village',
- 'D:\Users\Pubudu\AppData\Local\Programs\Python\Python36\python36.zip',
- 'D:\Users\Pubudu\AppData\Local\Programs\Python\Python36\DLLs',
- 'D:\Users\Pubudu\AppData\Local\Programs\Python\Python36\lib',
- 'D:\Users\Pubudu\AppData\Local\Programs\Python\Python36',
- 'D:\Users\Pubudu\AppData\Local\Programs\Python\Python36\lib\site-packages']
- Server time: Fri, 19 May 2017 15:06:24 +0000
- class Person(models.Model):
- person_id = models.UUIDField(primary_key = True, default=uuid.uuid4)
- #date_created = models.DateField(auto_now_add = True)
- first_name = models.CharField(max_length = 50)
- last_name = models.CharField(max_length = 100)
- date_of_birth = models.DateField()
- email = models.EmailField()
- phone_number = PhoneNumberField()
- address_1 = models.CharField(max_length = 200)
- address_2 = models.CharField(blank=True, max_length = 200)
- city = models.CharField(max_length = 100)
- state = USStateField()
- zipcode = USZipCodeField()
- country = models.CharField(max_length = 40)
- status_info = models.TextField(blank = True)
- USER_TYPE = (
- ('a', 'Patron'),
- ('b', 'Chef'),
- ('c', 'Driver'),
- )
- user_type = models.CharField(max_length=6, choices=USER_TYPE, default='a', help_text='User type')
- USER_STATUS = (
- ('a', 'Active'),
- ('b', 'License_approved'),
- ('c', 'Suspended'),
- ('d', 'Pending'),
- ('e', 'Terminated'),
- ('f', 'Terminated for ever'),
- )
- person_status = models.CharField(max_length=1, choices=USER_STATUS, default='d', help_text='Registered user status')
- #class Meta:
- #ordering = ["-last_name"]
- def __str__(self):
- """
- String for representing the Model object.
- """
- return '(%s)' % (str(self.person_id))
- from django.contrib import admin
- from .models import Person
- # Register your models here.
- class PersonAdmin(admin.ModelAdmin):
- list_display = [field.name for field in getattr(Person, '_meta').get_fields()
- '_meta').get_field_by_name('location_x')[0].name
- if not getattr(Person, '_meta').get_field('first_name').name
- ]
- pass
- admin.site.register(Person, PersonAdmin)
Add Comment
Please, Sign In to add comment