On 10/18/06, Lee McFadden <[EMAIL PROTECTED]> wrote:
>
> Just as an addendum...  Even if you do get `new_book = Book(**kw)` to
> work, it's a seriously bad idea.  The kw dict will also contain
> anything you put as query arguments to the URL so, to break your app,
> all anyone has to do is go to:
>
> http://example.com/addBook?extra=data
>
> It's best to explicitly initialise your SQLObject instances just so
> you don't get errors cropping up later on.

It will be like this:
def foo(self, **kw):
   bar = kw

   ## Check all keys of bar against schema
  ## and do various actions

   new_book = Book(**bar)

So, I will always be sure that what's passed to Book() will adhere to my schema.
I just don't want to handle the schema manually, as in going trough
every attribute
in the table. I'd rather just loop over the keys that is passed to the
function and check
them against my predefined schema.

regards

Tor

--~--~---------~--~----~------------~-------~--~----~
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