Opened 10 years ago

Closed 10 years ago

#22964 closed Uncategorized (invalid)

I'm a new user from China,I got a problem with the 'choices' of the fields option.

Reported by: zhaoxp1230@… Owned by: nobody
Component: Documentation Version: 1.6
Severity: Normal Keywords: fields choices models
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: yes UI/UX: no

Description

First, I got this error from the terminal :
main.province: "name": "choices" should be a sequence of two-item iterables (e.g. list of 2 item tuples).
But I don't need two-item,I don't want to use the short description like ('S','small'),('L','large').I just want use 'small','large' immediately.

Second, I tried use it like LIST=(('S','small'),('L','large')) , but I don't know how to write the function below:
class XXX:
...
name=CharField(max_length = 10, choices = LIST)
...
def unicode(self):

#HOW TO WRITE THE RETURN SCENTENCE???
return ????

I got NONE in the brows where should list the XXX instnce.
Sorry , I don't know how to use the image option of this site.
I got 'S' / 'L' in the select form , but I want 'small' / 'large'.this is the reason why I don't want to use two-item in the choice LIST.
Thanks for getting help from you ! I think Django is wonderful. I am learning it everyday.

Change History (1)

comment:1 by Baptiste Mispelon, 10 years ago

Resolution: invalid
Status: newclosed

Hi and welcome,

This place is for reporting issues against Django itself. If you need help, you should ask on IRC or on the django-users mailing list.

See here: https://docs.djangoproject.com/en/1.6/faq/help/

Thanks.

Note: See TracTickets for help on using tickets.
Back to Top