TurboGears is such a great tool to burst productivity.
While I digging more tg capabilities, I think there's still some room
that we can improve it. At fisrt, let me show some basic use of
identity and validate:

identity (to certify user/passwd in admin group):
@identity.require(identity.in_group("admin"))

validate (check valid name and number field):
@validate(validator={"number": validator.Int(), "name":
validator.String()})


To read carefully, the decorators are self-explained,
but I think it doesn't that readable and makes me type too much to do
the basic work.

1. "idenntity.require" broke the consistency usage of decorators, such
as @expose, @validate (no subfix)

2. idenntity.require and identity.in_group owned total different dutys

3. "validate" and "validator" looked too similar and was easy to be
confused.


Here is My thought of those questions:

identity:
We may omit the "require" and do what we intended to do :
@identity.in_group("admin")
(con: performance)

or Maybe we can seperate their namespace :
@identity(auth.in_group("admin"))
(con: leads to import scary size of libs)

validate:
People had some discussion about renaming the namespace
@validate(schema={"number": schema.Int(), "name": schema.String()})


BTW:

Some coin about @error_handler and @exception_handler,

I think one of TurboGears advantage is hide the lower infrastructure
from developers,
but @xxx_handler let me feel "low" and changed my mind flow.

4. @error and @exception make sense for me and fit the decorators
naming consistency.


--
Fred


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TurboGears" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/turbogears
-~----------~----~----~----~------~----~------~--~---

Reply via email to