Re: How to use CommaSeperatedIntegerList with CheckboxSelectMultiple

2010-05-29 Thread Jannon Frank
Don't know if you're still interested, Ben, But I just came across this as I was searching for the best place to tell someone how the django CommaSeparatedIntegerField(CSIF) should be changed. I was basically trying to do the same thing you were. After, taking a look at the django code, I found t

Re: How to use CommaSeperatedIntegerList with CheckboxSelectMultiple

2010-04-27 Thread Kevin Renskers
Works like a charm, thanks! > The issue with the custom field is that it does not implement a > 'validate' func > > I believe all I did to get it working was add: > >     def validate(self, value, model_instance): >         return -- You received this message because you are subscribed to the Go

Re: How to use CommaSeperatedIntegerList with CheckboxSelectMultiple

2010-04-26 Thread Preston Holmes
On Apr 26, 2:28 am, Kevin Renskers wrote: > I also used the multiple select field found > onhttp://www.djangosnippets.org/snippets/1200/ > with success, until I updated Django to the 1.2 beta release. It now > longer works, always giving the validation error. I have no clue how > to fix this, s

Re: How to use CommaSeperatedIntegerList with CheckboxSelectMultiple

2010-04-26 Thread Bill Freeman
Kevin, I've not used Djanog 1.2 yet, so I haven't seen and fixed any similar problem. I can offer 2 suggestions: 1. pdb is your friend. Learn it, love it. (Very tasty under Gnu Emacs with python mode, start runserver from an emacs shell window with a pdb.set_trace() style breakpoint installed

Re: How to use CommaSeperatedIntegerList with CheckboxSelectMultiple

2010-04-26 Thread Kevin Renskers
I also used the multiple select field found on http://www.djangosnippets.org/snippets/1200/ with success, until I updated Django to the 1.2 beta release. It now longer works, always giving the validation error. I have no clue how to fix this, so I was hoping you found the answer to your problem an

Re: How to use CommaSeperatedIntegerList with CheckboxSelectMultiple

2010-04-09 Thread Keith
This sounds like a ChoiceField instead of a MultipleChoiceField. A CheckboxSelectMultiple has to be used with a MultipleChoiceField. Refer to: http://ontehfritz.wordpress.com/2009/02/15/django-forms-choicefield-and-multiplechoicefield/ Hope this helps. On Apr 2, 12:09 pm, ben wrote: > Hi, I a

Re: How to use CommaSeperatedIntegerList with CheckboxSelectMultiple

2010-04-04 Thread Bill Freeman
Perchance are you somehow passing a list of list? When the validator strips off the outer list, it would get a list instead of a string, which would match the error message (that's the only reason I suggest it). Otherwise, pdb is your friend. I particularly like running the dev server under emac

Re: How to use CommaSeperatedIntegerList with CheckboxSelectMultiple

2010-04-03 Thread ben
Either I don't understand how CheckboxSelectMultiple works or there is a bug in Django 1.2. I have tried the following custom multi select fields I have found around the web. http://www.djangosnippets.org/snippets/1200/ http://www.davidcramer.net/code/181/custom-fields-in-django.html Out of despe

Re: How to use CommaSeperatedIntegerList with CheckboxSelectMultiple

2010-04-02 Thread Bill Freeman
I know that I used (some revision of) that snippet a while back. Realize that what it stores is a string, containing digits and commas. The to_python and get_db_prep_value methods are responsible for converting between that database single string and a list of strings, not integers. You can use

Re: How to use CommaSeperatedIntegerList with CheckboxSelectMultiple

2010-04-02 Thread ben
Sorry. I pasted code that I was experimenting with. I thought maybe the validation code was looking for strings because that is what the error code said it was looking for. Before that I had been using integers and that doesn't seem to work either. I am wondering if this is a bug in Django 1.2. I h

Re: How to use CommaSeperatedIntegerList with CheckboxSelectMultiple

2010-04-02 Thread orokusaki
The problem is that you're using '1' instead of 1. The comma separated integer list is expecting integers not strings. The reason you're seeing u'1' is because it's being turned from a string to a unicode object. Try this instead: SOME_CHOICES = ((1, 'ch1'),(2, 'ch2'), (3, 'ch3'),(4, 'ch4')) --

Re: How to use CommaSeperatedIntegerList with CheckboxSelectMultiple

2010-04-02 Thread ben
So what your saying is that I'm not using CommaSeperatedIntegerField for its intended purpose? I should think about writing a set of custom fields? I just assumed support for this type of thing was built in. I will keep hunting. On Apr 2, 1:50 pm, Bill Freeman wrote: > I once saw something for th

Re: How to use CommaSeperatedIntegerList with CheckboxSelectMultiple

2010-04-02 Thread Bill Freeman
I once saw something for this on djangosnippets. Search hard. On Fri, Apr 2, 2010 at 1:09 PM, ben wrote: > Hi, I am new to Django. I am currently using the latest Django 1.2 > from trunk. I am trying to store a list of values in a > CommaSeperatedIntegerList. I would like to use a > CheckboxSele

How to use CommaSeperatedIntegerList with CheckboxSelectMultiple

2010-04-02 Thread ben
Hi, I am new to Django. I am currently using the latest Django 1.2 from trunk. I am trying to store a list of values in a CommaSeperatedIntegerList. I would like to use a CheckboxSelectMultiple widget to render and select the values in the list. I have setup my code like so. SOME_CHOICES = (('1',