python - Django; empty model for Foreign Key attachment -
i'm building cms asked questions page... want "frequently asked questions" show in main admin menu , when clicked reveal big list of editable question/answer pairs. there needs 1 instance of faq model , doesn't need have information on own... how this?
class faq(models.model): class qanda(models.model): reference = models.foreignkey(faq) question = models.charfield() answer = models.charfield() def __unicode__(self): return self.question this returns error indent expected after class faq(models.model): need add achieve result?
syntactic answer: need @ least pass satisfy python's desire indented statement. semantic answer: i'm not sure understand 100% why want class in first place, sounds hack admin screen maybe describe more specifically.
Comments
Post a Comment