Re: [web2py] custom form web2py not work when i use selectpicker

2018-08-21 Thread Carlos Correia
Às 20:41 de 21-08-2018, Rodrigo Gomes escreveu:
> thanks, but the problem is not adding the selectpicker in the selects, the
> problem is that by adding it to any select it does not recognize the input 
> data
>
> terça-feira, 21 de Agosto de 2018 às 14:17:48 UTC-3, Carlos Correia escreveu:
>
> Às 00:39 de 17-08-2018, Rodrigo Gomes escreveu:
>>
>> Good evening, folks, I've come here to unveil a mystery, I'm developing
>> an application with web2py, (framework that I use about 3 years ago)
>>
>> I am using sqlform.factory, passing 2 tables, being that I do this to
>> fill in a single form, table, person and address, for better
>> understanding follows my controller, 
>>
>>
>> |
>> @auth.requires_login()defstudents():    form
>> =form=SQLFORM.factory(db.person,db.address)     
>> ifform.process().accepted:       id
>> =db.person.insert(**db.person._filter_fields(form.vars))     
>>  form.vars.person=id        id
>> =db.address.insert(**db.address._filter_fields(form.vars))     
>>  response.flash='Form Submetido com sucesso!'      elifform.errors:     
>>  print(form.errors)    else:       print('please fill out the form')
>> |
>>
>>
>>
>> if it helps, this is my model, the tables and their relationships, 
>>
>> |
>> db.define_table("person",    Field("name","string",length=50),   
>> Field("cpf","string",length=11),    Field("birthday","date",length=11), 
>>   Field("email","string",length=40),   
>> Field("registration_date","date",length=40)   
>> )db.define_table("cities",    Field("name","string"),   
>> Field("state","reference state")    )db.define_table("address_type",   
>> Field("type","string",length=100),    )db.define_table("address",   
>> Field("number","integer"),    Field("public_place","string"),   
>> Field("cep","string",length=15),    Field("complement","string"),   
>> Field("cities",'reference cities'),    Field("address_type",'reference
>> address_type'),    Field("person",'reference
>> person',writable=False,readable=False)    )
>> |
>>
>>
>>
>> This is my view
>>
>> |
>> 
>> 
>>  
>>                      
>>                            
>> 
>> 
>>  
>>                                      
>>                
>> 
>> 
>>  
>>                                      
>>                            
>> 
>> 
>>  
>>                                                                    
>>                                          
>>                              
>>   > selectpicker" 
>> id="no_table_address_type"name="address_type"data-style="btn-info
>> btn-outline-info">                                                       
>>                                         {{for t in address_type_list:}}  
>>                   > }}">{{=t.type}}                    {{pass}}        
>>                                 > m-b-20">               
>> > btn-outline-info"required>                    {{for city in
>> cities_list:}}                     > }}">{{=city.name }}           
>>         {{pass}}                                          
>>                                
>>       {{=form.hidden_fields()}}                              
>>               > btn-info"type="submit"value="Salvar">           
>> > waves-effect"data-dismiss="modal">Cancelar           
>> 
>> |
>>
>>
>>
>> now the problem: this selectpicker, simply my form can not store the
>> value of select, when I add this class, I needed it, I do not need it
>> that much, but it became a mission to understand what's happening here, I
>> gave a print em form. vars.cities and she's just like None, help please
>>
>> > 'rodg...@gmail.com ', 'registration_date' public_place ':'
>> ',' '' '' '' '' '' '' '' '' '' 'cities': None, 'address_type': None,
>> 'person': 4}>
>> -- 
>> 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+un...@googlegroups.com .
>> For more options, visit https://groups.google.com/d/optout
>> .
>
> Hi,
>
> I just add this piece of javascript at the end of layout.html to add the
> selectpicker class to select elements:
>
> jQuery(function(){ jQuery( 'select' ).selectpicker();
> jQuery('.selectpicker').selectpicker('refresh'); } );
> This add

Re: [web2py] custom form web2py not work when i use selectpicker

2018-08-21 Thread Rodrigo Gomes
thanks, but the problem is not adding the selectpicker in the selects, the 
problem is that by adding it to any select it does not recognize the input 
data

terça-feira, 21 de Agosto de 2018 às 14:17:48 UTC-3, Carlos Correia 
escreveu:
>
> Às 00:39 de 17-08-2018, Rodrigo Gomes escreveu:
>
>
> Good evening, folks, I've come here to unveil a mystery, I'm developing an 
> application with web2py, (framework that I use about 3 years ago)
>
> I am using sqlform.factory, passing 2 tables, being that I do this to fill 
> in a single form, table, person and address, for better understanding 
> follows my controller, 
>
>
> @auth.requires_login()def students():
> form = form=SQLFORM.factory(db.person, db.address)
>  
> if form.process().accepted:
>id = db.person.insert(**db.person._filter_fields(form.vars))
>form.vars.person=id
>id = db.address.insert(**db.address._filter_fields(form.vars))
>response.flash='Form Submetido com sucesso!' 
>  
> elif form.errors:
>print(form.errors)
> else:
>print('please fill out the form')
>
>
>
>
> if it helps, this is my model, the tables and their relationships, 
>
> db.define_table("person",
> Field("name", "string", length=50),
> Field("cpf", "string", length=11),
> Field("birthday", "date", length=11),
> Field("email","string", length=40),
> Field("registration_date","date", length=40)
> )
>
> db.define_table("cities",
> Field("name", "string"),
> Field("state","reference state")
> )
>
> db.define_table("address_type",
> Field("type","string",length=100),
> )
>
> db.define_table("address",
> Field("number","integer"),
> Field("public_place","string"),
> Field("cep","string",length=15),
> Field("complement","string"),
> Field("cities",'reference cities'),
> Field("address_type",'reference address_type'),
> Field("person",'reference person', writable=False,readable=False)
> )
>
>
>
>
> This is my view 
>
>  method="post">
> 
> 
> 
>  type="text" placeholder="nome">
> 
> 
> 
>  type="text" placeholder="cpf">
> 
> 
> 
> 
>  type="text" placeholder="email">
> 
> 
> 
> 
> 
>  id="no_table_address_type" name="address_type" data-style="btn-info 
> btn-outline-info">
> 
> {{for t in address_type_list:}}
> {{=t.type}}
> {{pass}}
> 
> 
> 
>  data-style="btn-info btn-outline-info" required>
> {{for city in cities_list:}}
> {{=city.name}}
> {{pass}}
> 
> 
> 
> 
> 
> {{=form.hidden_fields()}}
> 
> 
> 
> 
> 
>  data-dismiss="modal">Cancelar
> 
> 
>
>
>
>
> now the problem: this selectpicker, simply my form can not store the value 
> of select, when I add this class, I needed it, I do not need it that much, 
> but it became a mission to understand what's happening here, I gave a print 
> em form. vars.cities and she's just like None, help please
>
>  rodg...@gmail.com ', 'registration_date' public_place ':' 
> ',' '' '' '' '' '' '' '' '' '' 'cities': None, 'address_type': None, 
> 'person': 4}>
> -- 
> 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+un...@googlegroups.com .
> For more options, visit https://groups.google.com/d/optout.
>
> Hi,
> I just add this piece of javascript at the end of layout.html to add the 
> selectpicker class to select elements:
>
> jQuery(function(){
> jQuery( 'select' ).selectpicker();
> jQuery('.selectpicker').selectpicker('refresh');
> } );This adds the 'select_picker' class to everey select statement.Regards,
>
> Carlos Correia
> =
> MEMÓRIA PERSISTENTE
> GSM:  917 157 146
> e-mail: ge...@memoriapersistente.pt 
> URL: http://www.memoriapersistente.pt
> XMPP (Jabber): car...@memoriapersistente.pt  (NOVO)
> GnuPG: wwwkeys.eu.pgp.net
> URL Suporte: https://t5.m16e.com/gps
>
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (R

Re: [web2py] custom form web2py not work when i use selectpicker

2018-08-21 Thread Carlos Correia
Às 00:39 de 17-08-2018, Rodrigo Gomes escreveu:
>
> Good evening, folks, I've come here to unveil a mystery, I'm developing an
> application with web2py, (framework that I use about 3 years ago)
>
> I am using sqlform.factory, passing 2 tables, being that I do this to fill in
> a single form, table, person and address, for better understanding follows my
> controller, 
>
>
> |
> @auth.requires_login()defstudents():    form
> =form=SQLFORM.factory(db.person,db.address)      ifform.process().accepted:   
>    id =db.person.insert(**db.person._filter_fields(form.vars))     
>  form.vars.person=id        id
> =db.address.insert(**db.address._filter_fields(form.vars))     
>  response.flash='Form Submetido com sucesso!'      elifform.errors:     
>  print(form.errors)    else:       print('please fill out the form')
> |
>
>
>
> if it helps, this is my model, the tables and their relationships, 
>
> |
> db.define_table("person",    Field("name","string",length=50),   
> Field("cpf","string",length=11),    Field("birthday","date",length=11),   
> Field("email","string",length=40),   
> Field("registration_date","date",length=40)    )db.define_table("cities",   
> Field("name","string"),    Field("state","reference state")   
> )db.define_table("address_type",    Field("type","string",length=100),   
> )db.define_table("address",    Field("number","integer"),   
> Field("public_place","string"),    Field("cep","string",length=15),   
> Field("complement","string"),    Field("cities",'reference cities'),   
> Field("address_type",'reference address_type'),    Field("person",'reference
> person',writable=False,readable=False)    )
> |
>
>
>
> This is my view
>
> |
> 
>  
>                          
>                        
> 
>  
>                                      
>                
> 
>  
>                                            
>                      
> 
>  
>                                                                        
>                                                                        selectpicker" 
> id="no_table_address_type"name="address_type"data-style="btn-info
> btn-outline-info">                                                           
>                                     {{for t in address_type_list:}}          
>           {{=t.type}}                   
> {{pass}}                                        
>                
>  btn-outline-info"required>                    {{for city in cities_list:}}    
>                 {{=city.name}}           
>         {{pass}}                                              
>                                  
> {{=form.hidden_fields()}}                                
>              btn-info"type="submit"value="Salvar">           
>  waves-effect"data-dismiss="modal">Cancelar            
> 
> |
>
>
>
> now the problem: this selectpicker, simply my form can not store the value of
> select, when I add this class, I needed it, I do not need it that much, but it
> became a mission to understand what's happening here, I gave a print em form.
> vars.cities and she's just like None, help please
>
>  'rodgom...@gmail.com', 'registration_date' public_place ':' ',' '' '' '' '' ''
> '' '' '' '' 'cities': None, 'address_type': None, 'person': 4}>
> -- 
> 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.

Hi,

I just add this piece of javascript at the end of layout.html to add the
selectpicker class to select elements:

jQuery(function(){ jQuery( 'select' ).selectpicker();
jQuery('.selectpicker').selectpicker('refresh'); } );
This adds the 'select_picker' class to everey select statement.
Regards,

Carlos Correia
=
MEMÓRIA PERSISTENTE
GSM:  917 157 146
e-mail: ge...@memoriapersistente.pt
URL: http://www.memoriapersistente.pt
XMPP (Jabber): car...@memoriapersistente.pt (NOVO)
GnuPG: wwwkeys.eu.pgp.net
URL Suporte: https://t5.m16e.com/gps

-- 
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] custom form web2py not work when i use selectpicker

2018-08-16 Thread Rodrigo Gomes

Good evening, folks, I've come here to unveil a mystery, I'm developing an 
application with web2py, (framework that I use about 3 years ago)

I am using sqlform.factory, passing 2 tables, being that I do this to fill 
in a single form, table, person and address, for better understanding 
follows my controller, 


@auth.requires_login()
def students():
form = form=SQLFORM.factory(db.person, db.address)
 
if form.process().accepted:
   id = db.person.insert(**db.person._filter_fields(form.vars))
   form.vars.person=id
   id = db.address.insert(**db.address._filter_fields(form.vars))
   response.flash='Form Submetido com sucesso!' 
 
elif form.errors:
   print(form.errors)
else:
   print('please fill out the form')




if it helps, this is my model, the tables and their relationships, 

db.define_table("person",
Field("name", "string", length=50),
Field("cpf", "string", length=11),
Field("birthday", "date", length=11),
Field("email","string", length=40),
Field("registration_date","date", length=40)
)

db.define_table("cities",
Field("name", "string"),
Field("state","reference state")
)

db.define_table("address_type",
Field("type","string",length=100),
)

db.define_table("address",
Field("number","integer"),
Field("public_place","string"),
Field("cep","string",length=15),
Field("complement","string"),
Field("cities",'reference cities'),
Field("address_type",'reference address_type'),
Field("person",'reference person', writable=False,readable=False)
)




This is my view 















  
  



  
  
{{for t in address_type_list:}}
{{=t.type}}
{{pass}}




{{for city in cities_list:}}
{{=city.name}}
{{pass}}





{{=form.hidden_fields()}}





Cancelar







now the problem: this selectpicker, simply my form can not store the value 
of select, when I add this class, I needed it, I do not need it that much, 
but it became a mission to understand what's happening here, I gave a print 
em form. vars.cities and she's just like None, help please



-- 
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.