You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

22 lines
609 B
Python

from __future__ import unicode_literals
from django.utils.encoding import python_2_unicode_compatible
from django.utils.timezone import now as tznow
from django.db import models
@python_2_unicode_compatible
class QA(models.Model):
question = models.CharField(max_length=255)
answer = models.TextField()
last_modified = models.DateTimeField(default=tznow, editable=False)
class Meta:
db_table = 'nano_faq_qa'
def __str__(self):
return self.question
def save(self, *args, **kwargs):
self.last_modified = tznow()
super(QA, self).save(*args, **kwargs)