mirror of
https://github.com/not-kennethreitz/convore.json.git
synced 2026-06-05 23:20:19 +00:00
1 line
5.0 KiB
JSON
1 line
5.0 KiB
JSON
[{"user_id": 275, "stars": [], "topic_id": 42295, "date_created": 1311082162.433485, "message": "The SO post shows what I've tried so far, which continues to have validation issues. I think django is validating \"optiona,other\" against the value of the 'choices' argument to the field.", "group_id": 81, "id": 1670952}, {"user_id": 275, "stars": [], "topic_id": 42295, "date_created": 1311082055.959549, "message": "I need to implement a form widget that represents a CharField on a form as a set of checkboxes plus an \"other\" field. I've written up an SO post about it:", "group_id": 81, "id": 1670932}, {"user_id": 275, "stars": [], "topic_id": 42295, "date_created": 1311082058.5300701, "message": "http://stackoverflow.com/questions/6743022/implementing-a-multiple-checkbox-select-other-widget-in-django", "group_id": 81, "id": 1670934}, {"user_id": 275, "stars": [], "topic_id": 42295, "date_created": 1311082107.3081529, "message": "ideally I'd like to store the value in the db as a CharField, like \"option1,option3,other\". The \"other\" value will be a separate field.", "group_id": 81, "id": 1670944}, {"user_id": 4581, "stars": [], "topic_id": 42295, "date_created": 1311085978.2671299, "message": "and heres the SplitDateTimeWidget: http://goo.gl/0fs8U - it's a good example of how to create a widget that's got two input elements.", "group_id": 81, "id": 1671509}, {"user_id": 4581, "stars": [], "topic_id": 42295, "date_created": 1311084082.836622, "message": "Unless you change the validation logic (or dynamically change what's in your field's \"choices\"), you'll continue to get validation errors.", "group_id": 81, "id": 1671210}, {"user_id": 13325, "stars": [], "topic_id": 42295, "date_created": 1311084833.1811509, "message": "I posted an answer for you. Vote up or select if it helps. (I'm sooo close to being able to comment)", "group_id": 81, "id": 1671320}, {"user_id": 275, "stars": [], "topic_id": 42295, "date_created": 1311084990.5767851, "message": "@emperorcezar -- I think you've given me an idea... if it works out I'll accept your response. :-)", "group_id": 81, "id": 1671356}, {"user_id": 4581, "stars": [], "topic_id": 42295, "date_created": 1311084036.10426, "message": "Yep, that's exactly what's happening.", "group_id": 81, "id": 1671195}, {"user_id": 275, "stars": [], "topic_id": 42295, "date_created": 1311084994.1533599, "message": "thanks guys!", "group_id": 81, "id": 1671360}, {"user_id": 4581, "stars": [], "topic_id": 42295, "date_created": 1311084445.347868, "message": "Here's what I'd do: Create a subclass of forms.ChoiceField, and override it's clean method. You can then check to see if the \"other\" choice was selected, and then do whatever validation you want -- or none at all.", "group_id": 81, "id": 1671270}, {"user_id": 4581, "stars": [], "topic_id": 42295, "date_created": 1311085204.891207, "message": "rereading your SO post makes me realize my earlier comment doesn't make much sense! ;)", "group_id": 81, "id": 1671407}, {"user_id": 4581, "stars": [], "topic_id": 42295, "date_created": 1311085627.231447, "message": "@steveivy Yeah, I dont' really spend enough time customizing forms...", "group_id": 81, "id": 1671483}, {"user_id": 4581, "stars": [], "topic_id": 42295, "date_created": 1311085782.6857891, "message": "I see you're already overriding MultipleChoiceField... here's something you might consider: Since you've essentially got a Field with 2 widgets, you might consider doing something like the SplitDateTimeField: http://goo.gl/luhEt", "group_id": 81, "id": 1671492}, {"user_id": 275, "stars": [], "topic_id": 42295, "date_created": 1311085398.9703801, "message": "@bkmontgomery it's ok! this stuff is confusing sometimes.", "group_id": 81, "id": 1671442}, {"user_id": 4581, "stars": [], "topic_id": 42295, "date_created": 1311085827.9453039, "message": "you'd have your multi-select widget that validates as usually, and then you could add in another widget for your \"other\" input.", "group_id": 81, "id": 1671497}, {"user_id": 275, "stars": [], "topic_id": 42295, "date_created": 1311090396.7916479, "message": "ok, so @emperorcezar @bkmontgomery -- here's where I stand: I implemented clean(), validate(), and valid_value() on my field subclass, but something is still invalidating the input.", "group_id": 81, "id": 1672117}, {"user_id": 275, "stars": [], "topic_id": 42295, "date_created": 1311090403.1772161, "message": "https://gist.github.com/3327b22ecdc0f8abca8f", "group_id": 81, "id": 1672119}, {"user_id": 275, "stars": [], "topic_id": 42295, "date_created": 1311090450.6028261, "message": "how do I shortcut any other validations on that field?", "group_id": 81, "id": 1672129}, {"user_id": 275, "stars": [], "topic_id": 42295, "date_created": 1311103152.755451, "message": "OK: turns out the model was validating agains the choices= list on the field def. Removing the choices arg to the model field definition fixed it.", "group_id": 81, "id": 1674589}, {"user_id": 1822, "stars": [], "topic_id": 42295, "date_created": 1311357725.574995, "message": "did you post your working code somewhere?", "group_id": 81, "id": 1700402}] |