提供选择列表我有一个带有ChoiceField的表单,通常允许在一系列整数值之间进行选择。 class FormNumber(forms.Form):
list=[]
for i in range(1, 11):
list.append((i,i))
number=forms.ChoiceField(choices=list, initial=1)
现在我需要重写在某些情况下,
我可以看到问题,我附上我的代码和错误页面。 在我的模板,我有: {% if user.get_profile.is_store %}
<!--DO SOME LOGIC-->
{%endif%}
在我看来,我有: def downloads(request):
"""
Downloads page, a user facing page for the trade member
基本帐户 class BaseAccount(models.Model):
user = models.ForeignKey(User, unique=True)
def __unicode__(self):
"""
Return the unicode representation of this customer, which is the user's
f