sprox-0.8 EditableForm __do_get_fields() and primary key

26 views
Skip to first unread message

ozwyzard

unread,
Oct 17, 2012, 4:40:05 AM10/17/12
to sp...@googlegroups.com

https://bitbucket.org/percious/sprox/src/eb8b084dfdfdb9c8ce078eb6e57ce19e88a8b7ba/sprox/formbase.py?at=default#cl-339

The above line seems to add the primary key to the list of fields in the editable form even when __limit_fields__ is specified and __limit_fields__ does not contain the primary key.

Q1) Is this because of special handling for the primary key further down in the base class?

Q2) Should users override the method (especially given that it starts with an underscore character)? 

Q3) Can someone point me to the order of precedence between __require_fields__, __limit_fields__,  __omit_fields__ ?

Thanks.


Alessandro Molina

unread,
Oct 17, 2012, 6:32:42 AM10/17/12
to sp...@googlegroups.com
That is done because without a primary key sprox won't be able to know
which entry should be edited, so EditableForm as is meant for editing
an already existing entry, doesn't allow you to remove primary keys.
You can only hide them using __hide_fields__ if you don't want them to
show up.

If you want to bypass that behaviour you can directly uses FormBase
instead of EditableForm.
> --
> You received this message because you are subscribed to the Google Groups
> "sprox" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/sprox/-/crE_8wiypScJ.
> To post to this group, send email to sp...@googlegroups.com.
> To unsubscribe from this group, send email to
> sprox+un...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/sprox?hl=en.

ozwyzard

unread,
Oct 17, 2012, 1:42:34 PM10/17/12
to sp...@googlegroups.com
Thank you!  __hide_fields__ did the job!!

Please excuse the questions... I asked because I was using sprox 6.10  (sprox-0.6.10-py2.5.egg) which did not add the key.   Apparently 6.10 hid it for release, but showed it on debug (I presume).

But thanks!  This works good as I try to move to TG2.2 with sprox 0.8.
Reply all
Reply to author
Forward
0 new messages