Hello all, I am following the pyramid_deform tutorial over here 
https://pyramid_deform.readthedocs.org/en/latest/. I am really battling out 
with the FormViews usage to the app's UI.
Can anybody on here give me a crash course on how to use  config.add_view() 
or an alternative to register my views so that my forms can be rendered?
I guess I am not very clear on how to register views with 
config.add_view(). Code sample from my views module is shown below:

 

> ......... 
>
> #@view_config(route_name='new_contact', 
>> renderer='shm_crm:templates/contacts/add.pt',)
>
> class ContactEditView(FormView, Layouts):
>
>     schema = ContactSchema()
>
>     buttons = ('Add Contact',)
>
>     form_options = (
>
>         ('formid', 'contact-add-form'),
>
>         ('method', 'POST')
>
>     )
>
>     
>
>     def save_success(self, appstruct):
>
>         context = self.request.context
>
>         context.title = appstruct['firstname']
>
>         
>
>     def appstruct(self):
>
>         pass
>
>  
>>
> def includeme(config):
>
>     config.add_view(
>
>         ContactEditView,
>
>         context=Contact,
>
>         name='new_contact',
>
>         permission='edit',
>
>         renderer='shm_crm:templates/contacts/add.pt',
>
>     )
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/pylons-discuss/-/7LwMon-8t2QJ.
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/pylons-discuss?hl=en.

Reply via email to