Skip to content

Instantly share code, notes, and snippets.

@makthrow
Created January 30, 2015 07:04
Show Gist options
  • Save makthrow/36db15719f73c9f38cff to your computer and use it in GitHub Desktop.
Save makthrow/36db15719f73c9f38cff to your computer and use it in GitHub Desktop.
class ContactForm(models.Model):
name=models.CharField(max_length=150)
email = models.EmailField(max_length=250)
topic = models.CharField(max_length=200)
message = models.CharField(max_length = 1000)
timestamp = models.DateTimeField(
auto_now_add=True, default =datetime.datetime.now
)
def __unicode__(self):
return self.email
# should this be indented?
#class Meta:
# ordering = ['-timestamp']
# indented meta
class Meta:
ordering = ['-timestamp']
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment