resbaz / workshop_data_management

Web-based database application for internal management of workshop data
1 stars 0 forks source link

MultiSelectField #1

Closed DamienIrving closed 9 years ago

DamienIrving commented 9 years ago

I've installed MultiSelectField (pip install django-multiselectfield) and used it for participant dietary requirement choices and person teaching team choices. There are bugs with the implementation of both:

lachlansimpson commented 9 years ago

Hmmm. Interesting. I was just thinking about this problem in the shower. Send me the code and the error for starters.

But I think, and this is going to sound hokey, that your best best is a list of booleans on the object: the multi select part is merely UI/UX. Storage is essentially y/n 1/0.

Does that seem reasonable? An m2m is overkill for dietary, since we need no extra info on its data.

Give me a teaching team eg?

Cheers L. On Apr 4, 2015 08:43, "Damien Irving" notifications@github.com wrote:

I've installed MultiSelectField (pip install django-multiselectfield) and used it for participant dietary requirement choices and person teaching team choices. There are bugs with the implementation of both:

  • teaching team: I'm able to successfully create and save a participant with more than one teaching team but if I try and filter by teaching team (in admin.py) it throws an error
  • dietary requirement: I'm unable to successfully create and save a participant with more than one dietary requirement

— Reply to this email directly or view it on GitHub https://github.com/resbaz/workshop_data_management/issues/1.

lachlansimpson commented 9 years ago

The other option, of course, is to use something like django taggit to tag people w their dietary needs. Again, in the UI they only see a reduced set of selections, and we do the work in the object creation to translate their choice from a radio button to a tag... On Apr 4, 2015 08:48, "Lachlan Musicman" datakid@gmail.com wrote:

Sorry, am at cafe atm. Yesterday got derailed by my lover, hence the radio silence. On Apr 4, 2015 08:47, "Lachlan Musicman" datakid@gmail.com wrote:

Hmmm. Interesting. I was just thinking about this problem in the shower. Send me the code and the error for starters.

But I think, and this is going to sound hokey, that your best best is a list of booleans on the object: the multi select part is merely UI/UX. Storage is essentially y/n 1/0.

Does that seem reasonable? An m2m is overkill for dietary, since we need no extra info on its data.

Give me a teaching team eg?

Cheers L. On Apr 4, 2015 08:43, "Damien Irving" notifications@github.com wrote:

I've installed MultiSelectField (pip install django-multiselectfield) and used it for participant dietary requirement choices and person teaching team choices. There are bugs with the implementation of both:

  • teaching team: I'm able to successfully create and save a participant with more than one teaching team but if I try and filter by teaching team (in admin.py) it throws an error
  • dietary requirement: I'm unable to successfully create and save a participant with more than one dietary requirement

— Reply to this email directly or view it on GitHub https://github.com/resbaz/workshop_data_management/issues/1.

DamienIrving commented 9 years ago

@datakid No need to apologise - it is the weekend after all! I'm just documenting the bugs in issues like this so I don't forget them.

If you clone the latest version of the master branch, pip install django-multiselectfield and then try and add a new participant with multiple dietary requirements you'll be able to re-create the error. If you crack that error, next try and define a dietary requirement filter in admin.py- that will re-create the other error.

DamienIrving commented 9 years ago

Ah, yes - I'm also very open to other options like taggit as opposed to MultiSelectField (in my naive google searching MultiSelectField come up a lot, but I was hoping you might know of a better way!)

lachlansimpson commented 9 years ago

I think the best solution is a group of booleans on the object, for a fairly static group. For a non static group, the taggit solution is probably best since it doesn't require a db migration. On Apr 4, 2015 09:03, "Damien Irving" notifications@github.com wrote:

Ah, yes - I'm also very open to other options like taggit as opposed to MultiSelectField (in my naive google searching MultiSelectField come up a lot, but I was hoping you might know of a better way!)

— Reply to this email directly or view it on GitHub https://github.com/resbaz/workshop_data_management/issues/1#issuecomment-89433886 .

DamienIrving commented 9 years ago

We went with the booleans approach.