http://codereview.appspot.com/6303091/diff/1/MoinMoin/apps/frontend/views.py File MoinMoin/apps/frontend/views.py (right): http://codereview.appspot.com/6303091/diff/1/MoinMoin/apps/frontend/views.py#newcode469 MoinMoin/apps/frontend/views.py:469: comment = OptionalText.using(label=L_('Comment')).with_properties(placeholder=L_("Comment about your change")) if it is ...
12 years, 10 months ago
(2012-06-16 11:54:30 UTC)
#2
http://codereview.appspot.com/6303091/diff/1/MoinMoin/apps/frontend/views.py File MoinMoin/apps/frontend/views.py (right): http://codereview.appspot.com/6303091/diff/1/MoinMoin/apps/frontend/views.py#newcode53 MoinMoin/apps/frontend/views.py:53: from MoinMoin.apps.frontend.forms import Text, OptionalText, Submit I left out ...
12 years, 10 months ago
(2012-06-16 12:11:40 UTC)
#3
some comments http://codereview.appspot.com/6303091/diff/4007/MoinMoin/apps/frontend/forms.py File MoinMoin/apps/frontend/forms.py (right): http://codereview.appspot.com/6303091/diff/4007/MoinMoin/apps/frontend/forms.py#newcode17 MoinMoin/apps/frontend/forms.py:17: "Enter a short comment about your change!" ...
12 years, 10 months ago
(2012-06-17 08:02:35 UTC)
#5
http://codereview.appspot.com/6303091/diff/4007/MoinMoin/apps/frontend/forms.py File MoinMoin/apps/frontend/forms.py (right): http://codereview.appspot.com/6303091/diff/4007/MoinMoin/apps/frontend/forms.py#newcode7 MoinMoin/apps/frontend/forms.py:7: General Flatland forms containing hints for the templates. is ...
12 years, 10 months ago
(2012-06-17 12:47:45 UTC)
#6
http://codereview.appspot.com/6303091/diff/4007/MoinMoin/apps/frontend/forms.py
File MoinMoin/apps/frontend/forms.py (right):
http://codereview.appspot.com/6303091/diff/4007/MoinMoin/apps/frontend/forms....
MoinMoin/apps/frontend/forms.py:7: General Flatland forms containing hints for
the templates.
is it about widgets or about forms? you seem to disagree with yourself about
this. :)
http://codereview.appspot.com/6303091/diff/4007/MoinMoin/apps/frontend/forms....
MoinMoin/apps/frontend/forms.py:17:
On 2012/06/17 08:02:35, Reimar Bauer wrote:
> "Enter a short comment about your change!"
>
> whenever possible use punctuation
>
> ! if required or . if not
as this is a form label, neither . nor ! are appropriate.
either nothing or : (IMHO).
http://codereview.appspot.com/6303091/diff/4007/MoinMoin/forms.py
File MoinMoin/forms.py (right):
http://codereview.appspot.com/6303091/diff/4007/MoinMoin/forms.py#newcode30
MoinMoin/forms.py:30: Email =
String.using(label=L_('E-Mail')).with_properties(widget=WIDGET_EMAIL,
placeholder=L_("Your E-Mail address")).validated_by(IsEmail())
i guess we have to think about the defaults we want to set in this module. in
case of Email, you set "Your ..." as default label, but this can easily go wrong
if someone is using Email and not asking for "Your" email address, but e.g. for
a target email address. So I suggest to either not set default labels in this
module at all or at least make them more generic. If they are just made more
generic, there is some risk that they are just used "as is" and that the meaning
is unclear to the user then, so maybe having no default at all is the best
option.
http://codereview.appspot.com/6303091/diff/4007/MoinMoin/apps/frontend/forms.py File MoinMoin/apps/frontend/forms.py (right): http://codereview.appspot.com/6303091/diff/4007/MoinMoin/apps/frontend/forms.py#newcode7 MoinMoin/apps/frontend/forms.py:7: General Flatland forms containing hints for the templates. On ...
12 years, 10 months ago
(2012-06-18 02:49:51 UTC)
#7
please also try all the stuff you changed. run py.test. http://codereview.appspot.com/6303091/diff/4007/MoinMoin/apps/frontend/forms.py File MoinMoin/apps/frontend/forms.py (right): http://codereview.appspot.com/6303091/diff/4007/MoinMoin/apps/frontend/forms.py#newcode17 ...
12 years, 10 months ago
(2012-06-18 08:07:02 UTC)
#8
http://codereview.appspot.com/6303091/diff/4007/MoinMoin/apps/frontend/forms.py File MoinMoin/apps/frontend/forms.py (right): http://codereview.appspot.com/6303091/diff/4007/MoinMoin/apps/frontend/forms.py#newcode17 MoinMoin/apps/frontend/forms.py:17: On 2012/06/18 08:07:02, ThomasJWaldmann wrote: > As this is ...
12 years, 10 months ago
(2012-06-18 13:52:42 UTC)
#10
Patch set 6 just uploaded. Please review! :) This is what I've made so far ...
12 years, 10 months ago
(2012-06-19 11:40:54 UTC)
#11
Patch set 6 just uploaded. Please review! :)
This is what I've made so far - Apart from some minor cleanups, I introduced
MultiColumnForm and TabbedForm widgets (Flatland form classes and corresponding
Jinja2 macros), which will be also useful for the metadata editor. The Jinja2
macros primarily come from a refactor of usersettings.html and
usersettings_form.html, which are now almost factored out totally by the more
general macros.
The code still needs some polishing - it's not complete, may contain silly bugs,
and I haven't run an automated test yet, since I'm still actively changing the
implementation. I will work out a more tidy and tested version and uploading in
a day or two.
Thanks!
http://codereview.appspot.com/6303091/diff/6007/MoinMoin/apps/frontend/views.py File MoinMoin/apps/frontend/views.py (right): http://codereview.appspot.com/6303091/diff/6007/MoinMoin/apps/frontend/views.py#newcode1452 MoinMoin/apps/frontend/views.py:1452: if form['name_'].value != flaskg.user.name and user.search_users(name_exact=form['name_'].value): On 2012/06/19 13:22:15, ...
12 years, 10 months ago
(2012-06-19 14:25:50 UTC)
#13
http://codereview.appspot.com/6303091/diff/6007/MoinMoin/apps/frontend/views.py
File MoinMoin/apps/frontend/views.py (right):
http://codereview.appspot.com/6303091/diff/6007/MoinMoin/apps/frontend/views....
MoinMoin/apps/frontend/views.py:1452: if form['name_'].value != flaskg.user.name
and user.search_users(name_exact=form['name_'].value):
On 2012/06/19 13:22:15, ThomasJWaldmann wrote:
> maybe you could check whether Form.name is used at all.
> it is defined everywhere, but I do not remember where (or whether) it is USED.
Flatland Form definitions call .named which in turn sets the name attribute, so
it should always be avoided.
http://codereview.appspot.com/6303091/diff/6007/MoinMoin/forms.py
File MoinMoin/forms.py (right):
http://codereview.appspot.com/6303091/diff/6007/MoinMoin/forms.py#newcode54
MoinMoin/forms.py:54: # XXX needs some thinking about this widget
On 2012/06/19 13:22:15, ThomasJWaldmann wrote:
> such comments are pretty useless if you do not write WHAT PRECISELY to think
> about
Going to fix it. BTW it was just a note to remind myself :)
http://codereview.appspot.com/6303091/diff/6007/MoinMoin/forms.py#newcode76
MoinMoin/forms.py:76: if type(members.get('layout', None)) == str:
On 2012/06/19 13:22:15, ThomasJWaldmann wrote:
> isinstance(..., str)
>
> really str? unicode? basestring?
>
> None is the default default for .get().
ah, going to fix it.
http://codereview.appspot.com/6303091/diff/6007/MoinMoin/forms.py#newcode143
MoinMoin/forms.py:143: layout = []
On 2012/06/19 13:22:15, ThomasJWaldmann wrote:
> it looks a bit like you are beginning to mix up template stuff (layout) and
> python stuff (data model).
>
IMHO python stuff is not necessarily data model. Flatland forms are closer to
view than data model. Forms like DeleteItemForm, PasswordLostForm don't really
reflect the data model; the UserSettings*Form's do correspond to the underlying
User object, but they add categorization (separation of the 6 tabs) and hints
information (labels) that's useful in the view but not in the model.
> not sure if that is a good idea.
2 comments, one on cs6 and one on cs7 http://codereview.appspot.com/6303091/diff/6007/MoinMoin/forms.py File MoinMoin/forms.py (right): http://codereview.appspot.com/6303091/diff/6007/MoinMoin/forms.py#newcode143 MoinMoin/forms.py:143: ...
12 years, 9 months ago
(2012-06-21 12:00:19 UTC)
#14
On 2012/06/23 16:49:18, jek wrote: > This looks great! > There seems to be not ...
12 years, 9 months ago
(2012-06-25 05:30:27 UTC)
#16
On 2012/06/23 16:49:18, jek wrote:
> This looks great!
>
There seems to be not much doubt about the ordinary widgets, but as for form
widgets, Thomas expressed the concern that mixing structure and presentation may
not be good. What's your idea about this?
Thanks!
> http://codereview.appspot.com/6303091/diff/1021/MoinMoin/forms.py
> File MoinMoin/forms.py (right):
>
> http://codereview.appspot.com/6303091/diff/1021/MoinMoin/forms.py#newcode68
> MoinMoin/forms.py:68: Hidden = String.with_properties(widget=WIDGET_HIDDEN,
> optional=True)
> Should this be .using(optional=True) rather than set in properties?
http://codereview.appspot.com/6303091/diff/31001/MoinMoin/apps/frontend/forms.py File MoinMoin/apps/frontend/forms.py (right): http://codereview.appspot.com/6303091/diff/31001/MoinMoin/apps/frontend/forms.py#newcode15 MoinMoin/apps/frontend/forms.py:15: if this stuff is just used at one place, ...
12 years, 9 months ago
(2012-07-01 06:30:06 UTC)
#18
http://codereview.appspot.com/6303091/diff/40005/MoinMoin/templates/lookup.html File MoinMoin/templates/lookup.html (right): http://codereview.appspot.com/6303091/diff/40005/MoinMoin/templates/lookup.html#newcode10 MoinMoin/templates/lookup.html:10: {{ forms.render(lookup_form['name']) }} Why no loop over a list ...
12 years, 9 months ago
(2012-07-02 08:09:10 UTC)
#20
On 2012/07/03 16:11:52, ThomasJWaldmann wrote: > looks ok to me now. > > please do ...
12 years, 9 months ago
(2012-07-04 03:46:44 UTC)
#22
On 2012/07/03 16:11:52, ThomasJWaldmann wrote:
> looks ok to me now.
>
> please do a "make test" and if ok, do some clean changeset(s).
have run "make test". no regression except for a couple of PEP8 issues which i'm
fixing and will send in.
personally i found the current patch set already clean enough, it does just one
thing (convert form to use widgets, not 100% complete though). where is cleanup
still needed? - perhaps move BaseChangeForm from apps/frontend/forms.py into
items/__init__.py?
"do some clean changesets" was not intended to say that the current stuff is unclean, ...
12 years, 9 months ago
(2012-07-05 12:22:15 UTC)
#23
"do some clean changesets" was not intended to say that the current stuff is
unclean, was just intended to make you think about it.
so commit when you are ready with it.
Issue 6303091: Convert usage of Flatland forms
(Closed)
Created 12 years, 10 months ago by xiaq
Modified 12 years, 8 months ago
Reviewers: thomas.j.waldmann_googlemail.com, Reimar Bauer, jek
Base URL:
Comments: 60