Hi,
I'm not sure if this problem is more a Sprox or a Turbogears specific
one. I already asked this question in the Sprox group, but didn't get
any respone.

I define my widgets in a declarative manner, as demonstrated in the
tgext.crud.controller doc on the turbogears page.
So like this:

class DeclarativeMovieController(CrudRestController):
    model = Movie
    class new_form_type(AddRecordForm):
        __model__ = Movie
        __omit_fields__ = ['genre_id', 'movie_id']
    class edit_form_type(EditableForm):
        __model__ = Movie
        __omit_fields__ = ['genre_id', 'movie_id']
    class edit_filler_type(EditFormFiller):
        __model__ = Movie
    class table_type(TableBase):
        __model__ = Movie
        __omit_fields__ = ['genre_id', 'movie_id']
    class table_filler_type(TableFiller):
        __model__ = Movie


Now, if I want to set a validator for my post method, it would
normally be done this way:

@validate(new_movie_form, error_handler=new)
@expose()
def post(self, **kw):
    # Code here


But when using the declerative way, I don't hab the new_movie_form
object, or do I?
Don't know what's the best way to go from here. Or would it be better
to use a non declarative style?

Thx
Kiview

-- 
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?hl=en.

Reply via email to