﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
12451	limit_choices_to with ajax support	scorpid	nobody	"{{{
class Survey(models.Model):
	name = models.TextField()
	def __unicode__(self):
		return self.name	

class ChoiceGroup(models.Model):
	order = models.IntegerField(max_length=2)
	choice = models.CharField(max_length=60)
	def __unicode__(self):
		return self.choice

class Question(models.Model):
	survey = models.ForeignKey(Survey)
	questionText = models.TextField()
	choices = models.ManyToManyField(ChoiceGroup)
	def __unicode__(self):
		return self.questionText
    
class Answer(models.Model):
	ip = models.CharField(max_length=20)
	question = models.ForeignKey(Question)	
	givenAnswer = models.ForeignKey(ChoiceGroup, limit_choices_to={Question.choices}) '''### i want that given answer can be selectable only 
from question's answers in the admin panel. Is this possible? Or can you make a patch for that? '''
	def __unicode__(self):
		return self.ip
}}}

in the admin->answers form when i choose a question it will limit given answers to my chosen question's answer group. This would be a great feature if you can do it by ajax.   
"		closed	Uncategorized	1.1		invalid			Unreviewed	0	0	0	0	0	0
