Added forms.alchemy
module and changed CRUD view to use it.
This commit is contained in:
parent
716f3cbd71
commit
73686b822f
3 changed files with 83 additions and 6 deletions
|
@ -26,15 +26,15 @@
|
|||
CRUD View
|
||||
"""
|
||||
|
||||
from .core import View
|
||||
from pyramid.httpexceptions import HTTPFound
|
||||
|
||||
import formalchemy
|
||||
|
||||
from edbob.pyramid.forms.formalchemy import AlchemyForm
|
||||
from .core import View
|
||||
from edbob.util import requires_impl, prettify
|
||||
from ..forms import AlchemyForm
|
||||
from formalchemy import FieldSet
|
||||
from ..db import Session
|
||||
|
||||
from edbob.util import requires_impl, prettify
|
||||
|
||||
|
||||
__all__ = ['CrudView']
|
||||
|
||||
|
@ -74,7 +74,7 @@ class CrudView(View):
|
|||
def make_fieldset(self, model, **kwargs):
|
||||
kwargs.setdefault('session', Session())
|
||||
kwargs.setdefault('request', self.request)
|
||||
fieldset = formalchemy.FieldSet(model, **kwargs)
|
||||
fieldset = FieldSet(model, **kwargs)
|
||||
fieldset.prettify = prettify
|
||||
return fieldset
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue