mirror of
https://github.com/not-kennethreitz/convore.json.git
synced 2026-06-21 07:31:00 +00:00
1 line
2.0 KiB
JSON
1 line
2.0 KiB
JSON
[{"user_id": 11547, "stars": [], "topic_id": 7457, "date_created": 1298109252.5902121, "message": "I was wondering what people's opinions are on composing forms that share multiple sub-sections. Currently we use inheritance with each set of shared fields working either as a separate form or as part of the inheriting form. Unfortunately this can lead to a class that does nothing but inherit from five other classes and this seems ugly. Is there a better way to share definitions?", "group_id": 81, "id": 149137}, {"user_id": 214, "stars": [], "topic_id": 7457, "date_created": 1298125830.2736199, "message": "This sounds pretty reasonable. That kind of inheritance pattern is common when using mixins heavily - the new class based views in 1.3 are like that too.", "group_id": 81, "id": 149457}, {"user_id": 214, "stars": [], "topic_id": 7457, "date_created": 1298125953.565908, "message": "However: keep in mind there is no requirement that a single HTML form must map to a single Django form object. So you could just use separate form objects for each subsection.", "group_id": 81, "id": 149466}, {"user_id": 10519, "stars": [{"date_created": 1298138576.928813, "user_id": 2087}, {"date_created": 1298150743.1461589, "user_id": 11547}], "topic_id": 7457, "date_created": 1298131286.0113449, "message": "We use something similar to Alex Gaynor's multipleform_factory. He discussed his method some in these slides: http://www.slideshare.net/kingkilr/forms-getting-your-moneys-worth.", "group_id": 81, "id": 149709}, {"user_id": 10519, "stars": [], "topic_id": 7457, "date_created": 1298131313.0892601, "message": "It's useful when you want a form composed of multiple forms to behave as a single form.", "group_id": 81, "id": 149713}, {"user_id": 11547, "stars": [], "topic_id": 7457, "date_created": 1298146148.139245, "message": "Thanks for the input, the metaprogramming method was what I was looking for but I had overlooked the ability to generate many forms from the same request data. That would definitely simplify some use cases.", "group_id": 81, "id": 150429}] |