Guest User

Untitled

a guest
Oct 19th, 2017
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.81 KB | None | 0 0
  1. OperationalError at /admin/login/person/
  2. (1054, "Unknown column 'login_person.status_info' in 'field list'")
  3. Request Method: GET
  4. Request URL: http://127.0.0.1:8000/admin/login/person/
  5. Django Version: 1.11
  6. Exception Type: OperationalError
  7. Exception Value:
  8. (1054, "Unknown column 'login_person.status_info' in 'field list'")
  9. Exception Location: D:UsersPubuduAppDataLocalProgramsPythonPython36libsite-packagesMySQLdbconnections.py in query, line 292
  10. Python Executable: D:UsersPubuduAppDataLocalProgramsPythonPython36python.exe
  11. Python Version: 3.6.1
  12. Python Path:
  13. ['C:\Users\Pubudu\workspace\village',
  14. 'D:\Users\Pubudu\AppData\Local\Programs\Python\Python36\python36.zip',
  15. 'D:\Users\Pubudu\AppData\Local\Programs\Python\Python36\DLLs',
  16. 'D:\Users\Pubudu\AppData\Local\Programs\Python\Python36\lib',
  17. 'D:\Users\Pubudu\AppData\Local\Programs\Python\Python36',
  18. 'D:\Users\Pubudu\AppData\Local\Programs\Python\Python36\lib\site-packages']
  19. Server time: Fri, 19 May 2017 15:06:24 +0000
  20.  
  21. class Person(models.Model):
  22. person_id = models.UUIDField(primary_key = True, default=uuid.uuid4)
  23. #date_created = models.DateField(auto_now_add = True)
  24. first_name = models.CharField(max_length = 50)
  25. last_name = models.CharField(max_length = 100)
  26. date_of_birth = models.DateField()
  27. email = models.EmailField()
  28. phone_number = PhoneNumberField()
  29.  
  30. address_1 = models.CharField(max_length = 200)
  31. address_2 = models.CharField(blank=True, max_length = 200)
  32. city = models.CharField(max_length = 100)
  33.  
  34. state = USStateField()
  35.  
  36. zipcode = USZipCodeField()
  37. country = models.CharField(max_length = 40)
  38. status_info = models.TextField(blank = True)
  39.  
  40.  
  41. USER_TYPE = (
  42. ('a', 'Patron'),
  43. ('b', 'Chef'),
  44. ('c', 'Driver'),
  45. )
  46. user_type = models.CharField(max_length=6, choices=USER_TYPE, default='a', help_text='User type')
  47.  
  48. USER_STATUS = (
  49. ('a', 'Active'),
  50. ('b', 'License_approved'),
  51. ('c', 'Suspended'),
  52. ('d', 'Pending'),
  53. ('e', 'Terminated'),
  54. ('f', 'Terminated for ever'),
  55. )
  56. person_status = models.CharField(max_length=1, choices=USER_STATUS, default='d', help_text='Registered user status')
  57.  
  58. #class Meta:
  59. #ordering = ["-last_name"]
  60.  
  61. def __str__(self):
  62. """
  63. String for representing the Model object.
  64. """
  65. return '(%s)' % (str(self.person_id))
  66.  
  67. from django.contrib import admin
  68. from .models import Person
  69. # Register your models here.
  70.  
  71. class PersonAdmin(admin.ModelAdmin):
  72. list_display = [field.name for field in getattr(Person, '_meta').get_fields()
  73. '_meta').get_field_by_name('location_x')[0].name
  74. if not getattr(Person, '_meta').get_field('first_name').name
  75. ]
  76. pass
  77.  
  78. admin.site.register(Person, PersonAdmin)
Add Comment
Please, Sign In to add comment