2

Try to add pyramid_formalchemy to existing app as described in http://docs.formalchemy.org/pyramid_formalchemy/ the following way:

$ pcreate -s pyramid_fa myapp

In result inside package "myapp" directory with the same name is created, it contains three files: faforms.py, fainit.py, faroutes.py. Is it bug? When I try to create new project:

$ pcreate -s alchemy -s pyramid_fa myapp

these three files locates inside in mayapp package directly.

After adding settings to __init__.main() I try to open /admin page and get an error:

AttributeError: 'module' object has no attribute 'FieldSet'

I use 1.3 Pyramid version.

drnextgis
  • 2,194
  • 1
  • 25
  • 32

2 Answers2

0

The pyramid_formalchemy scaffold only contains those three files, and is meant to be used along another scaffold. Both fainit.py and faroutes.py contain a includeme method, which mean they can be imported through pyramid's configuration system by doing this during the app setup :

config.include('myapp.fainit')
config.include('myapp.faroutes')

As for the exception, I guess it is raised by something looking for faforms.FieldSet, but it's hard to say without the full traceback. I can't reproduce the error (/admin works for me). Can you retry and confirm whether it's still broken ? If so, please post the full traceback.

madjar
  • 12,691
  • 2
  • 44
  • 52
0

I had the same issue.

Create a file called forms.py in your application. Make sure it contains:

from formalchemy import FieldSet, Grid
Sheena
  • 15,590
  • 14
  • 75
  • 113