mirror of
https://github.com/not-kennethreitz/convore.json.git
synced 2026-06-21 15:40:58 +00:00
1 line
8.6 KiB
JSON
1 line
8.6 KiB
JSON
[{"user_id": 1422, "stars": [], "topic_id": 13266, "date_created": 1300232601.0108421, "message": "I have a model that has a foreign key to another *template* model. When a user selects that foreign key from a drop down, I want to populate some extra fields on the model based on values from the foreign key.", "group_id": 81, "id": 361098}, {"user_id": 1422, "stars": [], "topic_id": 13266, "date_created": 1300232626.832525, "message": "Is this something that django can handle on its own? or am I going to have to override the template with some custom javascript?", "group_id": 81, "id": 361102}, {"user_id": 928, "stars": [], "topic_id": 13266, "date_created": 1300252963.0401239, "message": "do you mean django admin can handle by default? i believe with an inline model and defaults it could probably work", "group_id": 81, "id": 362928}, {"user_id": 1422, "stars": [], "topic_id": 13266, "date_created": 1300253686.9967401, "message": "I'm not sure an inline model will work the way I want it to.", "group_id": 81, "id": 363007}, {"user_id": 1422, "stars": [], "topic_id": 13266, "date_created": 1300253713.081537, "message": "I described the problem a little better here -> http://stackoverflow.com/questions/5321186/populating-values-in-django-admin-based-on-a-foreign-key-selection", "group_id": 81, "id": 363015}, {"user_id": 928, "stars": [], "topic_id": 13266, "date_created": 1300254442.411906, "message": "gotcha", "group_id": 81, "id": 363130}, {"user_id": 1422, "stars": [], "topic_id": 13266, "date_created": 1300253740.3947179, "message": "basically I want to copy over values from a template to another model, but actually have them on the new model", "group_id": 81, "id": 363018}, {"user_id": 1422, "stars": [], "topic_id": 13266, "date_created": 1300253759.389571, "message": "copy the template into the actual model so they can be modified without modifying the template", "group_id": 81, "id": 363019}, {"user_id": 1422, "stars": [], "topic_id": 13266, "date_created": 1300254852.0467391, "message": "not exactly...you confirmed my suspicions :)", "group_id": 81, "id": 363177}, {"user_id": 1422, "stars": [], "topic_id": 13266, "date_created": 1300254301.3669829, "message": "without affecting other Plans that use the template", "group_id": 81, "id": 363107}, {"user_id": 928, "stars": [], "topic_id": 13266, "date_created": 1300254327.4471049, "message": "so to not answer your question, why not just have throttle/rate limit on plantemplates only", "group_id": 81, "id": 363114}, {"user_id": 928, "stars": [], "topic_id": 13266, "date_created": 1300254476.046258, "message": "heres my non-answer advice then", "group_id": 81, "id": 363133}, {"user_id": 1422, "stars": [], "topic_id": 13266, "date_created": 1300254263.678807, "message": "the PlanTemplate is there because 90% of Plans will just use the PlanTemplate", "group_id": 81, "id": 363099}, {"user_id": 1422, "stars": [], "topic_id": 13266, "date_created": 1300254277.403327, "message": "but 10% of Plans will need custom throttle/rate_limits", "group_id": 81, "id": 363102}, {"user_id": 1422, "stars": [], "topic_id": 13266, "date_created": 1300254412.311883, "message": "i have a small subset of templates...like 5-10 that won't need to change very often, if ever", "group_id": 81, "id": 363124}, {"user_id": 1422, "stars": [], "topic_id": 13266, "date_created": 1300254430.2547281, "message": "but custom plans may pop up here and there, and I don't want templates for custom plans", "group_id": 81, "id": 363128}, {"user_id": 928, "stars": [], "topic_id": 13266, "date_created": 1300254578.286483, "message": "it might keep things simpler to manage?", "group_id": 81, "id": 363148}, {"user_id": 928, "stars": [], "topic_id": 13266, "date_created": 1300255133.717222, "message": "will the admin actions work for you? have the plan with a type, and control it similarly to their 'published' example", "group_id": 81, "id": 363186}, {"user_id": 928, "stars": [], "topic_id": 13266, "date_created": 1300254248.3222699, "message": "or that plans throttle/etc act as a default for for all associated plantemplates", "group_id": 81, "id": 363093}, {"user_id": 928, "stars": [], "topic_id": 13266, "date_created": 1300254357.6185901, "message": "you want them to all have the same non-standard default?", "group_id": 81, "id": 363117}, {"user_id": 1422, "stars": [], "topic_id": 13266, "date_created": 1300254376.5165789, "message": "because if I want to change one plan, I'd either have to create a new template or change everyone's", "group_id": 81, "id": 363121}, {"user_id": 928, "stars": [], "topic_id": 13266, "date_created": 1300254493.772985, "message": "have plans have a boolean called template", "group_id": 81, "id": 363137}, {"user_id": 928, "stars": [], "topic_id": 13266, "date_created": 1300254609.871073, "message": "as per your original question, I think it would require custom work to do what you want to accomplish...djangos admin doesnt really support your use case directly", "group_id": 81, "id": 363152}, {"user_id": 928, "stars": [], "topic_id": 13266, "date_created": 1300254702.273653, "message": "but again, the admin wont handle it exactly as you want", "group_id": 81, "id": 363166}, {"user_id": 928, "stars": [], "topic_id": 13266, "date_created": 1300254172.4822891, "message": "why do you have those values in both models?", "group_id": 81, "id": 363082}, {"user_id": 928, "stars": [], "topic_id": 13266, "date_created": 1300254179.8631561, "message": "or is it just a quick example", "group_id": 81, "id": 363084}, {"user_id": 1422, "stars": [], "topic_id": 13266, "date_created": 1300254289.9589009, "message": "so they get copied over so they can be changed easily", "group_id": 81, "id": 363103}, {"user_id": 928, "stars": [], "topic_id": 13266, "date_created": 1300254508.302768, "message": "and only have one plan model", "group_id": 81, "id": 363139}, {"user_id": 928, "stars": [], "topic_id": 13266, "date_created": 1300254551.1974261, "message": "and then have a custom manager to filter out templates, or have templates be just Plan.objects.filter(template=True)", "group_id": 81, "id": 363143}, {"user_id": 1422, "stars": [], "topic_id": 13266, "date_created": 1300254597.949928, "message": "if the models were as simple as the SO question suggests (basically 1 to 1), that would be fine", "group_id": 81, "id": 363149}, {"user_id": 1422, "stars": [], "topic_id": 13266, "date_created": 1300254606.146167, "message": "and something I considered", "group_id": 81, "id": 363151}, {"user_id": 1422, "stars": [], "topic_id": 13266, "date_created": 1300254632.6083109, "message": "that's the conclusion I've been coming to", "group_id": 81, "id": 363158}, {"user_id": 928, "stars": [], "topic_id": 13266, "date_created": 1300254654.9230471, "message": "yep, essentially you want 2 models to act as one", "group_id": 81, "id": 363159}, {"user_id": 928, "stars": [], "topic_id": 13266, "date_created": 1300254664.211513, "message": "so id move it to one model and move the complexity to the manager", "group_id": 81, "id": 363160}, {"user_id": 1422, "stars": [], "topic_id": 13266, "date_created": 1300254735.6124029, "message": "correct, there will still have to be a small amount of custom admin work", "group_id": 81, "id": 363171}, {"user_id": 928, "stars": [], "topic_id": 13266, "date_created": 1300254819.223078, "message": "so I was of no help :)", "group_id": 81, "id": 363175}, {"user_id": 928, "stars": [], "topic_id": 13266, "date_created": 1300254870.3740759, "message": "excellent then", "group_id": 81, "id": 363179}, {"user_id": 928, "stars": [], "topic_id": 13266, "date_created": 1300255137.1021171, "message": "http://docs.djangoproject.com/en/1.2/ref/contrib/admin/actions/", "group_id": 81, "id": 363187}, {"user_id": 1422, "stars": [], "topic_id": 13266, "date_created": 1300255211.6594479, "message": "I'd like for this to be as the person is on the add/edit page, so probably not", "group_id": 81, "id": 363190}, {"user_id": 1422, "stars": [], "topic_id": 13266, "date_created": 1300306707.350502, "message": "For anyone who cares, I overrode the change_form.html template and added in some javascript that would send an ajax call with the template id that was selected and grab the info it needed", "group_id": 81, "id": 369240}, {"user_id": 1422, "stars": [], "topic_id": 13266, "date_created": 1300306725.256598, "message": "works like a charm", "group_id": 81, "id": 369241}, {"user_id": 18281, "stars": [], "topic_id": 13266, "date_created": 1300430923.107646, "message": "Can't understand why you didn't just hide the attributes to be inherited from the new object form then override the save methodcand grab the values from the self.fk.attribute. Pretty sure this would work.", "group_id": 81, "id": 380269}] |