SQLFORM.grid buttons

89 views
Skip to first unread message

Esprit Garonne

unread,
Mar 6, 2018, 2:33:26 PM3/6/18
to web2py-users
Hello,
Does it a bug All buttons in SQLFORM have only text link. And I am working on school project for carpool, Could someone help me
to build "etapes" like this https://www.blablacar.fr/offer-seats/1
I need only  how to add city or remove it for a "one trajet"  Could I do it with SQLFORM.factory with JQUERY?
Many thx
This is my model
 
db.define_table('t_villes',
               
Field('dep', type='string', notnull=True,
                      label
=T('Département')),
               
Field('nom', type='string', notnull=True,
                      label
=T('ville')),
               
Field('code_postal', type='string', notnull=True,
                      label
=T('Code postal')),
               
Field('longitude_deg', type='float', notnull=True,
                      label
=T('Longitude')),
               
Field('latitude_deg', type='float', notnull=True,
                      label
=T('Latitude')),
                format
='%(nom)s %(code_postal)s'
               
)


db
.define_table(
               
't_trajets',
               
Field('membre_voiture_id','reference t_voitures'),
               
Field('lieu_depart_id','reference t_villes',requires=IS_IN_DB(db,'t_villes.id','t_villes.nom')),
               
Field('lieu_arrive_id',db.t_villes),
               
Field('depart_le','datetime'),
               
Field('frequence',requires=IS_IN_SET(FREQUENCES),default=FREQUENCES[0]),
               
Field('type',requires=IS_IN_SET(TYPE_TRAJETS),default=TYPE_TRAJETS[0]),
               
Field('fumeur',requires=IS_IN_SET(FUMEUR),default=FUMEUR[1]),
               
Field('commentaire','text'),
               
               
Field( 'place_offert','integer'),
               auth
.signature
             
               
               
)
db
.define_table('t_etapes_ville',
       
Field('trajet_id','reference t_trajets',requires=IS_IN_DB(db,'t_trajets.id','t_trajets.lieu_depart_id')),
       
Field('ville_id',db.t_villes,requires=IS_IN_DB(db,'t_villes.id','t_villes.nom')),
       
Field('ordre_depart','integer'),

               
)



黄祥

unread,
Mar 6, 2018, 4:31:51 PM3/6/18
to web2py-users
in latest version web2py use bootstrap 4 that is by default doesn't include any icon for that, think you can try some of this option:
1. try trunk or github version, it included font awesome as an icon
2. put the icon by yourself in static/css side (font awesome or glyphicons.css) and put it on views/layout.html e.g. <link rel = "stylesheet" href = "{{=URL('static', 'css/glyphicons.css') }}" />, so that the icon can be reload in grid or any views part

best regards,
stifan

Esprit Garonne

unread,
Mar 7, 2018, 8:12:18 AM3/7/18
to web2py-users
Many Thanks,
Omg! I am really enjoying to test  this framework.

Massimo Di Pierro

unread,
Mar 16, 2018, 12:19:30 AM3/16/18
to web2py-users
we should release a new version soon where font-awesome s the default.
Reply all
Reply to author
Forward
0 new messages