Last active
October 3, 2016 09:03
-
-
Save Neceros/5552a53f88e1d4c6927879271096cd5e to your computer and use it in GitHub Desktop.
How do I get a each field within Event to be random, and not correlate with itself? When I call a new Event I wish each of the fields to have a random entry from the database.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.db import models | |
class Event(models.Model): | |
subject = models.CharField(max_length=256) | |
what = models.CharField(max_length=512) | |
where = models.CharField(max_length=256) | |
extra = models.CharField(max_length=1024) | |
def __str__(self): | |
return "{} {} {} {}".format( | |
self.subject, | |
self.what, | |
self.where, | |
self.extra, | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment