thanks but i get a now an error:
Traceback (most recent call last):
  File "gluon/restricted.py", line 98, in restricted
  File "/Applications/web2py1.62/web2py.app/Contents/Resources/
applications/2busy/models/db.py", line 104, in <module>
AttributeError: 'NoneType' object has no attribute 'id'

#########################################################################
## Tabelle File
#########################################################################
db.define_table('projectfile',
                SQLField('userid', default=auth.user.id if auth.user
else 0, writable=False, readable=False),
                SQLField('procreator', default=auth.user.last_name if
auth.user else 0, writable=False, readable=False),
                SQLField('projectname'),
                SQLField('filename'),
                SQLField('format'),
                SQLField('cdate', 'date', default=now),
                SQLField('datei','upload'),
                SQLField('description','text'))

db.projectfile.projectname.requires=IS_IN_DB(db
(db.project.userid==auth.user.id),'project.pname','%(pname)s')
db.projectfile.procreator.requires=IS_IN_DB(db,'auth_user.last_name')
db.projectfile.userid.requires=IS_IN_DB(db,'auth_user.id')
db.projectfile.filename.requires=[IS_NOT_EMPTY()]
db.projectfile.format.requires=[IS_NOT_EMPTY()]
db.projectfile.cdate.requires=[IS_NOT_EMPTY(), IS_DATE()]
db.projectfile.datei.requires=IS_NOT_EMPTY()











On 9 Jun., 16:25, mdipierro <mdipie...@cs.depaul.edu> wrote:
> There is a reference to project.pname that I do not underastand so I
> can only give you a partial answer.
>
> You want to specify a filter as first argument of IS_IN_DB
>
> db.projectfile.projectname.requires=IS_IN_DB(db
> (db.project.userid==auth.user.id),
>             'project.pname', '%(pname)s')
>
> On Jun 9, 7:01 am, pk <peter.kirch...@youngdesigners.de> wrote:
>
> > Hi,
>
> > I've another question:
> > Every user should upload files and i create a table called
> > projectfile.
>
> > db.define_table('projectfile',
> >                 SQLField('userid', default=auth.user.id if auth.user
> > else 0, writable=False, readable=False),
> >                 SQLField('procreator', default=auth.user.last_name if
> > auth.user else 0, writable=False, readable=False),
> >                 SQLField('projectname'),
> >                 SQLField('filename'),
> >                 SQLField('format'),
> >                 SQLField('cdate', 'date', default=now),
> >                 SQLField('datei','upload'),
> >                 SQLField('description','text'))
>
> > db.projectfile.procreator.requires=IS_IN_DB(db,'auth_user.last_name')
> > db.projectfile.userid.requires=IS_IN_DB(db,'auth_user.id')
> > db.projectfile.projectname.requires=IS_IN_DB(db,'project.pname')
> > db.projectfile.filename.requires=[IS_NOT_EMPTY(),IS_NOT_IN_DB
> > (db,'projectfile.filename')]
> > db.projectfile.format.requires=[IS_NOT_EMPTY()]
> > db.projectfile.cdate.requires=[IS_NOT_EMPTY(), IS_DATE()]
> > db.projectfile.datei.requires=IS_NOT_EMPTY()
>
> > --------------------------------------------------------------------------------------------------------------------------------------------
>
> > def projectfile():
> >     if auth.is_logged_in():
> >         form=SQLFORM(db.projectfile,fields=['projectname',
> >                                         'filename',
> >                                         'format',
> >                                         'description',
> >                                         'datei'])
>
> > --------------------------------------------------------------------------------------------------------------------------------------------
>
> > now my question: how can i show on the website in the field
> > 'projectname' only the projects from the user not all projects in the
> > table?
>
> > thanks
>
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to