[web2py] Re: a couple of related questions

2011-10-23 Thread ニコノコ
Even if I'm logged in, I couldn't view a record when I click the
parent record. The parent field is a clickable representation viewable
in a grid.

re [2]
the relevant portion is the links parameter where I create a new
button. I want to create an icon for that button.


On Oct 23, 12:53 pm, Massimo Di Pierro 
wrote:
> About [1] the user_signature=True is default but the signature only
> works if you are logged in.
>
> I do not understand [2]
>
> On Oct 20, 9:40 pm, niknok  wrote:
>
>
>
>
>
>
>
> > I have a person table[1] with a parent field with a clickable
> > representation view of the record. If I put this on a grid and click on
> > the link, I get a "not authorized" error message. I thought I need to
> > pass the signature so I can make it viewable. (This works fine if
> > parameter user_signature=False)
>
> > Also, I have defined a default representation for the person table but
> > in my validation statement, note that I had to specify the same format
> > again. I'm wondering if there's a way to tell the validator to use the
> > default representation of the person (which I thought was web2py's
> > default behavior.)
>
> > In my grid, I specified a new button [2] in the links parameter, how do
> > I specificy an icon for this button? For example I want to use what's
> > already in base.css (book, heart, cross etc.)
>
> > /r
> > Nik
>
> > [1]
> > db.define_table('person'
> >                 ,Field('birth_date', 'date', requires=IS_DATE())
> >                 ,Field('last_name', notnull=True)
> >                 ,Field('given_name', notnull=True)
> >                 ,Field('parent', 'list:reference person'
> >                                 ,requires=IS_EMPTY_OR(IS_IN_DB(db, 
> > 'person.id'
> >                                               ,'%(last_name)s,
> > %(given_name)s [%(birth_date)s]'
> >                                               ,multiple=True
> >                                               ,zero=T('pick one')))
> >                                 ,represent =  lambda value, row: [A(' ▸'+
> > db.person[v].given_name , _href = URL('index/view/person', args=[v]))
> > for v in value])
> >                 ,auth.signature
> >                 ,format='%(last_name)s, %(given_name)s [%(birth_date)s]'
> >                 )
>
> > [2]
> >  form=SQLFORM.grid( db.person
> >                       ,fields=[db.person.id, db.person.last_name,
> > db.person.given_name
> >                                     ,db.person.middle_name,
> > db.person.gender, db.person.birth_date, db.person.parent]
> >                       ,showbuttontext=False
> >                       ,sorter_icons=('[▴]','[▾]')
> >                       ,onvalidation=person_processing
> >                       ,links = [lambda row: A('X',
> > _href=URL(args=["view", db.person, row.id] ))]
> >                       )


[web2py] Re: a couple of related questions

2011-10-22 Thread Massimo Di Pierro
About [1] the user_signature=True is default but the signature only
works if you are logged in.

I do not understand [2]

On Oct 20, 9:40 pm, niknok  wrote:
> I have a person table[1] with a parent field with a clickable
> representation view of the record. If I put this on a grid and click on
> the link, I get a "not authorized" error message. I thought I need to
> pass the signature so I can make it viewable. (This works fine if
> parameter user_signature=False)
>
> Also, I have defined a default representation for the person table but
> in my validation statement, note that I had to specify the same format
> again. I'm wondering if there's a way to tell the validator to use the
> default representation of the person (which I thought was web2py's
> default behavior.)
>
> In my grid, I specified a new button [2] in the links parameter, how do
> I specificy an icon for this button? For example I want to use what's
> already in base.css (book, heart, cross etc.)
>
> /r
> Nik
>
> [1]
> db.define_table('person'
>                 ,Field('birth_date', 'date', requires=IS_DATE())
>                 ,Field('last_name', notnull=True)
>                 ,Field('given_name', notnull=True)
>                 ,Field('parent', 'list:reference person'
>                                 ,requires=IS_EMPTY_OR(IS_IN_DB(db, 'person.id'
>                                               ,'%(last_name)s,
> %(given_name)s [%(birth_date)s]'
>                                               ,multiple=True
>                                               ,zero=T('pick one')))
>                                 ,represent =  lambda value, row: [A(' ▸'+
> db.person[v].given_name , _href = URL('index/view/person', args=[v]))
> for v in value])
>                 ,auth.signature
>                 ,format='%(last_name)s, %(given_name)s [%(birth_date)s]'
>                 )
>
> [2]
>  form=SQLFORM.grid( db.person
>                       ,fields=[db.person.id, db.person.last_name,
> db.person.given_name
>                                     ,db.person.middle_name,
> db.person.gender, db.person.birth_date, db.person.parent]
>                       ,showbuttontext=False
>                       ,sorter_icons=('[▴]','[▾]')
>                       ,onvalidation=person_processing
>                       ,links = [lambda row: A('X',
> _href=URL(args=["view", db.person, row.id] ))]
>                       )

[web2py] Re: a couple of related questions

2011-10-21 Thread niknok
Anyone?

On Oct 21, 10:40 am, niknok  wrote:
> I have a person table[1] with a parent field with a clickable
> representation view of the record. If I put this on a grid and click on
> the link, I get a "not authorized" error message. I thought I need to
> pass the signature so I can make it viewable. (This works fine if
> parameter user_signature=False)
>
> Also, I have defined a default representation for the person table but
> in my validation statement, note that I had to specify the same format
> again. I'm wondering if there's a way to tell the validator to use the
> default representation of the person (which I thought was web2py's
> default behavior.)
>
> In my grid, I specified a new button [2] in the links parameter, how do
> I specificy an icon for this button? For example I want to use what's
> already in base.css (book, heart, cross etc.)
>
> /r
> Nik
>
> [1]
> db.define_table('person'
>                 ,Field('birth_date', 'date', requires=IS_DATE())
>                 ,Field('last_name', notnull=True)
>                 ,Field('given_name', notnull=True)
>                 ,Field('parent', 'list:reference person'
>                                 ,requires=IS_EMPTY_OR(IS_IN_DB(db, 'person.id'
>                                               ,'%(last_name)s,
> %(given_name)s [%(birth_date)s]'
>                                               ,multiple=True
>                                               ,zero=T('pick one')))
>                                 ,represent =  lambda value, row: [A(' ▸'+
> db.person[v].given_name , _href = URL('index/view/person', args=[v]))
> for v in value])
>                 ,auth.signature
>                 ,format='%(last_name)s, %(given_name)s [%(birth_date)s]'
>                 )
>
> [2]
>  form=SQLFORM.grid( db.person
>                       ,fields=[db.person.id, db.person.last_name,
> db.person.given_name
>                                     ,db.person.middle_name,
> db.person.gender, db.person.birth_date, db.person.parent]
>                       ,showbuttontext=False
>                       ,sorter_icons=('[▴]','[▾]')
>                       ,onvalidation=person_processing
>                       ,links = [lambda row: A('X',
> _href=URL(args=["view", db.person, row.id] ))]
>                       )