Re: Form to create several objects with one-to-one relation

2015-04-23 Thread Ilya Kazakevich
Well, I found solution. ``CreateWithInlinesView `` works perfectly with ``OneToOneField`` (after all, 1-to-1 is just a foreign key with constraint), but my main model here is ``Comment``, not ``Task``. So I should set ``Comment`` as ``model`` field in this view and ``Task`` as ``inline``. It lo

Re: Form to create several objects with one-to-one relation

2015-04-22 Thread Ilya Kazakevich
Thank you, that may work, but I feel that I reinventing wheel here. Actually, there are inline_formset and CreateWithInlinesView (from django extras) and they do exactly what I want, but they only support ForeignKey, not OneToOne. Looks like I need to extend them to support OneToOne. On Wedn

Re: Form to create several objects with one-to-one relation

2015-04-21 Thread Vijay Khemlani
What about and old-school DetailView? def get_context_data -> Creates the two forms and puts them in the context def post -> Validates and process the forms On Tue, Apr 21, 2015 at 7:41 PM, Ilya Kazakevich wrote: > Hello, > > I have several models with one-to-one relation. For example > > cl