[web2py] Calling a SQLFORM.grid from SQLFORM.grid return to the index page can't figure why

2018-08-21 Thread Yann Dulondel
Hello, web2py world.
I'm new to web2py and web development.
The index page displays a list of equipment type and has a link to a list 
of equipment of this type.
The index works fine but using the link redirect to the index page.
There is no error message.
When I replace the index code by the show_flexlist code, the equipment list 
is displayed 
I use MSSQL server and use the profiler to see what is the SQL command pass 
to it, but there is none.
I'm log in when I make a test. 
I'm sure stupid but want to understand how to be cured.
Best regards
Yann


default control


@auth.requires_login()
def index():
db.type_article.articlename.writable=False
db.type_article.id_narval.writable=False
db.type_article.writable=False
response.flash = T("Bonjour ")+auth.user.username
myquery=(db.type_article.id==db.articles.condi_id)&(db.articles.depot_id
==auth.user.id_depot)
myfields={db.type_article.articlename,db.type_article.id}
myheaders={'type_article.articlename':T('Type article'),'Type_article':
'ID'}
default_sort_order=[db.type_article.articlename]


type_articles=SQLFORM.grid(query=myquery
   ,orderby=default_sort_order
   , deletable=False
   ,editable=False
   ,details=False
   , maxtextlength=64
   , paginate=25
   ,create=False
   ,fields=myfields
   ,headers=myheaders
   ,field_id=db.type_article.id
   ,groupby=db.type_article.articlename|db.
type_article.id
   ,links = [lambda row: A('View flexi list',
_href=URL("default","show_flexlist",args=[row.id]))])
#,fields=fields,headers=headers
return dict(message=T('Welcome to Web Braid stock!'),type_articles=
type_articles)
@auth.requires_login()
def show_flexlist():
response.flash = T("valeur ")+request.args[0]+' /' +str(auth.user.
id_depot)
myquery=((db.articles.condi_id==request.args(0, cast=int))&(db.articles.
depot_id==auth.user.id_depot))
myfields={db.articles.cod_ref,db.articles.conteneur,db.articles.dossier,
db.articles.id}
myheaders={'articles.cod_ref':T('Flexi 
Number'),'articles.conteneur':T('Conteneur 
Number'),'articles.dossier':T('Braid reference'),'articles.id':'ID'}
default_sort_order=[db.articles.cod_ref]


flexlist=SQLFORM.grid(query=myquery
   ,orderby=default_sort_order
   , deletable=False
   ,editable=False
   ,details=False
   , maxtextlength=64
   , paginate=25
   ,create=False
   ,fields=myfields
   ,headers=myheaders)




#,fields=fields,headers=headers
return dict(message=('test'),flexlist=flexlist)


default/show_flexlist.html


{{extend 'layout.html'}}
{{block header}}

  /{{=request.application}}

{{end}}




{{if 'message' in globals():}}
{{=message}}
{{pass}}
{{=flexlist}}


default index
{{extend 'layout.html'}}
{{block header}}

  /{{=request.application}}

{{end}}
{{=A('View flexi list',_href=URL("default","show_flexlist",args=15))}}


{{if 'message' in globals():}}
{{=message}}
{{pass}}
{{=type_articles}}

-- 
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 web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Calling a SQLFORM.grid from SQLFORM.grid return to the index page can't figure why

2018-09-05 Thread Yann Dulondel
First thank Anthony for your answer.
I pass the value of the column ID as an argument and it's the good value.
I have changed the code above show_flexlist instead of 
@auth.requires_login(), I use @auth.requires_signature(hash_vars=False) and 
now my detail list is displayed.

Yann


Le mardi 21 août 2018 16:44:57 UTC+2, Anthony a écrit :
>
> Is this the *exact *code? I see args=[row.id], but the query involves a 
> join, so I would expect row.id to throw an exception, as it should be 
> row.type_article.id.
>
> Anthony
>
> On Tuesday, August 21, 2018 at 9:10:39 AM UTC-4, Yann Dulondel wrote:
>>
>> Hello, web2py world.
>> I'm new to web2py and web development.
>> The index page displays a list of equipment type and has a link to a list 
>> of equipment of this type.
>> The index works fine but using the link redirect to the index page.
>> There is no error message.
>> When I replace the index code by the show_flexlist code, the equipment 
>> list is displayed 
>> I use MSSQL server and use the profiler to see what is the SQL command 
>> pass to it, but there is none.
>> I'm log in when I make a test. 
>> I'm sure stupid but want to understand how to be cured.
>> Best regards
>> Yann
>>
>>
>> default control
>>
>>
>> @auth.requires_login()
>> def index():
>> db.type_article.articlename.writable=False
>> db.type_article.id_narval.writable=False
>> db.type_article.writable=False
>> response.flash = T("Bonjour ")+auth.user.username
>> myquery=(db.type_article.id==db.articles.condi_id)&(db.articles.
>> depot_id==auth.user.id_depot)
>> myfields={db.type_article.articlename,db.type_article.id}
>> myheaders={'type_article.articlename':T('Type article'),
>> 'Type_article':'ID'}
>> default_sort_order=[db.type_article.articlename]
>>
>>
>> type_articles=SQLFORM.grid(query=myquery
>>,orderby=default_sort_order
>>, deletable=False
>>,editable=False
>>,details=False
>>, maxtextlength=64
>>, paginate=25
>>,create=False
>>,fields=myfields
>>,headers=myheaders
>>,field_id=db.type_article.id
>>,groupby=db.type_article.articlename|db.
>> type_article.id
>>,links = [lambda row: A('View flexi list',
>> _href=URL("default","show_flexlist",args=[row.id]))])
>> #,fields=fields,headers=headers
>> return dict(message=T('Welcome to Web Braid stock!'),type_articles=
>> type_articles)
>> @auth.requires_login()
>> def show_flexlist():
>> response.flash = T("valeur ")+request.args[0]+' /' +str(auth.user.
>> id_depot)
>> myquery=((db.articles.condi_id==request.args(0, cast=int))&(db.
>> articles.depot_id==auth.user.id_depot))
>> myfields={db.articles.cod_ref,db.articles.conteneur,db.articles.
>> dossier,db.articles.id}
>> myheaders={'articles.cod_ref':T('Flexi Number'),'articles.conteneur':
>> T('Conteneur Number'),'articles.dossier':T('Braid reference'),'
>> articles.id':'ID'}
>> default_sort_order=[db.articles.cod_ref]
>>
>>
>> flexlist=SQLFORM.grid(query=myquery
>>,orderby=default_sort_order
>>, deletable=False
>>,editable=False
>>,details=False
>>, maxtextlength=64
>>, paginate=25
>>,create=False
>>,fields=myfields
>>,headers=myheaders)
>>
>>
>>
>>
>> #,fields=fields,headers=headers
>> return dict(message=('test'),flexlist=flexlist)
>>
>>
>> default/show_flexlist.html
>>
>>
>> {{extend 'layout.html'}}
>> {{block header}}
>> 
>>   /{{=request.application}}
>> 
>> {{end}}
>>
>>
>>
>>
>> {{if 'message' in globals():}}
>> {{=message}}
>> {{pass}}
>> {{=flexlist}}
>>
>>
>> default index
>> {{extend 'layout.html'}}
>> {{block header}}
>> 
>>   /{{=request.application}}
>> 
>> {{end}}
>> {{=A('View flexi list',_href=URL("default","show_flexlist",args=15))}}
>>
>>
>> {{if 'message' in globals():}}
>> {{=message}}
>> {{pass}}
>> {{=type_articles}}
>>
>>

-- 
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 web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Spreadsheet.py documentation and status

2018-09-06 Thread Yann Dulondel
Hi
I had a look on w2ui and look good but don't have any idea on how to use it 
with w2py.
I'm a client-server dev.
This a new world for me.
If you have any clue, it would be really good
Thanks
Yann

-- 
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 web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Form string display mask

2018-09-14 Thread Yann Dulondel
Hello,
My user have to enter container number.
The container number is a string of lenght 11 char
The data for example is FCIU5808141 that must be display as FCIU 580 814/1

In my c/s application i just have to specify a display mask  as ' @@@ 
@@@/@'
Does exists something like that.
I use the format for date in web2y work fine and try to use format to solve 
with no success.

Yann

-- 
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 web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Form string display mask

2018-11-09 Thread Yann Dulondel
Sorry Mr Di Pierro for answering so late, i was very busy on other project.
Thank for your time.
Yann

Le vendredi 14 septembre 2018 15:05:22 UTC+2, Yann Dulondel a écrit :
>
> Hello,
> My user have to enter container number.
> The container number is a string of lenght 11 char
> The data for example is FCIU5808141 that must be display as FCIU 580 814/1
>
> In my c/s application i just have to specify a display mask  as ' @@@ 
> @@@/@'
> Does exists something like that.
> I use the format for date in web2y work fine and try to use format to 
> solve with no success.
>
> Yann
>

-- 
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 web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Column order in SQLFORM

2018-11-09 Thread Yann Dulondel
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 web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Column order in SQLFORM

2018-11-09 Thread Yann Dulondel
Seem to be in the header had put bulk_id instead of articles.bulk_id.
But i still have two issues

   - First when i click on header column bulk_id the order the column change
   - In the list is displayed the name of the record and his id


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 web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Column order in SQLFORM

2018-11-12 Thread Yann Dulondel
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 web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Column order in SQLFORM

2018-11-13 Thread Yann Dulondel
Code of the grid
def show_flexlist():
type_article=request.args(0, cast=int)
Results=db(db.type_article.id==type_article).select(db.type_article.
articlename)
row=Results[0]
ArticleName=row['articlename']
response.flash =T('Depot:')+str(auth.user.id_depot)
request.title=T("Braid Logistics Europe")
myquery=((db.articles.condi_id==type_article)&(db.articles.depot_id==
auth.user.id_depot))

#myfields={db.articles.cod_ref,db.articles.conteneur,db.articles.dossier,db.articles.id}
#myheaders={'articles.cod_ref':T('Flexi 
Number'),'articles.conteneur':T('Conteneur 
Number'),'articles.dossier':T('Braid reference'),'articles.id':'ID'}
myfields={db.articles.bulk_id,db.articles.dossier,db.articles.
date_sortie,db.articles.conteneur,db.articles.cod_ref}
myheaders={'articles.bulk_id':T('Bulkhead'),'articles.dossier':T('Braid 
reference'),'articles.date_sortie':T('Fitting 
Date'),'articles.conteneur':T('Conteneur 
Number'),'articles.cod_ref':T('Flexi Number')}
default_sort_order=[db.articles.cod_ref]
db.articles.cod_ref.writable=False
db.articles.id_stk_article.writable=False
db.articles.id_stk_article.visible=False
links = [lambda row: A(T('View Flexi'),_href=URL(show_flexi,args=[row.id
,type_article],user_signature=True))]
flexlist=SQLFORM.grid(query=myquery
   ,orderby=default_sort_order
   ,deletable=False
   ,editable=False
   ,details=False
   ,maxtextlength=64
   ,paginate=25
   ,create=False
   ,fields=myfields
   ,headers=myheaders
   ,user_signature=True
   ,searchable=True
   ,args= [type_article]
   ,links=links)


#,fields=fields,headers=headers
return dict(message=ArticleName,flexlist=flexlist)
Thank for the  format='%(name)s %(id)s')I was believing that was the way to 
link the display name to the id record
Once again thank, the web2py is great but the document is not detail 
enough.But i know that it's take time to provide documentation
yann

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 web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Column order in SQLFORM

2018-11-14 Thread Yann Dulondel
Works fine now, i'm not a pyhton dev and in dev language(powerbuilder) the 
{} define an array
>From myfields={db.articles.bulk_id,db.articles.dossier,db.articles.
date_sortie,db.articles.conteneur,db.articles.cod_ref}
to myfields[db.articles.bulk_id,db.articles.dossier,db.articles.date_sortie,
db.articles.conteneur,db.articles.cod_ref]
thank a lot
Yann

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 web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Changing color of a cell function of another cell value

2018-11-21 Thread Yann Dulondel
Hi all,
I have a container number and a function that check the number is valid.
The result of the function is store in field cntnumok (boolean).
I found that we can change the color with "represent" and found an example 
in webgroup.

db.articles.conteneur.represent = lambda v, row: SPAN(v, _class='cnt-false' 
if db.articles.cntnumok==False else None)
I understand lambda is an inline function, i want that the if test the 
value of  "cntnumok" for the row
How can i have the value of  "cntnumok"  for the row?
I tried this also
db.articles.conteneur.represent = lambda v, row: SPAN(v,_class='cnt-false' 
if row.cntnumok==False else None)

Yann

-- 
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 web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Changing color of a cell function of another cell value

2018-11-21 Thread Yann Dulondel


Le mercredi 21 novembre 2018 10:51:16 UTC+1, Yann Dulondel a écrit :
>
> Hi all,
> I have a container number and a function that check the number is valid.
> The result of the function is store in field cntnumok (boolean).
> I found that we can change the color with "represent" and found an example 
> in webgroup.
>
> db.articles.conteneur.represent = lambda v, row: SPAN(v, _class=
> 'cnt-false' if db.articles.cntnumok==False else None)
> I understand lambda is an inline function, i want that the if test the 
> value of  "cntnumok" for the row
> How can i have the value of  "cntnumok"  for the row?
> I tried this also
> db.articles.conteneur.represent = lambda v, row: SPAN(v,_class='cnt-false' 
> if row.cntnumok==False else None)
>
> Try this
db.articles.conteneur.represent = lambda cntnumok, row:SPAN(row['conteneur'
], _class='cnt-false' if cntnumok==False and cntnumok else None)

No error message but the color doesn't change

> Yann
>

-- 
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 web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Changing color of a cell function of another cell value

2018-11-23 Thread Yann Dulondel
Thank Javier,
I tried but not working.
The variable cntnumok contain the number of the container number not the 
state of the container number
Code generate (replace the css class by the value of variable)
HASU1484890

Le mercredi 21 novembre 2018 10:51:16 UTC+1, Yann Dulondel a écrit :
>
> Hi all,
> I have a container number and a function that check the number is valid.
> The result of the function is store in field cntnumok (boolean).
> I found that we can change the color with "represent" and found an example 
> in webgroup.
>
> db.articles.conteneur.represent = lambda v, row: SPAN(v, _class=
> 'cnt-false' if db.articles.cntnumok==False else None)
> I understand lambda is an inline function, i want that the if test the 
> value of  "cntnumok" for the row
> How can i have the value of  "cntnumok"  for the row?
> I tried this also
> db.articles.conteneur.represent = lambda v, row: SPAN(v,_class='cnt-false' 
> if row.cntnumok==False else None)
>
> Yann
>

-- 
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 web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Changing color of a cell function of another cell value

2018-11-26 Thread Yann Dulondel


Le mercredi 21 novembre 2018 10:51:16 UTC+1, Yann Dulondel a écrit :
>
> Hi all,
> I have a container number and a function that check the number is valid.
> The result of the function is store in field cntnumok (boolean).
> I found that we can change the color with "represent" and found an example 
> in webgroup.
>
> db.articles.conteneur.represent = lambda v, row: SPAN(v, _class=
> 'cnt-false' if db.articles.cntnumok==False else None)
> I understand lambda is an inline function, i want that the if test the 
> value of  "cntnumok" for the row
> How can i have the value of  "cntnumok"  for the row?
> I tried this also
> db.articles.conteneur.represent = lambda v, row: SPAN(v,_class='cnt-false' 
> if row.cntnumok==False else None)
>
> Yann
>

-- 
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 web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Changing color of a cell function of another cell value

2018-11-26 Thread Yann Dulondel
Val K 
You are right this work
db.articles.conteneur.represent = lambda v, row: SPAN(v,_class='cnt-false' 
if row.cntnumok==False else None)
I was believing this was refering to the database row , but in fact this 
refere to the result of select command in which i had not included the 
cntnumok field.
Thank a lot all for your help.
Yann

Le mercredi 21 novembre 2018 10:51:16 UTC+1, Yann Dulondel a écrit :
>
> Hi all,
> I have a container number and a function that check the number is valid.
> The result of the function is store in field cntnumok (boolean).
> I found that we can change the color with "represent" and found an example 
> in webgroup.
>
> db.articles.conteneur.represent = lambda v, row: SPAN(v, _class=
> 'cnt-false' if db.articles.cntnumok==False else None)
> I understand lambda is an inline function, i want that the if test the 
> value of  "cntnumok" for the row
> How can i have the value of  "cntnumok"  for the row?
> I tried this also
> db.articles.conteneur.represent = lambda v, row: SPAN(v,_class='cnt-false' 
> if row.cntnumok==False else None)
>
> Yann
>

-- 
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 web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Order with items

2018-12-18 Thread Yann Dulondel
Hi 
My project change from removing an item from stock to making on order.
In my container, i can have items with serial number and items with no 
serial number (only quantity).

So I have a list of order (missing new for now)
[image: 2018-12-18_11h04_02.png] 
And a detail of the order I try to use the load component function.
Does load function a better way than Iframe
I have strange behavior the menu appears in header of list and in the 
bottom i got a frame with "share" expending as is there is a loop 

[image: 2018-12-18_11h57_30.png]

Thank for your comment.

Yann





-- 
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 web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] SQL NOT IN issue(belong)

2019-01-02 Thread Yann Dulondel
Hi All 
Happy new year 2019.

I have an issue with SQL NOT IN
I tried to get a heater pad list(dropdown) in a form.
The heater must be related to user depot and not been used.
If they are used the heater id is set up in table articles

Queryheat=db((db.heatpad.id_depot==db.auth_user.id_depot)&(db.auth_user.id==
auth.user.id))&db(~db.heatpad.id.belongs(db.articles.heatpad))

I always get an exception memory error
I have tried with 
Queryheat=db((db.heatpad.id_depot==db.auth_user.id_depot)&(db.auth_user.id==
auth.user.id)&db(~db.heatpad.id.belongs(db.articles.heatpad).select(db.
heatpad.id)))
Queryheat=db((db.heatpad.id_depot==db.auth_user.id_depot)&(db.auth_user.id==
auth.user.id)&(~db.heatpad.id.belongs(db.articles.heatpad).select(db.heatpad
.id)))


def show_flexi():
request.title=T("Braid Logistics Europe")
flexi_id=request.args(0, cast=int)
type_article=request.args(1, cast=int)
records = db.articles(flexi_id)
db.articles.cod_ref.writable=False
db.articles.id_stk_article.readable=db.articles.id_stk_article.writable=
False
db.articles.id.readable=False
db.articles.isintegrated.readable=db.articles.isintegrated.writable=
False
depotrecord=db(db.depot.id==auth.user.id_depot).select(db.depot.
useheatpad)
Row=depotrecord[0]
if Row['useheatpad']==True:
myFields=['cod_ref','conteneur','dossier','date_sortie','bulk_id',
'detruit','heatpad']
Queryheat=db((db.heatpad.id_depot==db.auth_user.id_depot)&(db.
auth_user.id==auth.user.id))&db(~db.heatpad.id.belongs(db.articles.heatpad))
db.articles.heatpad.requires=IS_IN_DB(Queryheat,db.heatpad.id,
'%(cod_ref)s')
else:
 myFields=['cod_ref','conteneur','dossier','date_sortie','bulk_id',
'detruit']
QueryLang=db((db.depot.id==db.auth_user.id_depot)&(db.type_bulkhead.
id_language==db.depot.id_lang)&(db.auth_user.id==auth.user.id))
db.articles.bulk_id.requires=IS_IN_DB(QueryLang,db.type_bulkhead.id,
'%(name)s')
#labels={'cod_ref':T('Flexi Number'),'conteneur':T('Conteneur 
Number'),'dossier':T('Braid reference'),'date_sortie':T('Fitting 
date'),'bulk_id':T('Bulkhead'),'detruit':T('Destroyed')}
flexi=SQLFORM(db.articles
  ,record=records
  #,labels=labels
 ,fields=myFields)
 #,searchable=False)


flexi.add_button(T('Back'), URL(show_flexlist,args=[type_article],
user_signature=True))
if flexi.process(onvalidation=flexivalidation).accepted:
response.flash = T('form accepted')

#redirect(URL(show_flexlist,args=[type_article],user_signature=True))
elif flexi.errors:
   response.flash = T('Form has errors')


return(dict(message=flexi_id,flexi=flexi))
Any idea where i'm wrong ?
Yann


-- 
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 web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: SQL NOT IN issue(belong)

2019-01-03 Thread Yann Dulondel


Le mercredi 2 janvier 2019 16:55:54 UTC+1, Yann Dulondel a écrit :
>
> Hi All 
> Happy new year 2019.
>
> I have an issue with SQL NOT IN
> I tried to get a heater pad list(dropdown) in a form.
> The heater must be related to user depot and not been used.
> If they are used the heater id is set up in table articles
>
> Queryheat=db((db.heatpad.id_depot==db.auth_user.id_depot)&(db.auth_user.id
> ==auth.user.id))&db(~db.heatpad.id.belongs(db.articles.heatpad))
>
> I always get an exception memory error
> I have tried with 
> Queryheat=db((db.heatpad.id_depot==db.auth_user.id_depot)&(db.auth_user.id
> ==auth.user.id)&db(~db.heatpad.id.belongs(db.articles.heatpad).select(db.
> heatpad.id)))
> Queryheat=db((db.heatpad.id_depot==db.auth_user.id_depot)&(db.auth_user.id
> ==auth.user.id)&(~db.heatpad.id.belongs(db.articles.heatpad).select(db.
> heatpad.id)))
>
> The goal is to generate a SQL commande
>
 SELECT  X,Y from t1,t2 where t1.id=t2.fkid and x not in( select id from t3)


def show_flexi():
> request.title=T("Braid Logistics Europe")
> flexi_id=request.args(0, cast=int)
> type_article=request.args(1, cast=int)
> records = db.articles(flexi_id)
> db.articles.cod_ref.writable=False
> db.articles.id_stk_article.readable=db.articles.id_stk_article.
> writable=False
> db.articles.id.readable=False
> db.articles.isintegrated.readable=db.articles.isintegrated.writable=
> False
> depotrecord=db(db.depot.id==auth.user.id_depot).select(db.depot.
> useheatpad)
> Row=depotrecord[0]
> if Row['useheatpad']==True:
> myFields=['cod_ref','conteneur','dossier','date_sortie','bulk_id',
> 'detruit','heatpad']
> Queryheat=db((db.heatpad.id_depot==db.auth_user.id_depot)&(db.
> auth_user.id==auth.user.id))&db(~db.heatpad.id.belongs(db.articles.heatpad
> ))
> db.articles.heatpad.requires=IS_IN_DB(Queryheat,db.heatpad.id,
> '%(cod_ref)s')
> else:
>  myFields=['cod_ref','conteneur','dossier','date_sortie','bulk_id'
> ,'detruit']
> QueryLang=db((db.depot.id==db.auth_user.id_depot)&(db.type_bulkhead.
> id_language==db.depot.id_lang)&(db.auth_user.id==auth.user.id))
> db.articles.bulk_id.requires=IS_IN_DB(QueryLang,db.type_bulkhead.id,
> '%(name)s')
> #labels={'cod_ref':T('Flexi Number'),'conteneur':T('Conteneur 
> Number'),'dossier':T('Braid reference'),'date_sortie':T('Fitting 
> date'),'bulk_id':T('Bulkhead'),'detruit':T('Destroyed')}
> flexi=SQLFORM(db.articles
>   ,record=records
>   #,labels=labels
>  ,fields=myFields)
>  #,searchable=False)
>
>
> flexi.add_button(T('Back'), URL(show_flexlist,args=[type_article],
> user_signature=True))
> if flexi.process(onvalidation=flexivalidation).accepted:
> response.flash = T('form accepted')
> 
> #redirect(URL(show_flexlist,args=[type_article],user_signature=True))
> elif flexi.errors:
>response.flash = T('Form has errors')
>
>
> return(dict(message=flexi_id,flexi=flexi))
> Any idea where i'm wrong ?
> Yann
>
>
>

-- 
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 web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: SQL NOT IN issue(belong)

2019-01-03 Thread Yann Dulondel
Thank for your answer.
Ok i understand that this
db((db.v_heatpad.id_depot==db.auth_user.id_depot)&(db.auth_user.id==auth.
user.id)&(db.v_heatpad.padid==db.heatpad.id))
Create a where clause and belong does work with a full SQLcommande (Select 
 from t1,t2 where .)
[image: 2019-01-03_15h40_12.png]

I try to create a dropdown with items not used and the one of the current 
record.
I found a work around creating a view (v_heatpad) that list all the items 
not used, the problem is that off course the one used in the "Master 
record" is not displayed
a picture maybe is better than my explanation

[image: 2019-01-03_15h35_01.png]






Le jeudi 3 janvier 2019 13:33:06 UTC+1, Val K a écrit :
>
> Hi!
> `belongs` accepts list, tuple, SQL-string (that can be generated by 
>  `_select `) and in some cases it may be a `query` (see book for details)
> but you're trying to feed it with field-object   
>
>
>
>
> On Thursday, January 3, 2019 at 11:39:34 AM UTC+3, Yann Dulondel wrote:
>>
>>
>>
>> Le mercredi 2 janvier 2019 16:55:54 UTC+1, Yann Dulondel a écrit :
>>>
>>> Hi All 
>>> Happy new year 2019.
>>>
>>> I have an issue with SQL NOT IN
>>> I tried to get a heater pad list(dropdown) in a form.
>>> The heater must be related to user depot and not been used.
>>> If they are used the heater id is set up in table articles
>>>
>>> Queryheat=db((db.heatpad.id_depot==db.auth_user.id_depot)&(db.auth_user.
>>> id==auth.user.id))&db(~db.heatpad.id.belongs(db.articles.heatpad))
>>>
>>> I always get an exception memory error
>>> I have tried with 
>>> Queryheat=db((db.heatpad.id_depot==db.auth_user.id_depot)&(db.auth_user.
>>> id==auth.user.id)&db(~db.heatpad.id.belongs(db.articles.heatpad).select(
>>> db.heatpad.id)))
>>> Queryheat=db((db.heatpad.id_depot==db.auth_user.id_depot)&(db.auth_user.
>>> id==auth.user.id)&(~db.heatpad.id.belongs(db.articles.heatpad).select(db
>>> .heatpad.id)))
>>>
>>> The goal is to generate a SQL commande
>>>
>>  SELECT  X,Y from t1,t2 where t1.id=t2.fkid and x not in( select id from 
>> t3)
>>
>>
>> def show_flexi():
>>> request.title=T("Braid Logistics Europe")
>>> flexi_id=request.args(0, cast=int)
>>> type_article=request.args(1, cast=int)
>>> records = db.articles(flexi_id)
>>> db.articles.cod_ref.writable=False
>>> db.articles.id_stk_article.readable=db.articles.id_stk_article.
>>> writable=False
>>> db.articles.id.readable=False
>>> db.articles.isintegrated.readable=db.articles.isintegrated.writable=
>>> False
>>> depotrecord=db(db.depot.id==auth.user.id_depot).select(db.depot.
>>> useheatpad)
>>> Row=depotrecord[0]
>>> if Row['useheatpad']==True:
>>> myFields=['cod_ref','conteneur','dossier','date_sortie',
>>> 'bulk_id','detruit','heatpad']
>>> Queryheat=db((db.heatpad.id_depot==db.auth_user.id_depot)&(db.
>>> auth_user.id==auth.user.id))&db(~db.heatpad.id.belongs(db.articles.
>>> heatpad))
>>> db.articles.heatpad.requires=IS_IN_DB(Queryheat,db.heatpad.id,
>>> '%(cod_ref)s')
>>> else:
>>>  myFields=['cod_ref','conteneur','dossier','date_sortie',
>>> 'bulk_id','detruit']
>>> QueryLang=db((db.depot.id==db.auth_user.id_depot)&(db.type_bulkhead.
>>> id_language==db.depot.id_lang)&(db.auth_user.id==auth.user.id))
>>> db.articles.bulk_id.requires=IS_IN_DB(QueryLang,db.type_bulkhead.id,
>>> '%(name)s')
>>> #labels={'cod_ref':T('Flexi Number'),'conteneur':T('Conteneur 
>>> Number'),'dossier':T('Braid reference'),'date_sortie':T('Fitting 
>>> date'),'bulk_id':T('Bulkhead'),'detruit':T('Destroyed')}
>>> flexi=SQLFORM(db.articles
>>>   ,record=records
>>>   #,labels=labels
>>>  ,fields=myFields)
>>>  #,searchable=False)
>>>
>>>
>>> flexi.add_button(T('Back'), URL(show_flexlist,args=[type_article],
>>> user_signature=True))
>>> if flexi.process(onvalidation=flexivalidation).accepted:
>>> response.flash = T('form accepted')
>>> 
>>> #redirect(URL(show_flexlist,args=[type_article],user_signature=True))
>>> elif flexi.errors:
>>>response.flash = T('Form has errors')
>>>
>>>
>>> return(dict(message=flexi_id,flexi=flexi))
>>> Any idea where i'm wrong ?
>>> Yann
>>>
>>>
>>>

-- 
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 web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] On validation question

2019-01-08 Thread Yann Dulondel
Hello ,
Is there a way to diplays error message without stopping the database 
update.
There is an algorythm for shipping line container, but for container rent 
this doesn't apply
[image: 2019-01-08_16h32_54.png] 
So i need to alert the user but must record the value
Does something like that exists or an option or do i have to create an ajax 
function
form.alert.conteneur=T('Invalid container number')

def flexivalidation(form):
container_number=form.vars.conteneur
lconteneur=len(container_number)
dsortie=form.vars.date_sortie
destroy=form.vars.destroy
if lconteneur!=0 and lconteneur!=11:
form.errors.conteneur=T('container number must be 11 characters')
if lconteneur==11:
   if validcntnum(container_number)==False:
form.errors.conteneur=T('Invalid container number')
   #form.alert.conteneur=T('Invalid container number')
form.vars.cntnumok=False
   else :
form.vars.cntnumok=True
if lconteneur==11  and not dsortie:
form.errors.date_sortie=T('A fitting date is require')
if dsortie :
if dsortie>datetime.date.today():
 form.errors.date_sortie=T('Fitting date can not be superior at 
today')
if lconteneur==0 and destroy==False and dsortie:
  form.errors.date_sortie=T('Put a container number or tick 
destroyed')

Yann

-- 
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 web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: On validation question

2019-01-10 Thread Yann Dulondel
Thank Anthony, logical now you give this simple solution.
Yann

Le jeudi 10 janvier 2019 03:11:15 UTC+1, Anthony a écrit :
>
> Just don't make that check part of your onvalidation function. You can 
> add to form.errors at any time, so do it after the validation:
>
> form = SQLFORM(...).process(onvalidation=onvalidation)
> if form.accepted:
> [check for error]
> form.errors.myfield = 'Error message'
>
>
> or use the onsuccess callback:
>
> form = SQLFORM(...).process(onvalidation=onvalidation, onsuccess=
> onsuccess)
>
> Anthony
>
> On Tuesday, January 8, 2019 at 11:19:14 AM UTC-5, Yann Dulondel wrote:
>>
>> Hello ,
>> Is there a way to diplays error message without stopping the database 
>> update.
>> There is an algorythm for shipping line container, but for container rent 
>> this doesn't apply
>> [image: 2019-01-08_16h32_54.png]
>> So i need to alert the user but must record the value
>> Does something like that exists or an option or do i have to create an 
>> ajax function
>> form.alert.conteneur=T('Invalid container number')
>>
>> def flexivalidation(form):
>> container_number=form.vars.conteneur
>> lconteneur=len(container_number)
>> dsortie=form.vars.date_sortie
>> destroy=form.vars.destroy
>> if lconteneur!=0 and lconteneur!=11:
>> form.errors.conteneur=T('container number must be 11 characters')
>> if lconteneur==11:
>>if validcntnum(container_number)==False:
>> form.errors.conteneur=T('Invalid container number')
>>#form.alert.conteneur=T('Invalid container number')
>> form.vars.cntnumok=False
>>else :
>> form.vars.cntnumok=True
>> if lconteneur==11  and not dsortie:
>> form.errors.date_sortie=T('A fitting date is require')
>> if dsortie :
>> if dsortie>datetime.date.today():
>>  form.errors.date_sortie=T('Fitting date can not be superior 
>> at today')
>> if lconteneur==0 and destroy==False and dsortie:
>>   form.errors.date_sortie=T('Put a container number or tick 
>> destroyed')
>>
>> Yann
>>
>

-- 
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 web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Search using search widget return not autorized

2019-01-10 Thread Yann Dulondel
Hi,

I  want to pass a value to a function for using it in a query
I made links  with this code in the calling grid


links = [lambda row: A(T('View flexi 
list'),_href=URL(show_flexlist,args=[row.id,0],user_signature=True)),lambda 
row: A(T('View flexi 
list'),_href=URL(show_flexlist,args=[row.id,1],user_signature=True))])



@auth.requires_login()
def index():
db.type_article.articlename.writable=False
db.articles.id.readable=db.articles.id.writable=False
db.articles.cod_ref.readable=db.articles.cod_ref.writable=False
db.articles.dossier.readable=db.articles.dossier.writable=False
db.articles.conteneur.readable=db.articles.conteneur.writable=False
db.articles.bulk_id.readable=db.articles.bulk_id.writable=False
db.articles.isintegrated.readable=db.articles.isintegrated.writable=False

db.articles.id_stk_article.readable=db.articles.id_stk_article.writable=False
db.articles.date_sortie.readable=db.articles.date_sortie.writable=False
db.articles.detruit.readable=db.articles.detruit.writable=False
db.type_article.id.readable=db.type_article.id.writable=False
db.articles.depot_id.readable=db.articles.depot_id.writable=False
db.type_article.id_narval.readable=db.type_article.id_narval.writable=False

response.flash = T("Bonjour ")+auth.user.username
request.title=T("Braid Logistics Europe")

myquery=(db.type_article.id==db.articles.condi_id)&(db.articles.depot_id==auth.user.id_depot)&(db.articles.isintegrated==False)
myfields=[db.type_article.articlename]
myheaders={'type_article.articlename':T('Type article')}
default_sort_order=[db.type_article.articlename]
hide_fields(db.articles, ['heatpad', 'wallpanel', 'forcecntnum', 
'id_stk_article', 'isintegrated','cntnumok'])
type_articles=SQLFORM.grid(query=myquery
   ,orderby=default_sort_order
   ,deletable=False
   ,editable=False
   ,details=False
   ,maxtextlength=64
   ,paginate=25
   ,create=False
   ,fields=myfields
   ,headers=myheaders
   ,field_id=db.type_article.id
   
,groupby=db.type_article.articlename|db.type_article.id
   ,links = [lambda row: A(T('View flexi 
list'),_href=URL(show_flexlist,args=[row.id,0],user_signature=True)),lambda 
row: A(T('View flexi 
list'),_href=URL(show_flexlist,args=[row.id,1],user_signature=True))])

return dict(message=T('Welcome to Web Braid 
stock!'),type_articles=type_articles)
@auth.requires_signature(hash_vars=True)
def show_flexlist():
type_article = request.args(0, cast=int)
#isintegrated=False
isintegrated =request.args(1, cast=int)
#isintegrated=int(request.vars['_bintegrate'])

Results=db(db.type_article.id==type_article).select(db.type_article.articlename)
row=Results[0]
ArticleName=row['articlename']
response.flash =T('Depot:')+str(auth.user.id_depot)
request.title=T("Braid Logistics Europe")
if isintegrated==1 :
   bintegrated=True
else:
bintegrated=False

myquery=((db.articles.condi_id==type_article)&(db.articles.depot_id==auth.user.id_depot)&(db.articles.isintegrated==bintegrated))

#myfields={db.articles.cod_ref,db.articles.conteneur,db.articles.dossier,db.articles.id}
#myheaders={'articles.cod_ref':T('Flexi 
Number'),'articles.conteneur':T('Conteneur Number'),'articles.dossier':T('Braid 
reference'),'articles.id':'ID'}

myfields=[db.articles.cod_ref,db.articles.conteneur,db.articles.dossier,db.articles.date_sortie,db.articles.detruit,db.articles.bulk_id,db.articles.cntnumok]

myheaders={'articles.detruit':T('Destroyed'),'articles.bulk_id':T('Bulkhead'),'articles.dossier':T('Braid
 reference'),'articles.date_sortie':T('Fitting 
Date'),'articles.conteneur':T('Conteneur Number'),'articles.cod_ref':T('Flexi 
Number')}
default_sort_order=[db.articles.cod_ref]
db.articles.cod_ref.writable=False
db.articles.id.readable=False
db.articles.cntnumok.readable=db.articles.cntnumok.writable=False

hide_fields(db.articles,['heatpad','wallpanel','forcecntnum','id_stk_article','isintegrated'])
links = [lambda row: A(T('View 
Flexi'),_href=URL(show_flexi,args=[row.id,type_article],user_signature=True))]
flexlist=SQLFORM.grid(query=myquery
   ,orderby=default_sort_order
   ,deletable=False
   ,editable=False
   ,details=False
   ,maxtextlength=64
   ,paginate=25
   ,create=False
   ,fields=myfields
   ,headers=myheaders
   ,user_s

[web2py] Microsoft edge login failed

2019-03-04 Thread Yann Dulondel
Hi all,
I have an issue with MS edge, when i try to log on , i'm redirected on 
login page.
I don't have this with firefox or chrome.
Did someone have this issue ?
Best regards
Yann

-- 
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 web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Microsoft edge login failed

2019-03-04 Thread Yann Dulondel
Found it was a cookie issue on my IE

Le lundi 4 mars 2019 17:45:20 UTC+1, Yann Dulondel a écrit :
>
> Hi all,
> I have an issue with MS edge, when i try to log on , i'm redirected on 
> login page.
> I don't have this with firefox or chrome.
> Did someone have this issue ?
> Best regards
> Yann
>

-- 
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 web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] BUG Reset password link Spanish

2019-03-05 Thread Yann Dulondel
2.18.2-stable+timestamp.2019.02.26.06.11.06
(Running on Microsoft-IIS/7.5, Python 2.7.15) 

Hi all,
I force the application to display in Spanish by using the T.force('es-es').
When i use the link to reset 'Forgot yout password' , i have the error 
below.
Understand that Spanish can't be ascii. How can i fix this ? or is it a 
conception error ?
Best regard
Yann

-- 
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 web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Re: BUG Reset password link Spanish

2019-03-05 Thread Yann Dulondel
Thank for your help, work fine now.
Yann

Le mar. 5 mars 2019 à 13:03, Leonel Câmara  a
écrit :

> Hola,
>
> I made a fix you can apply, basically it's just doing it the same way
> web2py already did and the compat in pydal was doing differently.
>
> https://github.com/web2py/pydal/pull/559
>
> --
> 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 a topic in the
> Google Groups "web2py-users" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/web2py/uR8y9OqdfME/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.