Advertisement
Guest User

Untitled

a guest
Nov 20th, 2017
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.42 KB | None | 0 0
  1. from django.db import models
  2. from django.utils.encoding import python_2_unicode_compatible
  3.  
  4. @python_2_unicode_compatible  # only if you need to support Python 2
  5. class Question(models.Model):
  6.     # ...
  7.     def __str__(self):
  8.         return self.question_text
  9.  
  10. @python_2_unicode_compatible  # only if you need to support Python 2
  11. class Choice(models.Model):
  12.     # ...
  13.     def __str__(self):
  14.         return self.choice_text
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement