In models/db.py

    SQLField( 'meta_description','text'),

In controllers/default.py
        form=SQLFORM(db.domain,_method='POST')
        form.vars=request.vars
        db.domain.insert(**dict (form.vars))

curl -F 'name=flapdoodle.com' -F meta_descripti...@layout.html
http://127.0.0.1:8002/init/default/add_domain

I get domain.name=flapdoodle.com just fine.   But for the description,
it starts out like this:

FieldStorage('meta_description', 'layout.html', '<!DOCTYPE html PUBLIC
"-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/
xhtml1-strict.dtd">\n<html xmlns="http://www.w3.org/1999/xhtml";
...
rest of layout.html

Is there a way to get the FieldStorage out of there?  I only find one
reference, on page 180 of the manual.

PS: I have to say that the (**dict (form.vars)) is pretty freaking
cool.   It lets me set up reasonable defaults in models, then use
those if information is not supplied.   So I can have the value for
"public" set to default to true, for example.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to