Hi Anthony,
Thank for the answer.
For the order of column think I was not clear(sorry not English).
If you look at the print screen before I clicked the column header the bulk
column was the 4th after the position is 5fth.
Concerning the column display, for table type_bulkhead I put format='%(name)s
%(id)s')
#table language
db.define_table('depot_language',
Field('name','string',length=50,required=True,Unique=True)
,format='%(name)s %(id)s')
db.depot_language.name.required=IS_NOT_EMPTY()
#table depot
db.define_table('depot',
Field('depotname','string',length=255,required=True,unique=
True),
Field('id_narval','integer',required=True,unique=True),
Field('id_lang','reference depot_language',required=True)
,format='%(depotname)s %(id)s')
db.depot.depotname.required=IS_NOT_EMPTY()
db.depot.id_narval.required=IS_NOT_EMPTY()
db.depot.id_lang.required=IS_NOT_EMPTY()
db.depot.id_lang.requires=IS_IN_DB(db,db.depot_language.id,'%(name)s')
db.depot.id_lang.writable=db.depot.id_lang.readable=False
#Tables Autorisations
auth = Auth(db)
auth.settings.extra_fields['auth_user'] = [Field('id_depot','reference
depot',ondelete='SET NULL')]
#auth.define_tables(username=True)
auth.define_tables(username=True, signature=False)
db.auth_user.id_depot.requires=IS_IN_DB(db,db.depot.id,'%(depotname)s')
db.auth_user.id_depot.writable=db.auth_user.id_depot.readable=False
#Table type article
db.define_table('type_article',Field('articlename','string',length=100,
required=True,unique=True),
Field('id_narval','integer',required=True,unique=True)
,format='%(articlename)s %(id)s')
db.type_article.articlename.required=IS_NOT_EMPTY()
#table type bulkhead
db.define_table('type_bulkhead',
Field('name','string',length=50),
Field('id_narvalbulk','integer'),
Field('id_language','integer'),
format='%(name)s %(id)s')
db.type_bulkhead.name.required=IS_NOT_EMPTY()
db.type_bulkhead.id_narvalbulk.required=IS_NOT_EMPTY()
db.type_bulkhead.id_language.required=IS_NOT_EMPTY()
db.type_bulkhead.id_language.requires=IS_IN_DB(db,db.depot_language.id,
'%(name)s')
#db.type_bulkhead.id_language.writable=db.type_bulkhead.id_language.readable=False
#Table article
db.define_table('articles',
Field('cod_ref','string',length=100),
Field('condi_id','reference type_article',required=True),
Field('dossier','string',length=16),
Field('conteneur','string',length=11,format=("%c%c%c%c
%c%c%c %c%c%c/%c"),redefine=True),
Field('depot_id','reference depot',required=True),
Field('date_sortie','datetime',format=("%d/%m/%Y"),redefine=
True),
Field('detruit','boolean'),
Field('id_stk_article','integer'),
Field('user_id','reference auth_user',ondelete='SET NULL'),
Field('bulk_id','reference type_bulkhead'),
format='%(cod_ref)s %(id)s')
db.articles.condi_id.requires=IS_IN_DB(db,db.type_article.id,
'%(articlename)s')
db.articles.depot_id.requires=IS_IN_DB(db,db.depot.id,'%(depotname)s')
db.articles.user_id.requires=IS_IN_DB(db,db.auth_user.id,'%(username)s')
db.articles.bulk_id.requires=IS_IN_DB(db,db.type_bulkhead.id,'%(name)s')
db.articles.date_sortie.requires=IS_EMPTY_OR(IS_DATETIME('%d/%m/%Y'))
db.articles.condi_id.writable=db.articles.condi_id.readable=False
db.articles.depot_id.writable=db.articles.depot_id.readable=False
db.articles.user_id.writable=db.articles.user_id.readable=False
Le vendredi 9 novembre 2018 16:51:44 UTC+1, Yann Dulondel a écrit :
>
> Hi all
> I have a strange behaviors from view model.
> The columns are not in the same order when reloading page.See the bulk_id
> column
> I believe that i understood how columns order was setup: inverse order of
> creation in contoller
>
> myfields={db.articles.bulk_id,db.articles.dossier,db.articles.date_sortie,db.articles.conteneur,db.articles.cod_ref
> Corresponding colmns title= Bulk_id,Braid reference,Fitting date,numéro
> de conteneur,numéro de flexi
> First load
> Reloading page
>
>
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.