On Oct 8, 1:28 pm, Sujith <[email protected]> wrote:
> Hi Massimo,
>
> Thanks for the superfast response.
> The views and controllers seem to be working now. But i cannot see any
> data on the website.

can you explain which url shows the data and which one does not? This
is probably an application error.

> The appliance seems to be working fine and i can see the data when
> running under web2py.
>
> Thanks a lot. :)
> Sujith
>
> On Oct 8, 11:22 pm, mdipierro <[email protected]> wrote:
>
> > You should not have this line:
>
> >     from gluon.dal import *
>
> > that module is experimental and it is not the proper way of using it.
> > It does not support GAE at all.
>
> > If you remove that line everything else I see should work fine on GAE.
>
> > Massimo
>
> > On Oct 8, 1:20 pm, Sujith <[email protected]> wrote:
>
> > > Hi all,
>
> > > I am trying to make the "jobsite" appliance work on GAE. I edited  the
> > > model(db.py) of jobsite to suit GAE.
> > > I am getting the following error when running under devappserver of
> > > gae sdk.
> > > ***************************************
> > > WARNING  2010-10-08 18:10:40,069 datastore_file_stub.py:657] Could not
> > > read datastore data from /tmp/dev_appserver.datastore
> > > WARNING  2010-10-08 18:10:40,080 dev_appserver.py:3637] Could not
> > > initialize images API; you are likely missing the Python "PIL" module.
> > > ImportError: No module named _imaging
> > > INFO     2010-10-08 18:10:40,108 dev_appserver_main.py:431] Running
> > > application wcj on port 8080:http://localhost:8080
> > > WARNING  2010-10-08 18:12:29,440 portalocker.py:92] no file locking
> > > ERROR    2010-10-08 18:12:30,790 restricted.py:151] Traceback (most
> > > recent call last):
> > >   File "/home/sujith/Desktop/wcj/gluon/restricted.py", line 188, in
> > > restricted
> > >     exec ccode in environment
> > >   File "/home/sujith/Desktop/wcj/applications/init/models/db.py", line
> > > 7, in <module>
> > >     session.connect(request,response,db)
> > >   File "/home/sujith/Desktop/wcj/gluon/globals.py", line 298, in
> > > connect
> > >     migrate=table_migrate,
> > >   File "/home/sujith/Desktop/wcj/gluon/dal.py", line 2117, in
> > > define_table
> > >     t._create(migrate=migrate, fake_migrate=fake_migrate)
> > >   File "/home/sujith/Desktop/wcj/gluon/dal.py", line 2555, in _create
> > >     elif not field.type in self._db._adapter.types:
> > > AttributeError: 'BaseAdapter' object has no attribute 'types'
> > > *************************************
>
> > > This is the model
> > > *************************************
> > > import datetime
> > > now=datetime.datetime.today()
>
> > > if request.env.web2py_runtime_gae:
> > >     from gluon.dal import *
> > >     db = DAL('gae')
> > >     session.connect(request,response,db)
> > > else:
> > >     db = DAL('sqlite://storage.sqlite')
>
> > > db.define_table('user',
> > >                 Field('name'),
> > >                 Field('email'),
> > >                 Field('phone_country_code',default='1'),
> > >                 Field('phone'),
> > >                 Field('user_type'),
> > >                 Field('password','password'),
> > >                 Field('authorized',default='True'),
> > >                 Field('verification',default=''))
>
> > > db.user.name.requires=IS_NOT_EMPTY()
> > > db.user.user_type.requires=IS_IN_SET('Administrator','Applicant','Recruiter')
> > > db.user.email.requires=[IS_EMAIL(), IS_NOT_IN_DB(db,'user.email'),
> > > IS_NOT_EMPTY()]
>
> > > db.define_table('country',
> > >                 Field('country_code'),
> > >                 Field('country_name'))
>
> > > db.country.country_code.requires=IS_NOT_EMPTY()
> > > db.country.country_name.requires=IS_NOT_EMPTY()
>
> > > db.define_table('state',
> > >                 Field('country_code'),
> > >                 Field('state_code'),
> > >                 Field('state_name'))
>
> > > db.state.country_code.requires=IS_IN_DB(db,'country.country_code')
> > > db.state.state_code.requires=IS_NOT_EMPTY()
> > > db.state.state_name.requires=IS_NOT_EMPTY()
>
> > > db.define_table('company',
> > >                 Field('company_name'),
> > >                 Field('profile','text'),
> > >                 Field('address1'),
> > >                 Field('address2'),
> > >                 Field('city'),
> > >                 Field('state'),
> > >                 Field('zip'),
> > >                 Field('country'),
> > >                 Field('owner',db.user,default=session.user_id))
>
> > > db.company.company_name.requires=IS_NOT_EMPTY()
> > > db.company.profile.requires=IS_NOT_EMPTY()
> > > db.company.country.requires=IS_IN_DB(db,'country.country_name')
> > > db.company.owner.requires=IS_IN_DB(db,'user.id','%(name)s')
> > > db.company.state.requires=IS_IN_DB(db,'state.state_name')
> > > db.company.owner.requires=IS_NOT_EMPTY()
>
> > > db.define_table('categories',
> > >                 Field('cat_name'),
> > >                 Field('cat_descr','text'))
>
> > > db.categories.cat_name.requires=IS_NOT_EMPTY()
>
> > > db.define_table('positions',
> > >                 Field('company_name'),
> > >                 Field('title'),
> > >                 Field('category'),
> > >                 Field('description','text',default=''),
> > >                 Field('timestamp','datetime',default=now),
> > >                 Field('expires_on','datetime'),
> > >                 Field('access',default='Private'),
> > >                 Field('owner','integer',default=session.user_id))
>
> > > #db.positions.access.requires=IS_IN_SET('P','R','A')
> > > db.positions.company_name.requires=IS_IN_DB(db,'company.company_name')
> > > db.positions.category.requires=IS_IN_DB(db,'categories.cat_name')
> > > #db.positions.expires_on.requires=IS_NOT_EMPTY()
> > > db.company.owner.requires=IS_NOT_EMPTY()
>
> > > db.define_table('position_requirements',
> > >                 Field('position_id'),
> > >                 Field('requirement'))
>
> > > db.position_requirements.position_id.requires=IS_IN_DB(db,'positions.id','position.title')
>
> > > db.define_table('applicants',
> > >                 Field('user_id'),
> > >                 Field('applicant_name'),
> > >                 Field('address1'),
> > >                 Field('address2'),
> > >                 Field('city'),
> > >                 Field('state'),
> > >                 Field('zip'),
> > >                 Field('country'),
> > >                 Field('phone_country_code',default='1'),
> > >                 Field('phone'),
> > >                 Field('email'),
> > >                 Field('access',default='Public'),
> > >                 Field('updated','datetime',default=now))
>
> > > #db.applicants.access.requires=IS_IN_SET('P','R','A')
> > > db.applicants.applicant_name.requires=IS_NOT_EMPTY()
> > > db.applicants.email.requires=[IS_EMAIL(),IS_NOT_EMPTY()]
> > > db.applicants.country.requires=IS_IN_DB(db,'country.country_code','country.country_name')
> > > db.applicants.state.requires=IS_IN_DB(db,'state.state_code','state.state_name')
>
> > > db.define_table('applied_for',
> > >                 Field('position_id'),
> > >                 Field('applicant'),
> > >                 Field('applicant_name'),
> > >                 Field('applied','datetime',default=now))
>
> > > db.applied_for.position_id.requires=IS_IN_DB(db,'positions.id','positions.title')
> > > #db.applied_for.applicant.requires=IS_IN_DB(db,'applicants.id','applicants.id')
> > > #db.applied_for.applicant.requires=IS_IN_DB(db,'applicants.applicant_name','applicants.applicant_name')
>
> > > db.define_table('resumes',
> > >                 Field('user_id',db.user,default=session.user_id),
> > >                 Field('title'),
> > >                 Field('body','text'),
> > >                 Field('keywords','text'),
> > >                 Field('updated','datetime',default=now),
> > >                 Field('access',default='Public'))
>
> > > #db.resumes.access.requires=IS_IN_SET('P','R','A')
> > > db.resumes.user_id.requires=IS_NOT_EMPTY()
> > > ***************************************
>
> > > I am using python2.5 on Ubuntu 10.4 (lucid). I am a noob in python and
> > > also a newbie to web2py.
>
> > > Thanks for the help.
>
> > > Sujith
>
>

Reply via email to