Kevin Dangoor, el viernes 23 de diciembre a las 11:01 me escribiste:
> > What about moving (or at least giving the option) form_order to
> > sqlwidgets(sqlclass, form_order=None), so you can avoid mixing up the
> > model and controller. You can add the extra parameter to DataController
> > too. I know sometimes (when you use the form in several places) it could
> > be much more comfortable to specify it directly in the model, but when you
> > just add a DataController, you can perfectly put the form_order there
> > (once).
> 
> Looks like a good suggestion! Can you open a ticket on this idea?

Ok, now that I'm with a little more time I'll try to add a ticket with
batteries included (aka patch included =).

> > And maybe it could be even better to have an option to set the order
> > directly in the template (because after all this is a view issue). I don't
> > really know how to implement it, but I think the form.insert() would be
> > the perfect place (like ${form.insert(widget_order=('pageName', 'data'))}).
> >
> > This could be used too to use declarative forms, this way you don't care
> > about the widget ordering in a form and you can do something like:
> >
> > class MyForm(TableForm):
> >         pageName = TextField()
> >         data = TextField()
> >
> > MyForm.__dict__ would still be unordered but that's fine, because you just
> > type form.insert(widget_order=('pageName', 'data')) in the template and
> > get it ordered.
> >
> > And this way you get the view, model and controller well separated (I
> > don't really care how the widgets are orderen in the form, that's the user
> > interface designer problem ;)
> 
> This seems too painful, because you may end up repeating that
> information on multiple templates.

About this, this is just an option, which makes much more clear the
separation between view, controller and model and can be used in a very
wide use cases. If you use the same form in 2 separated templates, you are
probably repeating information allready, so the ordering stuff is not you
bigger problem anyway.

I've already done a really small patch that implement the ordering stuff
in TableForm (it's my first contribution for TG, so I don't know if this
is the right way to do it). I think it could be very usefull to have the
option of reordering the widgets in the view, no matter if you reuse the
forms or not (it's good to have the posibility to change the way things
are presented in the view, it gives the UI designer more flexibility). So
I will open a ticket with this patch and continue the discussion about the
reuse thing latter because I have some ideas I'd like to clear in my mind
(maybe implementing them would help ;) before I talk about them here.

-- 
Leandro Lucarella (luca) | Blog colectivo: http://www.mazziblog.com.ar/blog/
 .------------------------------------------------------------------------,
  \  GPG: 5F5A8D05 // F8CD F9A7 BF00 5431 4145  104C 949E BFB6 5F5A 8D05 /
   '--------------------------------------------------------------------'
Just because you're paranoid, don't mean they're not after you.

Reply via email to