Note that there are some explanatory texts on larger screens.

plurals
  1. PODjango Admin Inline objects
    primarykey
    data
    text
    <p>I'm completely new to Django coming from PHP and therefore struggling a little with the terminology. This makes searching for an answer quite hard. Hopefully, somebody can tell me if this can be done within the excellent Django admin.</p> <p>Ok, so the idea is that I have a questionaire which will be filled in by members of the design world. The questionaire class has very few fields, title, introduction, date.</p> <p>The questions have their own class, there is a limited number in this case 20 and they are the same on each questionaire.</p> <p>Therefore I have an answers class, the answer belongs to both a questionaire and a question.</p> <pre><code>class Questionaire(models.Model): title = models.CharField(max_length=255) intro = models.TextField(max_length=4000) date_entered = models.DateField() date_modified = models.DateField() def __unicode__(self): return self.title class Question(models.Model): title = models.CharField(max_length=255) number = models.IntegerField() def __unicode__(self): return self.title class Answer(models.Model): response = models.TextField(max_length=4000) questionaire = models.ForeignKey('articles.Questionaire') question = models.ForeignKey('articles.Question') def __unicode__(self): return self.response </code></pre> <p>Sorry about the formatting above What I am needing in the Questionaire admin is for each question, an answer field is available inline. If possible with the question name as the form field name.</p> <p>Is this possible within Django admin?</p> <p>Would be most grateful for any assistance</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload