views

Django 1.8 inspectdb command doesn't see PostgreSQL views as per documentation

Django 1.8 inspectdb command doesn't see PostgreSQL views as per documentation Question: I have a Django 1.8 application with a PostgreSQL database. I run the django inspectdb from the command line to examine models for the views, but the views don’t show up in the model output. Here’s the version output: 17:36 $ python well/manage.py …

Total answers: 3

Django: Access given field's choices tuple

Django: Access given field's choices tuple Question: I would like to get the named values of a choices field for a choice that is not currently selected. Is this possible? For instance: models.py FILE_STATUS_CHOICES = ( (‘P’, ‘Pending’), (‘A’, ‘Approved’), (‘R’, ‘Rejected’), ) class File(models.Model): status = models.CharField(max_length=1, default=’P’, choices=FILE_STATUS_CHOICES) views.py f = File() f.status …

Total answers: 2

Class views in Django

Class views in Django Question: Django view points to a function, which can be a problem if you want to change only a bit of functionality. Yes, I could have million keyword arguments and even more if statements in the function, but I was thinking more of an object oriented approach. For example, I have …

Total answers: 9