Skip to content

Instantly share code, notes, and snippets.

@melardev
Last active February 21, 2019 13:58
Show Gist options
  • Save melardev/78a3cf066abe27594555bd62061acda7 to your computer and use it in GitHub Desktop.
Save melardev/78a3cf066abe27594555bd62061acda7 to your computer and use it in GitHub Desktop.
Model used in CreateView tutorial
class ModelDummyUser(models.Model):
first_name = models.CharField(max_length=100)
last_name = models.CharField(max_length=100, null=False)
age = models.IntegerField(validators=[MinValueValidator(3), MaxValueValidator(100)])
created_at = models.DateTimeField(auto_now_add=True, editable=False)
def get_absolute_url(self):
return reverse('demos-ui-createview')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment