Re: [web2py] Re: Legacy table with reserved keyword in column name

2017-10-27 Thread Fabiano Almeida
Wow, thanks!

The rname parameter of Field solved the problem.

2017-10-27 6:14 GMT-02:00 Nico de Groot :

> No, that just changes how the DAL checks for conflicts with reserved SQL
> words. It depends on the backend which words are problematic. See the book.
> If you really want to use a reserved word check out the rname parameter of
> Field.
>
> Nico de Groot
>
> --
> 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.
>

-- 
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] Legacy table with reserved keyword in column name

2017-10-26 Thread Fabiano Almeida
Hi!

How to put in the DAL a legacy table whose column name matches reserved SQL
words?

Traceback:

SyntaxError: invalid table/column name "Message" is a "ALL" reserved
SQL/NOSQL keywor



thanks

-- 
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: HTML5 widgets on SQLFORM.factory

2017-09-12 Thread Fabiano Almeida
Great Anthony!

Field('year', 'integer', label='Year',
  widget=lambda f, v: SQLFORM.widgets.string.widget(f, v, _type='number'
))

worked perfectly!

Thanks!

2017-09-11 19:59 GMT-03:00 Anthony :

> On Monday, September 11, 2017 at 4:30:40 PM UTC-4, Fabiano Almeida wrote:
>>
>> Hi @ll!
>>
>> How to use HTML5 widgets on SQLFORM.factory?
>>
>> I have this peace of code:
>> form = SQLFORM.factory(Field('year', 'integer', label='Year'))
>>
>
>> I like use this HTML5 input type="number" widget.
>>
>
> You can do:
>
> Field('year', 'integer', label='Year',
>   widget=lambda f, v: SQLFORM.widgets.string.widget(f, v, _type=
> 'number'))
>
> You could instead use SQLFORM.widgets.integer.widget (which is the default
> for integer fields), but that would set class="integer", which would
> activate web2py's built-in integer validator, which you may not want.
>
> Anthony
>
> --
> 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.
>

-- 
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] HTML5 widgets on SQLFORM.factory

2017-09-11 Thread Fabiano Almeida
Hi @ll!

How to use HTML5 widgets on SQLFORM.factory?

I have this peace of code:
form = SQLFORM.factory(Field('year', 'integer', label='Year'))

I like use this HTML5 input type="number" widget.


Thanks

-- 
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] How to install NLTK?

2017-08-15 Thread Fabiano Almeida
Hi all,

How to install NLTK on web2py?

Thanks,

Fabiano.

-- 
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] Sites Powered by web2py

2017-04-05 Thread Fabiano Almeida
Thanks Alex!

2017-04-05 11:43 GMT-03:00 Alex :

> Thanks Fabiano.
>
> Each subdomain refers to an own application, each with it's own database
> since the breeds are not related to each other.
>
> Alex
>
> On Wednesday, April 5, 2017 at 2:52:00 AM UTC+2, Fabiano Almeida wrote:
>>
>> Hi Alex!
>> Great design ! Congratulations!
>>
>> I see use of subdomain to breeds, how do you do it?
>>
>> thx,
>>
>> Fabiano.
>>
>> 2017-04-02 17:58 GMT-03:00 Alex :
>>
>>> The section for "Sites Powered by web2py" does not look very promising
>>> and also seems outdated. Most pages don't have a screenshot and some of
>>> them are not even working anymore. When I try to visit the first site I get
>>> a link to an internal error ticket.
>>>
>>> Submitting a new page does not work. We tried to add our website but it
>>> does not show up. Maybe you want to add it: https://breedarchive.com
>>>
>>> Further I'd encourage you to completely restructure the powered by
>>> section because the current page probably has the opposite desired effect
>>> and scares off new visitors. Hundreds of applications, many of them with
>>> questionable content, is not really helpful. It would be much better to
>>> only show a very small selection (~5) of high quality web2py sites. Each
>>> one with a screenshot and a short description.
>>>
>>> regards,
>>> Alex
>>>
>>> --
>>> 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.
>>>
>>
>> --
> 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.
>

-- 
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] Sites Powered by web2py

2017-04-04 Thread Fabiano Almeida
Hi Alex!
Great design ! Congratulations!

I see use of subdomain to breeds, how do you do it?

thx,

Fabiano.

2017-04-02 17:58 GMT-03:00 Alex :

> The section for "Sites Powered by web2py" does not look very promising and
> also seems outdated. Most pages don't have a screenshot and some of them
> are not even working anymore. When I try to visit the first site I get a
> link to an internal error ticket.
>
> Submitting a new page does not work. We tried to add our website but it
> does not show up. Maybe you want to add it: https://breedarchive.com
>
> Further I'd encourage you to completely restructure the powered by section
> because the current page probably has the opposite desired effect and
> scares off new visitors. Hundreds of applications, many of them with
> questionable content, is not really helpful. It would be much better to
> only show a very small selection (~5) of high quality web2py sites. Each
> one with a screenshot and a short description.
>
> regards,
> Alex
>
> --
> 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.
>

-- 
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: edit or delete child or detail table on SQLFORM.grid with left join

2017-03-20 Thread Fabiano Almeida
Thanks Massimo, I will try this.

2017-03-20 11:41 GMT-03:00 Massimo Di Pierro :

> Unfortunately not out of the box. You need a custom button that does a
> ajax query.
>
>
> On Friday, 3 March 2017 17:52:30 UTC-6, 黄祥 wrote:
>>
>> is it possible to edit or delete child or detail table on SQLFORM.grid
>> with left join?
>> i've tried before it seems the edit is for the first table (parent or
>> header), the child or detail table cannot be edited or deleted with left
>> join in SQLFORM.grid.
>> *e.g.*
>> def report_production_result():
>> table_header = db.production_result_header
>> table_detail = db.production_result_detail
>>
>> orderby = ~table_header.id
>> left = table_detail.on(table_header.id == table_detail.production_result
>> _no)
>> fields = [
>>  # header
>>  table_header.id, table_header.production_result_no,
>> table_header.production_result_date,
>>  table_header.shift, table_header.origin, table_header.status,
>>  # detail
>>  table_detail.stock, table_detail.quantity]
>> grid = SQLFORM.grid(table_header, fields = fields, left = left, orderby =
>> orderby)
>> return locals()
>>
>> thanks and best regards,
>> stifan
>>
> --
> 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.
>

-- 
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] Radius Authentication

2017-03-14 Thread Fabiano Almeida
Hi All!

Is it possible to authenticate web2py users through the freeradius server?

Thx

-- 
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: Open Sourced dating website

2017-02-27 Thread Fabiano Almeida
Wow! Thanks for sharing! New ideas! New features!

Thanks a lot and best regards!

Fabiano

2017-02-26 21:03 GMT-03:00 Jaimee S :

> Yea, dude. There definitely aren't ‎many new ideas under the sun so its
> always best to find one and improve it a little.
>
> David Shavers
> Founder, Just Between Us
> jbthelpp...@gmail.com
> www.jbtus.com
> *From: *Donald McClymont
> *Sent: *Sunday, February 26, 2017 4:18 PM
> *To: *web2py-users
> *Reply To: *web2py@googlegroups.com
> *Subject: *[web2py] Re: Open Sourced dating website
>
> Thanks for sharing - I will take a look.  No plans to start a dating
> website for people - however currently quite enjoying reading "The
> evolution of everything" and this argues that human progress arises when
> ideas have sex - so perhaps it could be adapted to a dating site for ideas.
>
> Donald
>
>
>
> On Sunday, February 26, 2017 at 6:17:15 AM UTC, David Shavers wrote:
>>
>> Good Evening,
>>
>> I made a dating website when i was heavily into web2py. My original goal
>> was to overthrow Plenty of Fish. Didn't happen lol. Currently I'm into
>> android development and release new apps almost weekly. My dating website
>> has over 300 users and it's still growing even though i don't advertise or
>> put any effort into marketing. If you are interested/single/curious/looking
>> for love/etc, it's http://www.jbtus.com
>>
>>
>> About an hour ago, i open sourced it on github because i figured some
>> other developer may be trying to overtake pof too and would need a
>> jumpstart to help them get past all of the arbitraries. I'm also looking
>> for employment! The website has many features such as: user to user
>> messaging, a forum, a user feed similar to that of Facebook, bootstrap
>> slideshow, jumbotrons, sorting based on gender/preference, stripe(payment)
>> integration, featured users, user login page, and much more! This website
>> is easily customizable and i did most of the hard work for you. Also, this
>> app uses NO PLUGINS! Enjoy!
>>
>>
>> https://github.com/frontEndDevv/dating_website
>>
>>
>>
>>
>>
>> PS.. if you encounter any issues that you aren't able to fix, please
>> contact me so i can try my best to help!  And if you are into android
>> development, let me know and we can collaborate or swap ideas or something
>>
> --
> 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/fKisIOIL1qE/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.
>

-- 
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: Non-Editable field in SQLFORM

2016-12-12 Thread Fabiano Almeida
db.table.field.writable = False -> don't write
db.table.field.readable = False  -> don't show (hide)

2016-12-12 14:17 GMT-02:00 lyn2py :

> It will always be allowed to take a value in insert, a value that you
> assign it to, for example, via "default", like so:
> db.table.field.default = some_value
>
> To make the field non-editable to the end user, use:
> db.table.field.editable = False
> ...
> form = SQLFORM(db.table)
>
> for the above examples, replace *table* with *your table name* and *field*
> with *your field name*.
>
> You can find out the details in Chapter in 06 The database abstraction
> layer
> 
>  and 07 Forms and validators
> 
>
>
> On Friday, December 9, 2016 at 11:38:55 PM UTC+8, Amit Kumar Modak wrote:
>>
>> Hello,
>>
>> How can I make a field non-editable in SQLFORM, while it should be
>> allowed to take a value in insert.
>>
>>
>> Regards,
>> Amit
>>
> --
> 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.
>

-- 
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] treat url error

2016-07-22 Thread Fabiano Almeida
How to capture and treat the url before displaying error? For example, the
User entered the url with a controller that does not exist, and the
application takes the url points to an existing controller for any action
to be done.

Thanks,

Fabiano.

-- 
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] WEB2PY Creating Controls Dynamically

2016-06-02 Thread Fabiano Almeida
Hi!

See
http://www.web2pyslices.com/slice/show/1724/cascading-dropdowns-simplified



2016-05-25 14:43 GMT-03:00 Venkat :

> Hi
>
> I have a requirement of displaying data from database from 4 tables i used
> join to pull all the data but i should display that data in dropdown for
> each column, how can i build these dropdowns dynamically? user will see
> that past data and will be able to select an option from that drop down
> and submit that data. i should be able to build those controls dynamically
> for all the records that i pull based on user and dates
>
> --
> 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.
>

-- 
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: random generator of stupid pages

2016-03-07 Thread Fabiano Almeida
Great work!

2016-03-07 3:24 GMT-03:00 Dave S :

> On Sunday, March 6, 2016 at 8:49:15 PM UTC-8, Massimo Di Pierro wrote:
>>
>> http://mdipierro.github.io/stupid.css/themes/random.html
>>
>
>
> Nice!  Thank you!
>
> /dps
>
>
> --
> 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.
>

-- 
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] custom form no submiting

2016-03-03 Thread Fabiano Almeida
*view:*

{{extend 'layout.html'}}
{{=form.custom.begin}}

 

 {{=db.stud_person.first_name
.label}}
 {{=form.custom.widget.first_name}}
 

 {{=db.stud_person.middle_name
.label}}
 {{=form.custom.widget.middle_name}}
 

 {{=db.stud_person.last_name
.label}}
 {{=form.custom.widget.last_name}}
 
 

{{=form.custom.submit}}
{{=form.custom.end}}


Fabiano.

2016-03-03 14:58 GMT-03:00 prashant joshi :

>
>
> def register():
> form=SQLFORM(db.stud_person)
> print form.errors
> if form.process().accepted:
> response.flash='Bitte warten'
> elif form.errors:
> response.flash='Bitte fuellen sie das Formular richtig aus'
>
> return dict(form=form)
>
>
>
>
> view:-
> {{=form.custom.begin}}
> 
> 
>href="{{=URL('static','css/bootstrap.min.css')}}"/>
>  href="{{=URL('static','css/web2py-bootstrap3.css')}}"/>
> 
> 
>
> 
>   
>
> 
>   
> First Name
> Middle Name
> Last Name
>   
>   
>   {{=form.custom.widget.first_name}}
> {{=form.custom.widget.middle_name}}
> {{=form.custom.widget.last_name}}
>   
> 
> {{=form.custom.submit}}
> 
> {{=form.custom.end}}
>
>
> This form is not submited
> deta is not iserting on detabase...
> This code is right
>
>
>
> --
> 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.
>

-- 
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: How to install web2py on CentOS 6.5 with Apache?

2016-02-25 Thread Fabiano Almeida
thanks Esau!

2016-02-24 19:48 GMT-03:00 Esau Hernandez Valles :

> I prefer web2py nginx on Centos.  I think this combination is better.
>
> check this link
> http://mwiki.yyovkov.net/index.php/Install_Web2py_on_CentOS_6
>
> On DigitalOcean there are a lot of tutorial. Only You have to sign-in.
>
> I think You have to checkscripts/setup-web2py-centos7.sh
>
> good lock
>
>
> El viernes, 19 de febrero de 2016, 9:48:59 (UTC-5), Fabiano Almeida
> escribió:
>>
>> Hi all,
>>
>> How to install web2py on CentOS 6.5 with Apache?
>>
>> Tks!
>>
>> Fabiano.
>>
> --
> 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.
>

-- 
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: Rich Text

2016-02-24 Thread Fabiano Almeida
Thanks Leonel!

2016-02-24 7:33 GMT-03:00 Leonel Câmara :

> Use Tim's plugin it works great
>
> https://github.com/timrichardson/web2py_ckeditor4
>
> --
> 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.
>

-- 
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] Rich Text

2016-02-23 Thread Fabiano Almeida
Hi all,

How field type is used to store rich text (with formatting, table, figure)
in db?

How to use ckEditor or other rich text editor in web2py?

Thanks,

Fabiano.

-- 
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: How to install web2py on CentOS 6.5 with Apache?

2016-02-19 Thread Fabiano Almeida
I'm a Debian user / Ubuntu, CentOS testing for the first time ...

Thanks!

2016-02-19 12:57 GMT-02:00 Jim S :

> I'm not a CentOS guy, but there are a couple scripts (although not for
> 6.5) in the /scripts directory that may give you clues as to what needs to
> happen.
>
> -Jim
>
>
> On Friday, February 19, 2016 at 8:48:59 AM UTC-6, Fabiano Almeida wrote:
>>
>> Hi all,
>>
>> How to install web2py on CentOS 6.5 with Apache?
>>
>> Tks!
>>
>> Fabiano.
>>
> --
> 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.
>

-- 
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] How to install web2py on CentOS 6.5 with Apache?

2016-02-19 Thread Fabiano Almeida
Hi all,

How to install web2py on CentOS 6.5 with Apache?

Tks!

Fabiano.

-- 
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: A guide how to install your web2py app on your own server (using DigitalOcean droplets)

2016-02-15 Thread Fabiano Almeida
Great! Thanks for sharing!

2016-02-15 9:30 GMT-02:00 'M Bailey' via web2py-users <
web2py@googlegroups.com>:

> Wow just read your blog. Really useful, clear instructions - thank you.
>
>
> On Monday, 15 February 2016 10:54:01 UTC, Dragan Matic wrote:
>>
>> Hey guys, I wrote a guide for beginners how to install and configure your
>> own server and how to host your web2py app on it, if anybody's interested
>> here's the link:
>>
>> http://blog.draganmatic.com/init/default/show_page/3
>>
> --
> 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.
>

-- 
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: web2py included on Synology DSM

2016-02-10 Thread Fabiano Almeida
+1

2016-02-10 13:16 GMT-02:00 Ron Chatterjee :

> +1
>
>
> On Wednesday, February 10, 2016 at 8:44:46 AM UTC-5, xmarx wrote:
>>
>> +1
>>
>> 10 Şubat 2016 Çarşamba 15:32:24 UTC+2 tarihinde Gerd yazdı:
>>>
>>> Hi!
>>>
>>> I would like to see web2py as a package for the Synology NAS, so i wrote
>>> an inquery to the company at
>>> https://www.synology.com/en-global/form/inquiry/feedback
>>>
>>> If you feel the same i suggest you to fill out the form and tell them
>>> that we want it ;-)
>>>
>>> Thanks,
>>> Gerd
>>>
>> --
> 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.
>

-- 
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] Virtual field in SQLFORM.grid

2016-01-19 Thread Fabiano Almeida
Hi Marcello,

Can you see your tables in appadmin?

And your lambda, you can create and call function to count in konsulta's
table and return the number.

Field.Virtual('total', lambda row: kontagem(row.id))


Att.,

Fabiano.

2016-01-19 15:09 GMT-02:00 Marcello :

> Hello,
>
> I have a one to many configuration, using mysql database.
> I want to show a grid with the "one" table, and for each row, count the
> "many".
>
> For that I created a total virtual field.
> It works OK in the shel, for example
>
> But when I call the SQLFORM.grid I get an error
>
> Why do this happen ???
> Is there a way to get this ??
>
>
> Thanks
> Marcello
>
> db.define_table(
> 'trabalho',
> Field('descricao','string'),
> Field.Virtual('total', lambda row: row.trabalho.konsulta.count()),
> )
>
> db.define_table(
> 'konsulta',
> Field('trabalho_id', 'reference trabalho'),
> Field('name','string'),
> )
>
>
> I want to show a grid with:
> grid = SQLFORM.grid(db.trabalho, editable=True, create=False,
> deletable=False)
>
> When I call it, I get:
> 
>
>
>
> --
> 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.
>

-- 
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: multi tenant

2016-01-18 Thread Fabiano Almeida
Great Massimo!

Thanks a lot!

Fabiano.

2016-01-17 23:00 GMT-02:00 Massimo Di Pierro :

> That URL structure assumes you have a single app running at the domain. So
> I am going to assume that is the case.
>
> first of all you have to map the tenant name ($domain) into
> request.args(0) using routes.py
>
> routes_in = [['/$domain','/yourapp/default/index/$domain'],
> ['/$domain/$c','/yourapp/$c/index/$domain'],
> ['/$domain/$c/$f','/yourapp/$c/$f/$domain'],
>
> ['/$domain/$c/$f/$anything','/yourapp/$c/$f/$domain/$anything']]
>
> routes_out = [(a,b) for (b,a) in routes_in]
>
> then you have to handle in code where the domain is now in request.args(0).
>
>
>
>
>
> On Friday, 15 January 2016 13:48:43 UTC-6, Fabiano Almeida wrote:
>>
>> Hi All!
>>
>> In the book shows multi tenant based on subdomain, with code
>> <http://www.web2py.com/books/default/chapter/29/06/the-database-abstraction-layer?search=tenancy#Common-fields-and-multi-tenancy>
>> :
>>
>>> db._common_fields.append(Field('request_tenant',
>>> default=request.env.http_host,writable=False))
>>
>>
>> Seeing commercial sites that use the concept of multi-tenant offices, the
>> url is usually www.domain.com/, and the  code that differs from
>> another tenant.
>>
>> It can deploy this type of multi-tenant access in web2py? how?
>>
>> thanks,
>>
>> Fabiano.
>>
> --
> 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.
>

-- 
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: web3py

2016-01-15 Thread Fabiano Almeida
2016-01-15 17:29 GMT-02:00 Carlos Cesar Caballero Díaz <
desarro...@spicm.cfg.sld.cu>:

> Hi, I have written about my opinion before. The backward compatibility
> should never affect the system maintenance, sometimes is better just remove
> the old functionalities to make way for the new ones, the backward
> compatibility in the long term will become unsustainable.
>
> In my opinion, something like a 90% of compatibility and a good migration
> guide should be enough, there are alternatives as the yii framework
> migration from 1.x to 2.x, they in some way could run the two versions side
> by side (
> http://www.yiiframework.com/doc-2.0/guide-tutorial-yii-integration.html#using-both-yii2-yii1
> )
>
> I know that one of the main promises of web2py was the backward
> compatibility, but I am sure that developers (web2py users are developers)
> prefer a clean system with new useful features.
>

+1

-- 
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] multi tenant

2016-01-15 Thread Fabiano Almeida
Hi All!

In the book shows multi tenant based on subdomain, with code

:

> db._common_fields.append(Field('request_tenant',
> default=request.env.http_host,writable=False))


Seeing commercial sites that use the concept of multi-tenant offices, the
url is usually www.domain.com/, and the  code that differs from
another tenant.

It can deploy this type of multi-tenant access in web2py? how?

thanks,

Fabiano.

-- 
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: what is difference between ajax() and web2py_component() ?

2016-01-07 Thread Fabiano Almeida
Great!

Can you show me examples of using web2py_component?

thanks!

Fabiano.

2016-01-07 13:57 GMT-02:00 Anthony :

> The ajax() function provides basic functionality for making an Ajax
> request, with some additional features, such as automatically sending
> values from named input fields and inserting the returned data into a
> particular target within the DOM (or optionally executing some returned
> Javascript code).
>
> web2py_component (which is a backward compatible alias for
> $.web2py.component) is a more sophisticated facility for embedding the
> output of controller actions within web pages. It is much like a page
> within a page, with the ability to load new content into the component. In
> particular, it is possible to trap both links and forms, so when you click
> a link or submit a form contained within a component, the new content will
> be loaded within the component (without reloading the rest of the page).
> Components also include functionality to automatically refresh themselves
> at a fixed interval.
>
> Anthony
>
>
> On Thursday, January 7, 2016 at 8:43:40 AM UTC-5, Ariya Owam-aram wrote:
>>
>> Hi everyone,
>>
>> I often use ajax and web2py_component for onclick action (for example)
>> but I never know what is difference between them and how to use them the
>> right way.  Can anyone guide me a good example, please?
>>
>> Thank your
>> Ariya
>>
>>
>> --
> 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.
>

-- 
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: Role of users

2015-12-02 Thread Fabiano Almeida
It works using the example many to many of the book:

for x in db(db.auth_user.id>0).select(db.auth_user.id):
groups = []
users_and_groups = db((db.auth_user.id==x.id)& 
(db.auth_user.id==db.auth_membership.user_id) & 
(db.auth_group.id==db.auth_membership.group_id))
for g in users_and_groups.select(db.auth_group.role, 
orderby=db.auth_membership.group_id):
groups.append(g.role)
# [...]


Em quarta-feira, 2 de dezembro de 2015 14:31:14 UTC-2, Fabiano Almeida 
escreveu:
>
> Hi!
>
> I'm trying to create a list of roles for each user:
>
> for x in db(db.auth_user.id>0).select(db.auth_user.id):
> groups = []
> for g in db(db.auth_membership.id > 0).select(db.auth_group.role, 
> join=[db.auth_group.on(db.auth_group.id==db.auth_membership.group_id), 
> db.auth_user.on(db.auth_user.id==db.auth_membership.user_id)]):
> groups.append(g.role)
>
> and the error:
>
> TypeError: reduce() of empty sequence with no initial value
>
> How to do this list?
>
> thanks,
>
> Fabiano
>

-- 
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: Role of users

2015-12-02 Thread Fabiano Almeida
Hi Anthony!

The auth.user_groups.value() is only for logged user or I can define user 
id to get for all users?

Thanks!

Fabiano

Em quarta-feira, 2 de dezembro de 2015 14:47:50 UTC-2, Anthony escreveu:
>
> The roles for a user are stored as a dictionary in auth.user_groups, with 
> the keys being the group IDs and the values being the roles, so for just a 
> list of the roles:
>
> auth.user_groups.values()
>
> Anthony
>
> On Wednesday, December 2, 2015 at 11:31:14 AM UTC-5, Fabiano Almeida wrote:
>>
>> Hi!
>>
>> I'm trying to create a list of roles for each user:
>>
>> for x in db(db.auth_user.id>0).select(db.auth_user.id):
>> groups = []
>> for g in db(db.auth_membership.id > 0).select(db.auth_group.role, 
>> join=[db.auth_group.on(db.auth_group.id==db.auth_membership.group_id), 
>> db.auth_user.on(db.auth_user.id==db.auth_membership.user_id)]):
>> groups.append(g.role)
>>
>> and the error:
>>
>> TypeError: reduce() of empty sequence with no initial value
>>
>> How to do this list?
>>
>> thanks,
>>
>> Fabiano
>>
>

-- 
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] Role of users

2015-12-02 Thread Fabiano Almeida
Hi!

I'm trying to create a list of roles for each user:

for x in db(db.auth_user.id>0).select(db.auth_user.id):
groups = []
for g in db(db.auth_membership.id > 0).select(db.auth_group.role,
join=[db.auth_group.on(db.auth_group.id==db.auth_membership.group_id),
db.auth_user.on(db.auth_user.id==db.auth_membership.user_id)]):
groups.append(g.role)

and the error:

TypeError: reduce() of empty sequence with no initial value

How to do this list?

thanks,

Fabiano

-- 
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: record versioning

2015-12-01 Thread Fabiano Almeida
thanks!

2015-12-01 17:21 GMT-02:00 Anthony :

> web2py does not support the SQL UNION statement, but you can separately
> query the two tables and generate the union of the two Rows objects via
> Python:
>
> all_records = db(db.mytable).select() | db(db.mytable_archive).select()
>
> See
> http://web2py.com/books/default/chapter/29/06/the-database-abstraction-layer#Combining-rows
> .
>
> Anthony
>
>
> On Monday, November 30, 2015 at 12:31:46 PM UTC-5, Fabiano Almeida wrote:
>>
>> Hi All!
>>
>> I need create a report with record versioning. How to union table with
>> table_archive?
>>
>> Thanks!
>>
> --
> 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.
>

-- 
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] record versioning

2015-11-30 Thread Fabiano Almeida
Hi All!

I need create a report with record versioning. How to union table with
table_archive?

Thanks!

-- 
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: new connection string in scaffold

2015-11-13 Thread Fabiano Almeida
thanks!

2015-11-13 23:13 GMT-02:00 黄祥 :

> please take a look at appconfig.ini file in private folder and change the
> uri value with your own settings :
> e.g.
> private/appconfig.ini
> [db]
> uri   = mysql://MySQLUser:MySQLPassword@MySQLHost/MySQLDatabase
>
> best regards,
> stifan
>
>> --
> 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.
>

-- 
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] new connection string in scaffold

2015-11-13 Thread Fabiano Almeida
Hi all,

I will create a new app in web2py 2.12.3, and I see:

db = DAL(myconf.take('db.uri'), pool_size=myconf.take('db.pool_size',
cast=int), check_reserved=['all'])

How to configure this to connect with remote mysql database ?

Thx!

Fabiano

-- 
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] Indexes

2015-11-12 Thread Fabiano Almeida
Hi All!

In book

I see example how to create index with executesql . How to use indexes in
querys?

Thx,

Fabiano.

-- 
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] its possible get mac address?

2015-11-05 Thread Fabiano Almeida
Hi All!


Got it. If the server and client are on the same network, including the
web2py it is installed on the network server. How to get the mac address by
ARP?

Thanks again,

Fabiano.

2015-11-04 21:40 GMT-02:00 Dave S :

>
> On Wednesday, November 4, 2015 at 11:58:07 AM UTC-8, Carlos Cesar
> Caballero wrote:
>
>
>> El 04/11/15 a las 14:30, Fabiano Almeida escribió:
>>
>> Hi!
>>
>> Web2py can obtain mac address from user?
>>
>> > Bassicly, the MAC address don't cross the routers, so, you can't get
> the mac address of a client from a external network server,
> > you only can get the MAC of the last router. You could do some tweak
> using ARP, but only if the client and server are in the same subnet.
>
>   Web2py does give you access to the requesting IP.  This my be a NAT'd
> value if the client is on an internal network, which is mostly the case.
>
> /dps
>
> --
> 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.
>

-- 
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] its possible get mac address?

2015-11-04 Thread Fabiano Almeida
Hi!

Web2py can obtain mac address from user?

Thanks in advance,

Fabiano.

-- 
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] How to filter table data in field of SQLFORM.factory?

2015-10-21 Thread Fabiano Almeida
Hi,

How to filter table data in field of SQLFORM.factory?

my code:

form = SQLFORM.factory(
Field('cbPerson', label='Person', requires=IS_IN_DB(db,'
auth_user.id','%(first_name)s %(last_name)s', zero=None), default=
auth.user.id))

need show only db.auth_user.id == auth.user.id

Thx,

Fabiano.

-- 
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: How to show query on a grid?

2015-10-19 Thread Fabiano Almeida
Delete the db before ((db.guest.id>0)... worked

query = ((db.guest.id>0) & \
> (db.voucher.disp == False) & \
> (db.voucher.guest == db.guest.id) & \
> (db.auth_user.id == db.guest.fnd)) \
> .select(db.voucher.voucher, db.guest.name, db.auth_user.id ,
> db.auth_user.first_name, db.guest.dia)
> form = SQLFORM.grid(query)
>

Thx

-- 
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] How to show query on a grid?

2015-10-15 Thread Fabiano Almeida
Hi!

I try to show query on a SQLFORM.grid, but returns error: AttributeError:
'Rows' object has no attribute '_db'

My code:

query = db((db.guest.id>0) & \
(db.voucher.disp == False) & \
(db.voucher.guest == db.guest.id) & \
(db.auth_user.id == db.guest.fnd)) \
.select(db.voucher.voucher, db.guest.name, db.auth_user.id ,
db.auth_user.first_name, db.guest.dia)
form = SQLFORM.grid(query)

How to show query on a grid?

thx in advance,

Fabiano.

-- 
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: qrcode

2015-10-14 Thread Fabiano Almeida
Hi Michael,

2015-10-14 16:00 GMT-03:00 Michael M :

> {{=XML(img_tag)}}


It worked! Grateful for all!

Fabiano.

-- 
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: qrcode

2015-10-14 Thread Fabiano Almeida
Hi Richard,

elaphe worked! thank you!

How to show a text message with qrcode on same page?

Thx

2015-10-13 21:07 GMT-03:00 Richard Vézina :

> You can have a look on the side of elaphe :
> https://bitbucket.org/whosaysni/elaphe/
>
> For most type of code it works... But there were issue with bouding box
> for some of them in the pass, hope it has been solve since then...
>
> Richard
>
> On Tue, Oct 13, 2015 at 5:28 PM, 黄祥  wrote:
>
>> i think there is web2py appliances that create some thing like this
>> before : semanticwebexample
>>
>> best regards,
>> stifan
>>
>> --
>> 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.
>>
>
> --
> 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.
>

-- 
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: qrcode

2015-10-14 Thread Fabiano Almeida
Hi Michael,

With your example, return this:

Qrpage
> StringIO:
> ToQRData:Fabiano Likes MLP:FIMimg: 0x7f02d1c0a9d0>img_tag: src="data:image/png;base64,iVBORw0KGgoNSUhEUgAAAQ4AAAEOAQBQysQIAAAB0klEQVR4nO2aQY7cIBBFXwVLs4Qb5Cj4BjnT3MwcZQ4wEl6OBPpZgJ3OIhopTnpsC1YNfouvUulTRbWJT1b99hkBA/nD0rL/ksq29WU79eVMcq+HeElSgRSAmPsXSZKW08m9GlLNLAAxO5G+lx7iZGZP13JfpIVzfZFew1druR8Ss9MvZ/haLfdAJsAJqJBmh+E/jJgrRD1Zy/2QCVbbNv7dlH6AUninn/pTyb0Y0kuDtjLtQns806jIjiDJzMxCNbPgRDOKdcLmdcLms8m9FIIWX9CCE/iCFi9p8RIxu5G7xxCk7NQ6tKjSTIG4G8Xo1Y4gPVmVnVrX1nIXAC+N6B5C+uuC1B8WNlMAKTffOJPciyHNcrvv4lqZ0NK2Vw8jun+P9FutPY/5PbBbOTac4V8gyV5EfDPrnfA6tXMpn1HulZDWCZvN+6tuCtX6CqeTeyHksS/r5cJePeA0brWDSNqyFFYzYq6mhWrgCzafTe7VkH02EduAwsnm5hbP13JDZJtNpADgP1oW29xS+XRyL4u4/rqwsJVqr+NWO4BMj5t1KobPWBQQ36bnarkf8jibwGeIS52UDMDruVruh/w2m6D2YMcc6B/GbOIAYuO/OP8R+Qk7Fi5D47GUFwBJRU5ErkJggg==">
> output:qr: instance at 0x7f02d1bf40e0>qrcode: '/usr/local/lib/python2.7/dist-packages/qrcode-5.1-py2.7.egg/qrcode/__init__.pyc'>
>

How to show de picture + text message?

thx

2015-10-14 13:05 GMT-03:00 Michael M :

> def qrpage():
> #Install Python Modules: (Pillow,qrcode)
> #https://github.com/lincolnloop/python-qrcode
>
> ToQRData = auth.user.username + ' Likes MLP:FIM'
> import qrcode
> import StringIO
> qr = qrcode.QRCode(
> version=1,
> error_correction=qrcode.constants.ERROR_CORRECT_L,
> box_size=10,
> border=1,
> )
> qr.add_data(ToQRData)
> qr.make(fit=True)
>
> # use an in-memory object to save
> output = StringIO.StringIO()
> img = qr.make_image()
> img.save(output)
>
> # and the use getvalue() method to get the string
> img_tag = '' %
> output.getvalue().encode('base64').replace('\n', '')
> return locals()
>
>
> On Tuesday, October 13, 2015 at 2:05:23 PM UTC-7, Fabiano Almeida wrote:
>>
>> Hi all!
>>
>> How to dynamically generate qr code in web2py?
>>
>> grateful,
>>
>> Fabiano.
>>
> --
> 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.
>

-- 
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: qrcode

2015-10-14 Thread Fabiano Almeida
Hi Niphlod,

I trying to generate qr code with built-in feature, for local use, mobile
for reading.

thx

2015-10-13 18:20 GMT-03:00 Niphlod :

> with any qrcode library or qrcode ondemand service out there ? What did
> you try ?
>
>
> On Tuesday, October 13, 2015 at 11:05:23 PM UTC+2, Fabiano Almeida wrote:
>>
>> Hi all!
>>
>> How to dynamically generate qr code in web2py?
>>
>> grateful,
>>
>> Fabiano.
>>
> --
> 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.
>

-- 
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: qrcode

2015-10-14 Thread Fabiano Almeida
Hi Stifan

I installed the semanticwebexample and not found reference to qr code on it.

thx

2015-10-13 18:28 GMT-03:00 黄祥 :

> i think there is web2py appliances that create some thing like this before
> : semanticwebexample
>
> best regards,
> stifan
>
> --
> 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.
>

-- 
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] qrcode

2015-10-13 Thread Fabiano Almeida
Hi all!

How to dynamically generate qr code in web2py?

grateful,

Fabiano.

-- 
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] Authenticate with Radius Server

2015-09-17 Thread Fabiano Almeida
Hi @ll!

I have an pfSense server with FreeRadius. Can I log in web2py app with
users from FreeRadius? How?

thx!

-- 
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] To display random questions one by one

2015-08-05 Thread Fabiano Almeida
Hi Sai,

Can you try this:

import  random

## first option to select question
s = number of lines of your table
i = random.randint(0,s)

## second option to select question - best: no broke if delete any record
on table
s = db(db.ins_ques.id > 0).select(db.ins_ques.id)
i = random.sample(s,1)

## how to query your question
question=db(db.ins_ques.id == i).select(db.ins_ques.ALL).first()

[...]


Fabiano.

2015-07-28 5:51 GMT-03:00 Sai Harsh Tondomker :

> I have trying to display random question for every login (Means client get
> different questions for every login).
> Here I gave my db.py and def doing paper. Please help me to solve the
> problem.
>
>
> db.define_table('ins_ques',
> Field('qnum','integer',notnull=True,readable=False,writable=False,label='Question
> Number'),
> Field('qupload','upload',label='Upload Image'),
> Field('question','text',notnull=True,label='Question'),
> Field('op1','string',notnull=True,label='Option A'),
> Field('op2','string',notnull=True,label='Option B'),
> Field('op3','string',notnull=True,label='Option C'),
> Field('op4','string',notnull=True,label='Option D'),
> Field('cor_ans',requires=IS_IN_SET(['A','B','C','D'],multiple=True),label='Correct
> Answer',widget=SQLFORM.widgets.checkboxes.widget)
> )
> db.define_table('ans_ques',
> Field('qdate','date',readable=False,writable=False,label='Date of Paper'),
> Field('qnum','integer',readable=False,writable=False),
> Field('studentid','integer',readable=False,writable=False),
>
> Field('answer','string',requires=IS_IN_SET(['A','B','C','D'],multiple=True),widget=SQLFORM.widgets.checkboxes.widget)
> )
> db.define_table('marks',
> Field('studentid',db.auth_user,requires=IS_IN_DB(db((db.auth_user.id==db.auth_membership.user_id)&(db.auth_membership.group_id==
>db.auth_group.id)&(db.auth_group.role=='students')),'auth_user.id
> ','auth_user.first_name'),readable=False,writable=False),
> Field('marks','integer'))
>
>
>
> def doing_paper():
> pid=auth.user_id
> q_num=int(request.vars.q_num)
> question=db((q_num==db.ins_ques.qnum)).select(db.ins_ques.ALL)
> val=db(db.ins_ques).select(db.ins_ques.ALL)
> rmax=0
> for f in val:
>   rmax+=1
> if (q_num <= 0):
> response.flash='This is the first question'
> q_num=1
> redirect(URL(r=request,f='doing_paper?q_num=%s') % (q_num) )
> elif (len(question) > 0) :
> for i in question:
> if i:
> question=i
> break
> else:
> q_num=q_num-1
> redirect(URL(r=request,f='preprocess?q_num=%s') % (q_num))
> else:
> q_num=q_num-1
> redirect(URL(r=request,f='preprocess?q_num=%s') % (q_num))
> if question:
> form=SQLFORM.factory(db.ans_ques)
> form.vars.qnum=q_num
> form.vars.studentid=pid
>
> answered=db((db.ans_ques.answer!='||')&(db.ans_ques.studentid==pid)).select(db.ans_ques.qnum)
> n=[]
> for k in answered:
> n.append(k['qnum'])
>
> ans_yet=db((db.ans_ques.studentid==pid)&(db.ans_ques.qnum==q_num)).select(db.ans_ques.answer)
> if(ans_yet and ans_yet[0]['answer']!='||'):
> form.vars.answer=ans_yet[0]['answer']
> if form.accepts(request.vars,session):
> if
> db((db.ans_ques.qnum==q_num)&(db.ans_ques.studentid==pid)).select(db.ans_ques.answer):
>
> db((db.ans_ques.qnum==q_num)&(db.ans_ques.studentid==pid)).update(answer=form.vars.answer)
> else:
> db.ans_ques.insert(answer=form.vars.answer,qnum=q_num,studentid=pid)
> q_num=q_num+1
> redirect(URL(r=request,f='doing_paper?q_num=%s') % (q_num))
> return locals()
>
> Regards
> Sai Harsh
>
> --
> 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.
>

-- 
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: module vs plugin

2015-07-17 Thread Fabiano Almeida
Thanks Vikash!

2015-07-15 14:15 GMT-03:00 Vikash Sharma :

> Module defines grouping logic at one place, the way you want to design it.
> Example, all customer database, order details, vendor details and
> respective operation are organised & implemented separately. Read more
> about cohesion and coupling on wiki
>
> Plugins is more like a features you can attach to your system or removed,
> if required. Now this plugin implementation might modularized within itself
> for better design. Example, you include features in eclipse ide as plugins.
> Another example would be: Lets say you are selling a base product to all
> your customer at a price X. Now, based on customer requirement, specify
> features/plugins can be added or attached to this base system.
>
>
>
> Regards,
> Vikash Sharma
> vikash0...@gmail.com
>
> On Wed, Jul 15, 2015 at 10:17 PM, Fabiano Almeida 
> wrote:
>
>> Hi Anthony,
>>
>> I think add plugins to build a system. Eg customer registration, product
>> registration, shopping trolley, service order, reports, etc.
>>
>> thks
>>
>> Fabiano.
>>
>> --
>> 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.
>>
>
>  --
> 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.
>

-- 
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: module vs plugin

2015-07-15 Thread Fabiano Almeida
Hi Anthony,

I think add plugins to build a system. Eg customer registration, product
registration, shopping trolley, service order, reports, etc.

thks

Fabiano.

-- 
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] module vs plugin

2015-07-15 Thread Fabiano Almeida
Hi @ll!

I think about modularize my aplication. Then the question is: module or
plugin? What's the difference?

Thanks!

Fabiano.

-- 
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: does every controller function require a view?

2015-06-24 Thread Fabiano Almeida
or init function name with double underscore:

def __test():
pass

the __ make function usable in your code, but not visible in browser.

Fabiano.

2015-06-23 15:30 GMT-03:00 Niphlod :

> if you plan to use functions in controllers that MAY NOT be seen by users,
> just define them with a parameter (a dummy one works fine)
>
> def this_function_is_accessible():
> pass
>
> def this_is_not_accessible(dummy=None):
> pass
>
>
> On Tuesday, June 23, 2015 at 7:27:42 PM UTC+2, Alex Glaros wrote:
>>
>> some functions are not viewed by user; they just return data to another
>> function.  Do those need a view?
>>
>> I ask because if it crashes, then user may see the raw view
>>
>> thanks
>>
>> Alex Glaros
>>
>  --
> 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.
>

-- 
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] Convert picture to pdf

2015-06-23 Thread Fabiano Almeida
Hi!

It's possible convert one or many pictures in unique pdf file in web2py?
USer select one or more pictures stored in app and download a pdf file with
selected images.

Thanks,

Fabiano.

-- 
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: How to register custom events in auth_event?

2015-06-11 Thread Fabiano Almeida
Great! Thanks a lot!

Fabiano.

2015-06-11 15:56 GMT-03:00 黄祥 :

> please take a look at this discussion :
> https://groups.google.com/forum/#!topic/web2py/sp4fpYz36HI
>
> best regards,
> stifan
>>
>>  --
> 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.
>

-- 
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: How to register custom events in auth_event?

2015-06-11 Thread Fabiano Almeida
origin = ''
description=''
db.auth_event.insert(time_stamp=request.now, client_ip=request.client, 
user_id=auth.user.id, origin=origin, description=description)

Em quinta-feira, 11 de junho de 2015 13:20:29 UTC-3, Fabiano Almeida 
escreveu:
>
> Hi @ll!
>
> After performing a specific operation system, I need the record in 
> auth_event. How to do?
>
> thanks in advance,
>
> Fabiano.
>

-- 
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] How to register custom events in auth_event?

2015-06-11 Thread Fabiano Almeida
Hi @ll!

After performing a specific operation system, I need the record in
auth_event. How to do?

thanks in advance,

Fabiano.

-- 
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] Redirect page after submit load form

2014-09-30 Thread Fabiano Almeida
Hello,

I am using the LOAD to load a SQLFORM.factory another function as test.
Works correctly, except that does the redirect that has the function call.

My code:

def index():
user = db(db.auth_user.id == auth.user.id).select().first()
if not user.job: form = LOAD('ponto', 'function1.load', ajax=True)
elif user.inloco: form = LOAD('ponto', 'function2.load', ajax=True)
else: form = LOAD('ponto', 'function3.load', ajax=True)
return dict(form=form)

def function1():
form = SQLFORM.factory(...)
if form.accepts(request,session):
(...code...)
redirect(URL('default', 'index')
elif form.errors:
response.flash="Try again"
else:
response.flash="Please, fill the form"
return dict(form=form)


def function2():
form = SQLFORM.factory(...)
if form.accepts(request,session):
(...code...)
redirect(URL('default', 'index')
elif form.errors:
response.flash="Try again"
else:
response.flash="Please, fill the form"
return dict(form=form)


def function3():
form = SQLFORM.factory(...)
if form.accepts(request,session):
(...code...)
redirect(URL('default', 'index')
elif form.errors:
response.flash="Try again"
else:
response.flash="Please, fill the form"
return dict(form=form)

How to redirect after  submit?

Thanks in advance,

Fabiano.

-- 
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] foreign key constraint failed

2014-09-24 Thread Fabiano Almeida
If your table definitions are right, try delete database and run your app
again...

2014-09-22 18:01 GMT-03:00 Anna Kostikova :

> Hi everyone,
>
> I am having an issue when editing content of one of the tables in my
> database. When I try to edit a record in the table I have an error message
> " foreign key constraint failed". The
> bizarre thing is that it doesn't matter which column I am trying to edit
> (via appadmin control panel) - i have exactly same message. For instance, I
> have a column "description" that doesn't have any keys on it (or
> references), but I can't edit the content of this field and I keep getting
> the error above.
>
> What might be causing the issue?
> I am using python 2.7.7 and web2py 2.9.5
>
> Thanks
> Anna
>
> --
> 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.
>

-- 
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] SQLFORM.factory fails to save to database, id is null

2014-09-24 Thread Fabiano Almeida
try:

db.table.insert(f_name=form.vars.f_name)

2014-09-23 6:10 GMT-03:00 Andy Joel :

> I have a very simple form processing page in my controller:
>
> def new():
> form = SQLFORM.factory(
> Field('f_name', label='Your name', requires=IS_NOT_EMPTY()),
> )
> if form.process().accepted:
> db.table.insert(**form.vars)
> response.flash = 'form accepted'
> elif form.errors:
> response.flash = 'form has errors'
> else:
> response.flash = 'please fill the form'
> return dict(form=form)
>
> If I leave the form blank, it says there are errors, I fill it in, it says
> the form is accepted. But it fails to update the database, giving this
> error:
>
>  null value in column "id" violates
> not-null constraint DETAIL: Failing row contains (null, Boris, T,
> 2014-09-23 10:03:30, 11, 2014-09-23 10:03:30, 11).
> What is curious is that I have used this successfully to populate the
> table:
> db.table.insert(f_name='Mary')
>
> I am guessing form.vars includes a value for ID, and Web2Py is trying to
> write this to the database (postgreSQL by the way), rather than allowing
> the database to assign a value, and so the database objects.
>
> Looks like it may be a bug, but I may well be missing something.
>
> --
> 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.
>

-- 
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] Recompute all instances of a computed field

2014-07-10 Thread Fabiano Almeida
Hi Johann,

I recently update manually compute field. You have presented a better way,
and still counter to monitor the process. Very nice!

Congratulations!

Fabiano.


2014-07-10 10:39 GMT-03:00 Johann Spies :

> Sorry, I sent it before finishing
>
>
> #!/usr/bin/python
> # -*- coding: utf-8 -*-
> rows = db(db.urlop.id > 0).select(db.urlop.ilosc_dni,
> db.termin_od, db.termin_do)
> howmany = len(rows)
> busy_with = 0
> for row in rows:
>  busywith += 1
>  print 'busy with %d of %d' % (busywith, howmany)
>  row.update_record(ulosc_dni = db.urlop.ulosc_dni.compute(row))
> db.commit()
>
>
> Regards
> Johann
>
>> --
>> Because experiencing your loyal love is better than life itself,
>> my lips will praise you.  (Psalm 63:3)
>>
>
>
>
> --
> Because experiencing your loyal love is better than life itself,
> my lips will praise you.  (Psalm 63:3)
>
> --
> 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.
>

-- 
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: Virtual Fields in auth_user?

2014-07-10 Thread Fabiano Almeida
Hi Massimo,

I tried this:

auth.settings.extra_fields['auth_user']= [
...
Field('dept_grid', compute = lambda row:
Departamento[row['departamento_id']].nome if row['departamento_id'] else
None, label = 'Departamento'),
Field.Virtual('dept_name', lambda row:
Departamento[row.departamento_id].nome if row.departamento_id else None,
label = 'Departamento')]

The compute field work, the virtual field does not work. And the error by
calling the table in SQLFORM.grid:

AttributeError: 'Row' object has no attribute 'dept_name'


Can I use virtual field to display information from another table?

Thanks,

Fabiano.


2014-07-10 3:55 GMT-03:00 Massimo Di Pierro :

> auth.settings.extra_fields['auth_user'] = [Field.Virtual(), ... ]
>
>
> On Wednesday, 9 July 2014 13:14:14 UTC-5, Fabiano Almeida wrote:
>>
>> Hi again,
>>
>> It's possible insert virtual field in auth_user? how?
>>
>> thanks,
>>
>> Fabiano.
>>
>  --
> 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.
>

-- 
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: How to mark mandatory fields in SQLFORM.grid?

2014-07-09 Thread Fabiano Almeida
Hi Anthony,

Great plugin!

Thanks,

Fabiano.


2014-07-09 18:15 GMT-03:00 Anthony :

> There is also this plugin, which automates the process based on field
> validators: http://dev.s-cubism.com/plugin_notemptymarker
>
> Anthony
>
>
> On Wednesday, July 9, 2014 5:12:57 PM UTC-4, Anthony wrote:
>>
>> You can do something like this in your models:
>>
>> required = SPAN('* required', _class='required')
>>
>> db.define_table('mytable', Field('myfield', comment=required))
>>
>> Use CSS to style the comment (e.g., make the text red).
>>
>> Anthony
>>
>> On Wednesday, July 9, 2014 4:08:00 PM UTC-4, Fabiano Almeida wrote:
>>>
>>> Hi @all!
>>>
>>> I am using SQLFORM.grid extensively in my application. How to visually
>>> mark the required fields on the form when the user adds record?
>>>
>>> Thanks in advance,
>>>
>>> Fabiano.
>>>
>>  --
> 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.
>

-- 
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] How to mark mandatory fields in SQLFORM.grid?

2014-07-09 Thread Fabiano Almeida
Hi @all!

I am using SQLFORM.grid extensively in my application. How to visually mark 
the required fields on the form when the user adds record?

Thanks in advance,

Fabiano.

-- 
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] Virtual Fields in auth_user?

2014-07-09 Thread Fabiano Almeida
Hi again,

It's possible insert virtual field in auth_user? how?

thanks,

Fabiano.

-- 
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: help with join

2014-07-09 Thread Fabiano Almeida
Great Leonel!

Thanks a lot!

Fabiano.


2014-07-09 13:31 GMT-03:00 Leonel Câmara :

> list_of_users_in_all_groups = db( (db.auth_membership.group_id.belongs([2,
> 3, 4])) & (db.auth_membership.userd_id == db.auth_user.id)
> ).select(db.auth_user.ALL)
>
> --
> 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.
>

-- 
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] help with join

2014-07-09 Thread Fabiano Almeida
Hi,

I'm trying to do a join table auth_user and auth_membership. I need the
list of users with membership.group_id in [2,3,4].

I tried to create a query for membership before the join, but it did not
work.

Is to make this join? How?

Thanks in advance,

Fabiano.

-- 
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: query with multiple values

2014-07-09 Thread Fabiano Almeida
Hi Leonel,

belongs solve my question.

Thanks.

Fabiano.


2014-07-09 13:02 GMT-03:00 Leonel Câmara :

> q = db(db.auth_membership.group_id.belongs([2,3,4]).select()
>
> Also see:
>
> http://www.web2py.com/books/default/chapter/29/06/the-database-abstraction-layer#belongs
>
> --
> 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.
>

-- 
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] query with multiple values

2014-07-09 Thread Fabiano Almeida
Hi Vinicius,

I tested it contains, but it did not work with integer field.

Thanks,

Fabiano.


2014-07-09 12:55 GMT-03:00 Vinicius Assef :

> Use contains [1].
>
> [1]
> http://web2py.com/books/default/chapter/29/06/the-database-abstraction-layer#like--regexp--startswith--endswith--contains--upper--lower
>
> On Wed, Jul 9, 2014 at 12:47 PM, Fabiano Almeida 
> wrote:
> > Hi,
> >
> > How to make a query with multiple values to field?
> >
> >
> > q = db(db.auth_membership.group_id in [2,3,4]).select()
> >
> > thanks,
> >
> > Fabiano.
> >
> > --
> > 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.
>
> --
> 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.
>

-- 
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: SQLEDITABLE: redirect after submit

2014-07-09 Thread Fabiano Almeida
Thanks Kato!

Fabiano.


2014-07-09 9:24 GMT-03:00 'kato' via web2py-users :

> I was a little wrong. If you want to redirect, and will not work because
> such in the ajax.
> Please write as the following.
>
> def demo050():
> response.title = 'demo050'
> response.view = 'plugin_sqleditable/sample.html'
> editable = SQLEDITABLE(db.employee_sheet, showid=False, maxrow=5,
> deletable=True).process(next=URL('static', 'success.html'))
> return dict(editable=editable)
>
>
>
> 2014年7月9日水曜日 8時52分21秒 UTC-3 kato:
>
>> Hi.
>>
>> You can write same as SQLFORM.
>>
>> example.
>> def demo070():
>> response.title = 'demo070'
>> response.view = 'plugin_sqleditable/sample.html'
>> editable = SQLEDITABLE(db.employee_sheet, showid=False, maxrow=5)
>> if editable.accepts(request.vars, session):
>> response.flash = T('editable accepted')
>> elif editable.errors:
>> response.flash = T('editable has errors')
>> else:
>> response.flash = T('please fill out the editable')
>> return dict(editable=editable)
>>
>> def demo071():
>> response.title = 'demo071'
>> response.view = 'plugin_sqleditable/sample.html'
>> editable = SQLEDITABLE(db.employee_sheet, showid=False, maxrow=5)
>> if editable.process().accepted:
>> response.flash = T('editable accepted')
>> elif editable.errors:
>> response.flash = T('editable has errors')
>> else:
>> response.flash = T('please fill out the editable')
>> return dict(editable=editable)
>>
>> 2014年7月8日火曜日 20時00分59秒 UTC-3 Fabiano Almeida:
>>>
>>> Hi,
>>>
>>> Has like 'accepted' attribute in SQLEDITABLE?
>>>
>>> I need redirect to other page after 'ok' click.
>>>
>>> Thanks,
>>>
>>> Fabiano.
>>>
>>  --
> 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.
>

-- 
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] query with multiple values

2014-07-09 Thread Fabiano Almeida
Hi,

How to make a query with multiple values to field?


q = db(db.auth_membership.group_id in [2,3,4]).select()

thanks,

Fabiano.

-- 
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: SQLEDITABLE: redirect after submit

2014-07-09 Thread Fabiano Almeida
Hi Kato,

Thanks again!!

Fabiano.


2014-07-09 8:52 GMT-03:00 'kato' via web2py-users :

> Hi.
>
> You can write same as SQLFORM.
>
> example.
> def demo070():
> response.title = 'demo070'
> response.view = 'plugin_sqleditable/sample.html'
> editable = SQLEDITABLE(db.employee_sheet, showid=False, maxrow=5)
> if editable.accepts(request.vars, session):
> response.flash = T('editable accepted')
> elif editable.errors:
> response.flash = T('editable has errors')
> else:
> response.flash = T('please fill out the editable')
> return dict(editable=editable)
>
> def demo071():
> response.title = 'demo071'
> response.view = 'plugin_sqleditable/sample.html'
> editable = SQLEDITABLE(db.employee_sheet, showid=False, maxrow=5)
> if editable.process().accepted:
> response.flash = T('editable accepted')
> elif editable.errors:
> response.flash = T('editable has errors')
> else:
> response.flash = T('please fill out the editable')
> return dict(editable=editable)
>
> 2014年7月8日火曜日 20時00分59秒 UTC-3 Fabiano Almeida:
>
>> Hi,
>>
>> Has like 'accepted' attribute in SQLEDITABLE?
>>
>> I need redirect to other page after 'ok' click.
>>
>> Thanks,
>>
>> Fabiano.
>>
>  --
> 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.
>

-- 
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: SQLEDITABLE: redirect after submit

2014-07-09 Thread Fabiano Almeida
Hi Samurai,

I tried other way: use 2 buttons: sqleditable submit to save grid, then a
second button to process new data and redirect to other page. I think this
is not the best way...

Fabiano.


2014-07-09 5:33 GMT-03:00 samurai :

> If u have got the answer then please share with us also.
>
>
> On Wednesday, July 9, 2014 4:30:59 AM UTC+5:30, Fabiano Almeida wrote:
>>
>> Hi,
>>
>> Has like 'accepted' attribute in SQLEDITABLE?
>>
>> I need redirect to other page after 'ok' click.
>>
>> Thanks,
>>
>> Fabiano.
>>
>  --
> 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.
>

-- 
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] SQLEDITABLE: redirect after submit

2014-07-08 Thread Fabiano Almeida
Hi,

Has like 'accepted' attribute in SQLEDITABLE?

I need redirect to other page after 'ok' click.

Thanks,

Fabiano.

-- 
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: SQLEDITABLE : writable=False dosen't work

2014-07-08 Thread Fabiano Almeida
Sorry, my fault  I configured writable = False for wrong field o.O

thanks,

Fabiano.


Em terça-feira, 8 de julho de 2014 18h16min06s UTC-3, Fabiano Almeida 
escreveu:
>
> Hi!,
>
> I'm trying to use SQLEDITABLE plugin with readable and writable attributes.
>
> readable = False, hide the field. OK.
>
> writable = False, the field remains editable.
>
> How to leave only a few editable fields?
>
> Thanks,
>
> Fabiano.
>

-- 
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] SQLEDITABLE : writable=False dosen't work

2014-07-08 Thread Fabiano Almeida
Hi!,

I'm trying to use SQLEDITABLE plugin with readable and writable attributes.

readable = False, hide the field. OK.

writable = False, the field remains editable.

How to leave only a few editable fields?

Thanks,

Fabiano.

-- 
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] SQLEDITABLE plugin

2014-07-07 Thread Fabiano Almeida
Thanks Kato!!!

Now I get it!!


2014-07-07 8:30 GMT-03:00 kato :

> I will add a postscript. you can write as below.
>
> def demo031():
> def record():
> rows = db(db.employee_sheet.resigned == True).select(limitby=(0,3))
> return [row.id for row in rows.sort(lambda
> row:row.employee_number)]
>
> response.title = 'demo030'
> response.view = 'plugin_sqleditable/sample.html'
> editable = SQLEDITABLE(db.employee_sheet,
> record=record(),showid=False,
>
> maxrow=5).process()
> return dict(editable=editable)
>
> If you use "primarykey" and multiple key fields, you need to write list of
> list in "record" parameter.
>
>
> 2014-07-07 5:51 GMT-03:00 'kato' via web2py-users  >:
>
>> Hi fabiano.
>>
>> It is not possible to pass a query currently.
>> But "record" parameter is so callable, please set there.
>> Please see to the demo5
>> <http://docs1.erp2py.com/sqleditable/demo/demo_en.html#demo5> .
>>
>> thanks.
>>
>> 2014年7月6日日曜日 15時19分04秒 UTC-3 Fabiano Almeida:
>>>
>>> Hi kato!
>>>
>>> How to use SQLEDITABLE with a query?
>>>
>>> If I try this in your first example:
>>>
>>> query = db.employee_sheet.resigned == True
>>> editable = SQLEDITABLE(query, showid=False, maxrow=5).process()
>>>
>>> Return error:
>>>
>>>
>>> AttributeError: 'Query' object has no attribute '_id'
>>>
>>> How to filter table?
>>>
>>> Thanks,
>>>
>>> Fabiano
>>>
>>>
>>>
>>> 2014-07-01 10:12 GMT-03:00 'kato' via web2py-users <
>>> web...@googlegroups.com>:
>>>
>>>> Hi.
>>>>
>>>> I tried to make SQLEDITABLE plugin.
>>>>
>>>> demo-page: http://docs1.erp2py.com/sqleditable/demo/demo_en.html
>>>>
>>>> It is similar as gluon/contrib/spreadsheet. But, it is easy to use more.
>>>> If you are interested, please try.
>>>>
>>>> Thanks.
>>>>
>>>> --
>>>> 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.
>>>>
>>>
>>>  --
>> 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/PQE1JJwv0Bc/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.
>

-- 
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] SQLEDITABLE plugin

2014-07-06 Thread Fabiano Almeida
Hi kato!

How to use SQLEDITABLE with a query?

If I try this in your first example:

query = db.employee_sheet.resigned == True
editable = SQLEDITABLE(query, showid=False, maxrow=5).process()

Return error:


AttributeError: 'Query' object has no attribute '_id'

How to filter table?

Thanks,

Fabiano



2014-07-01 10:12 GMT-03:00 'kato' via web2py-users 
:

> Hi.
>
> I tried to make SQLEDITABLE plugin.
>
> demo-page: http://docs1.erp2py.com/sqleditable/demo/demo_en.html
>
> It is similar as gluon/contrib/spreadsheet. But, it is easy to use more.
> If you are interested, please try.
>
> Thanks.
>
> --
> 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.
>

-- 
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] How to choose a subcategory to create a post

2014-07-04 Thread Fabiano Almeida
Can you try use plugin:
http://dev.s-cubism.com/plugin_lazy_options_widget


2014-07-03 6:53 GMT-03:00 Капылов Данил :

> 1) Post created in a particular category. -
> http://hostname/app/default/created_ad/
>
> 2)The category tied subcategories.
>
> How to make that SQLFORM display only radio button of equal sub
> categories. Not show subcategories not belong to this category.
>
>
> 
>
>
> def get_category():
> category_url_name = request.args(0)
> category = db.category(url_name=category_url_name)
> if not category:
> session.flash = 'page not fount'
> redirect(URL('index'))
> return category
>
> def created_ad():
> category = get_category()
> db.ad_post.category.default = category.id
>* form = SQLFORM(db.ad_post).process(next='view_post/[id]')*
> return locals()
>
>
> db.define_table('ad_post',
> Field('category', 'reference category'),
>* Field('subcategory', 'reference subcategory',
> widget=SQLFORM.widgets.radio.widget,*
> *  requires=IS_IN_DB(db, db.subcategory.id
> , label='db.category.name
> ')),*
> Field('title', type='string', requires=IS_NOT_EMPTY()),
> Field('body', type='text', requires=IS_NOT_EMPTY()),
> auth.signature
> )
>
> --
> 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.
>

-- 
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] create an update page (similar to profile page in default application)

2014-07-02 Thread Fabiano Almeida
Need convert request to int:
int(request.post_vars.pid)

Fabiano.


2014-07-02 8:05 GMT-03:00 Shubham Jain :

> I want to create an update page just like profile page in default
> application. Actually I am passing the primary key of a table by a button
> click to the product_update page. In the controller of the update page I
> tried these 2 codes.
>
> def product_edit():
> db.products.product_id.writable=FALSE   # to make product_id
> non editable
> db.products.product_id.readable=TRUE
> testform =
> SQLFORM(db.products,db(db.products.product_id==request.post_vars.pid).select(),
>  fields=['product_id','price','pro_type','tags','category','description']))
> return dict(form=testform)
>
>
>  
> --OR-
>
> dform =
> SQLFORM(db.products,record=db(db.products.product_id==request.post_vars.pid).select(),
> fields=['product_id','price','pro_type','tags','category','description'])
> return dict(form=dform)
>
>   pid - name of the input which has the product_id.
> But these don't work.
>
> Error Generated: TypeError: list indices must be integers, not str
>
>  --
> 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.
>

-- 
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] SQLEDITABLE plugin

2014-07-01 Thread Fabiano Almeida
Very Nice!

Thank you very much!


2014-07-01 10:12 GMT-03:00 'kato' via web2py-users 
:

> Hi.
>
> I tried to make SQLEDITABLE plugin.
>
> demo-page: http://docs1.erp2py.com/sqleditable/demo/demo_en.html
>
> It is similar as gluon/contrib/spreadsheet. But, it is easy to use more.
> If you are interested, please try.
>
> Thanks.
>
> --
> 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.
>

-- 
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: lambda cannot contain assignment

2014-06-13 Thread Fabiano Almeida
Hi Anthony,

It worked! Now I understand better how to use callback.

Thank you very much!!

Fabiano.

2014-06-12 16:13 GMT-03:00 Anthony :

> lambda qset, f:
> f.update(cadastro=request.now if f['status'] in ['Edição', 'Enviado']
> else None)

-- 
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] lambda cannot contain assignment

2014-06-12 Thread Fabiano Almeida
Hi,

In a table I need to change the field value (name: cadastro, type:
datetime) to request.now depending on the value assigned to another field
(name: status) of the same record.

I thought of using the _before_update callbcak for this purpose:

db.solicitacao._before_update.append(lambda f: f.cadastro=request.now if
(f.status == 'Edição') or (f.status =='Enviado') else None)

Thus returns the message "*lambda cannot contain assignment*"

Any suggestions?

Thanks in advance,

Fabiano.

-- 
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] Uploading a Package

2014-06-11 Thread Fabiano Almeida
Hi,

If you have application in tgz, unpack and copy to
web2py_folder/application/your_application.


2014-06-10 6:26 GMT-03:00 Priyank Yadav :

> Hello,
> I am new to web2py. Somebody sent me a tgz file which contained the source
> code.
> I am trying to upload thar code in my admin interface but first i have to
> convert that into w2p extension...
> Help
> Thank you
>
> --
> 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.
>

-- 
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] create a link SQLFORM to another table with id.belongs

2014-06-09 Thread Fabiano Almeida
Hi,

Good!

db.table1.id.default = session.table1.id
>

This line is used to insert new record automatically by SQLFORM. For the id
field is unnecessary, it is useful when you want to set a default value, eg
FK.

All beers!!

-- 
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] create a link SQLFORM to another table with id.belongs

2014-06-09 Thread Fabiano Almeida
My db.py:


Almoxarifado = db.define_table('almoxarifado', Field('name'))

Objeto = db.define_table('objeto', Field('name'), Field('almoxarifado_id',
db.almoxarifado))
Objeto.almoxarifado_id.requires=IS_IN_DB(db, 'almoxarifado.id', '%(nome)s')



2014-06-09 17:09 GMT-03:00 LoveWeb2py :

> Hi Fabiano,
>
> I'm still trying to get this
>
> For your Objeto.almoxarifado_id.default = session.almoxarifado
>
> Shouldn't there be a db.Objeto.almoxarifado_id ? If I try to just put
> table2.id I get an error saying table2 isn't defined.
>
> Here is what I have so far
>
> def query_table2():
>table1_inv_record = None
>
>table2_records = []
>table1_inv_record = request.args(0)
>row = db(db.table1.id==table1_inv_record).select()
>for line in row:
>   joined_records = line.inv_id
>if table1_inv_record:
>  inv1_record = int(table1_inv_record)
>  session.table1_id = inv1_record
>query=db.table1.id.belongs(joined_records)
>db.table1.id.default = session.table1.id
>grid=SQLFORM.grid(query, user_signature=False)
>return dict(grid=grid)
>
> Still getting the same error though
>
> My db.model is like this: db.define_table('table2',
> Field('table1_inv_record', 'list:integer')
>
>  --
> 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.
>

-- 
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] create a link SQLFORM to another table with id.belongs

2014-06-09 Thread Fabiano Almeida
def query_table2():
   table1_inv_record = None
   table2_records = []
   if request.args:
  try:
 session.table1_id = int(request.args(0))
  except:
 pass
   row = db(db.table1.id==session.table1_id).select()
   for line in row:
  joined_records = line.inv_id
   query=db.table1.id.belongs(joined_records)
   db.table1.id.default = session.table1_id
   grid=SQLFORM.grid(query, user_signature=False)
   return dict(grid=grid)


2014-06-09 17:09 GMT-03:00 LoveWeb2py :

> Hi Fabiano,
>
> I'm still trying to get this
>
> For your Objeto.almoxarifado_id.default = session.almoxarifado
>
> Shouldn't there be a db.Objeto.almoxarifado_id ? If I try to just put
> table2.id I get an error saying table2 isn't defined.
>
> Here is what I have so far
>
> def query_table2():
>table1_inv_record = None
>
>table2_records = []
>table1_inv_record = request.args(0)
>row = db(db.table1.id==table1_inv_record).select()
>for line in row:
>   joined_records = line.inv_id
>if table1_inv_record:
>  inv1_record = int(table1_inv_record)
>  session.table1_id = inv1_record
>query=db.table1.id.belongs(joined_records)
>db.table1.id.default = session.table1.id
>grid=SQLFORM.grid(query, user_signature=False)
>return dict(grid=grid)
>
> Still getting the same error though
>
> My db.model is like this: db.define_table('table2',
> Field('table1_inv_record', 'list:integer')
>
>  --
> 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.
>

-- 
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] create a link SQLFORM to another table with id.belongs

2014-06-09 Thread Fabiano Almeida
Objeto it's the table

almoxarifado_id it's a FK (reference field)


2014-06-09 14:48 GMT-03:00 LoveWeb2py :

> No problem at all and I appreciate you trying to respond to English.
>
> Is Object your table name and Almoxarifado_id is your id field in Objeto?
>
> Objeto.almoxarifado_id
>
>
> On Monday, June 9, 2014 1:30:49 PM UTC-4, Fabiano Almeida wrote:
>
>> Hi,
>>
>> Sorry for my poor english, by lazy, sometimes I use google translate
>> (portuguese -> english), and don't check the translation.
>>
>> table1_inv_record = request.args(0)
>>
>> In this line you get de first args, but on click to edit record in grid,
>> the function it's called again and url change args, then first args in url
>> is 'edit', and this is literal, not numerical.
>>
>> row = db(db.table1.id==table1_inv_record).select()
>>
>> In edit mode (and changed url), get error because var table1_inv_record
>> is not numerical at this time. I think this is a line in your traceback
>> error.
>>
>> So I use try...except block to convert first arg in integer, if ok, use
>> session to store de right id sent in the original url.
>>
>>> alm = None # this is for prevent error case haven't args(0)
>>> if request.args: alm = request.args(0)
>>>   try:
>>>   if alm:
>>>   alm = int(alm)
>>>   *session.almoxarifado*=alm# this line executes only if
>>> the previous line no error
>>>   except ValueError:
>>>   pass
>>> Objeto.almoxarifado_id.default = *session.almoxarifado*
>>
>>
>>
>>
>>
>>
>> 2014-06-09 13:47 GMT-03:00 LoveWeb2py :
>>
>> Hi Fabiano,
>>>
>>> Thank you for your reply. What do you mean by *"edit the registry of
>>> URL arguments are changed. "*
>>>
>>> Here is my code:
>>> def query_table2():
>>>table2_records = []
>>>    table1_inv_record = request.args(0)
>>>row = db(db.table1.id==table1_inv_record).select()
>>>for line in row:
>>>   joined_records = line.inv_id
>>>query=db.table1.id.belongs(joined_records)
>>>grid=SQLFORM.grid(query, user_signature=False)
>>>return dict(grid=grid)
>>>
>>> view for query_table2.html:
>>>{{=grid}}
>>>
>>>
>>>
>>> On Friday, June 6, 2014 3:43:12 PM UTC-4, Fabiano Almeida wrote:
>>>
>>>>  invalid literal for int() with base 10:
>>>> 'edit'
>>>>
>>>> In some part of your code has converting string to numeric type.
>>>> Probably you should be picking up the URL argument and doing the
>>>> conversion, but when you edit the registry of URL arguments are changed.
>>>>
>>>> In my example, I use session and try...except to resolve this.
>>>>
>>>>
>>>>
>>>> 2014-06-06 15:29 GMT-03:00 Fabiano Almeida :
>>>>
>>>>> Show your code
>>>>>
>>>>>
>>>>> 2014-06-06 15:18 GMT-03:00 LoveWeb2py :
>>>>>
>>>>> Now I get this error when I try to click edit on the query database:
>>>>>>
>>>>>>  invalid literal for int() with base
>>>>>> 10: 'edit'
>>>>>>
>>>>>> I've tried changing signature to false, but I don't think thats the
>>>>>> problem.
>>>>>>
>>>>>>
>>>>>> On Friday, June 6, 2014 1:17:39 PM UTC-4, LoveWeb2py wrote:
>>>>>>
>>>>>>> yes
>>>>>>>
>>>>>>>
>>>>>>> On Fri, Jun 6, 2014 at 1:09 PM, Fabiano Almeida <
>>>>>>> fab...@techno7.com.br> wrote:
>>>>>>>
>>>>>>>> Are you logged in your app?
>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> On Friday, June 6, 2014 1:03:35 PM UTC-4, Fabiano Almeida wrote:
>>>>>>>>>>
>>>>>>>>>> Try:
>>>>>>>>>>
>>>>>>>>>> grid = SQLFORM.grid(db.table,  user_signature=False)
>>>>>>>>>>
>>>>>>>>>> Em sexta-feira, 6 de junho de 2014 13h10min34s UTC-3, LoveWeb2py
>>>>>>>>>> escreveu:
>>>>>>

Re: [web2py] Re: Adding information to certain input before added to db?

2014-06-09 Thread Fabiano Almeida
Other way is before and after callbacks
http://web2py.com/books/default/chapter/29/06/the-database-abstraction-layer#before-and-after-callbacks

If necessary, you can call function:
db.table1._before_insert.append( lambda f: my_function(f))

This way you do not need to manually enter the registry


2014-06-07 13:19 GMT-03:00 Anthony :

> Aside from the code below, somewhat simpler approaches would be to
> manipulate request.post_vars *before* calling SQLFORM, or using an
> onvalidation function (which allows you to change form.vars after
> validation but before the db insert). With those approaches, you don't have
> to manually do the db insert.
>
>
> On Friday, June 6, 2014 11:02:21 PM UTC-4, 黄祥 wrote:
>>
>> i think you can achieve it using form.validate :
>> e.g.
>> def booking():
>> form = SQLFORM(db.booking_header)
>> if form.validate():
>> db.booking_header.insert(booking_date = form.vars.booking_date,
>>  buyer = form.vars.buyer,
>>  notes = form.vars.notes)
>>
>
> Note, to avoid having to explicitly list each field, you can simply do:
>
> db.booking_header.insert(**db.booking_header._filter_fields(form.vars
> ))
>
> That will insert all the fields in form.vars that belong to
> db.booking_header.
>
> Anthony
>
>
>> redirect(URL('report', 'report_booking') )
>> return dict(form = form)
>>
>> ref :
>> http://web2py.com/books/default/chapter/29/07/forms-and-validators
>>
>> best regards,
>> stifan
>>
>  --
> 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.
>

-- 
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] create a link SQLFORM to another table with id.belongs

2014-06-09 Thread Fabiano Almeida
Hi,

Sorry for my poor english, by lazy, sometimes I use google translate
(portuguese -> english), and don't check the translation.

table1_inv_record = request.args(0)

In this line you get de first args, but on click to edit record in grid,
the function it's called again and url change args, then first args in url
is 'edit', and this is literal, not numerical.

row = db(db.table1.id==table1_inv_record).select()

In edit mode (and changed url), get error because var table1_inv_record is
not numerical at this time. I think this is a line in your traceback error.

So I use try...except block to convert first arg in integer, if ok, use
session to store de right id sent in the original url.

> alm = None # this is for prevent error case haven't args(0)
> if request.args: alm = request.args(0)
>   try:
>   if alm:
>   alm = int(alm)
>   *session.almoxarifado*=alm# this line executes only if the
> previous line no error
>   except ValueError:
>   pass
> Objeto.almoxarifado_id.default = *session.almoxarifado*






2014-06-09 13:47 GMT-03:00 LoveWeb2py :

> Hi Fabiano,
>
> Thank you for your reply. What do you mean by *"edit the registry of URL
> arguments are changed. "*
>
> Here is my code:
> def query_table2():
>table2_records = []
>table1_inv_record = request.args(0)
>row = db(db.table1.id==table1_inv_record).select()
>for line in row:
>   joined_records = line.inv_id
>query=db.table1.id.belongs(joined_records)
>grid=SQLFORM.grid(query, user_signature=False)
>return dict(grid=grid)
>
> view for query_table2.html:
>{{=grid}}
>
>
>
> On Friday, June 6, 2014 3:43:12 PM UTC-4, Fabiano Almeida wrote:
>
>>  invalid literal for int() with base 10:
>> 'edit'
>>
>> In some part of your code has converting string to numeric type. Probably
>> you should be picking up the URL argument and doing the conversion, but
>> when you edit the registry of URL arguments are changed.
>>
>> In my example, I use session and try...except to resolve this.
>>
>>
>>
>> 2014-06-06 15:29 GMT-03:00 Fabiano Almeida :
>>
>>> Show your code
>>>
>>>
>>> 2014-06-06 15:18 GMT-03:00 LoveWeb2py :
>>>
>>> Now I get this error when I try to click edit on the query database:
>>>>
>>>>  invalid literal for int() with base 10:
>>>> 'edit'
>>>>
>>>> I've tried changing signature to false, but I don't think thats the
>>>> problem.
>>>>
>>>>
>>>> On Friday, June 6, 2014 1:17:39 PM UTC-4, LoveWeb2py wrote:
>>>>
>>>>> yes
>>>>>
>>>>>
>>>>> On Fri, Jun 6, 2014 at 1:09 PM, Fabiano Almeida >>>> > wrote:
>>>>>
>>>>>> Are you logged in your app?
>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> On Friday, June 6, 2014 1:03:35 PM UTC-4, Fabiano Almeida wrote:
>>>>>>>>
>>>>>>>> Try:
>>>>>>>>
>>>>>>>> grid = SQLFORM.grid(db.table,  user_signature=False)
>>>>>>>>
>>>>>>>> Em sexta-feira, 6 de junho de 2014 13h10min34s UTC-3, LoveWeb2py
>>>>>>>> escreveu:
>>>>>>>>>
>>>>>>>>> Hi Fabiano,
>>>>>>>>>
>>>>>>>>> I actually was already using grid= SQLFORM.grid(db.new_table).
>>>>>>>>> That is when I get the error.
>>>>>>>>>
>>>>>>>>> If I do grid='' to test it and just return the table without
>>>>>>>>> SQLFORM I can see it in the view, but when I apply SQLFORM I get the 
>>>>>>>>> error
>>>>>>>>> 'Rows' object has no attribute '_db'.
>>>>>>>>>
>>>>>>>>> I'm guessing this is because of the way SQLFORM handles the grid?
>>>>>>>>> Could there be something in  my model messing it up?
>>>>>>>>>
>>>>>>>>> On Friday, June 6, 2014 12:02:05 PM UTC-4, Fabiano Almeida wrote:
>>>>>>>>>>
>>>>>>>>>> Hi,
>>>>>>>>>>
>>>>>>>>>> You send var grid (see: return dict(grid=grid)). The first var
>>>>>>>>>>

Re: [web2py] create a link SQLFORM to another table with id.belongs

2014-06-06 Thread Fabiano Almeida
 invalid literal for int() with base 10:
'edit'

In some part of your code has converting string to numeric type. Probably
you should be picking up the URL argument and doing the conversion, but
when you edit the registry of URL arguments are changed.

In my example, I use session and try...except to resolve this.



2014-06-06 15:29 GMT-03:00 Fabiano Almeida :

> Show your code
>
>
> 2014-06-06 15:18 GMT-03:00 LoveWeb2py :
>
> Now I get this error when I try to click edit on the query database:
>>
>>  invalid literal for int() with base 10:
>> 'edit'
>>
>> I've tried changing signature to false, but I don't think thats the
>> problem.
>>
>>
>> On Friday, June 6, 2014 1:17:39 PM UTC-4, LoveWeb2py wrote:
>>
>>> yes
>>>
>>>
>>> On Fri, Jun 6, 2014 at 1:09 PM, Fabiano Almeida 
>>> wrote:
>>>
>>>> Are you logged in your app?
>>>>
>>>>>
>>>>>
>>>>> On Friday, June 6, 2014 1:03:35 PM UTC-4, Fabiano Almeida wrote:
>>>>>>
>>>>>> Try:
>>>>>>
>>>>>> grid = SQLFORM.grid(db.table,  user_signature=False)
>>>>>>
>>>>>> Em sexta-feira, 6 de junho de 2014 13h10min34s UTC-3, LoveWeb2py
>>>>>> escreveu:
>>>>>>>
>>>>>>> Hi Fabiano,
>>>>>>>
>>>>>>> I actually was already using grid= SQLFORM.grid(db.new_table). That
>>>>>>> is when I get the error.
>>>>>>>
>>>>>>> If I do grid='' to test it and just return the table without SQLFORM
>>>>>>> I can see it in the view, but when I apply SQLFORM I get the error 
>>>>>>> 'Rows'
>>>>>>> object has no attribute '_db'.
>>>>>>>
>>>>>>> I'm guessing this is because of the way SQLFORM handles the grid?
>>>>>>> Could there be something in  my model messing it up?
>>>>>>>
>>>>>>> On Friday, June 6, 2014 12:02:05 PM UTC-4, Fabiano Almeida wrote:
>>>>>>>>
>>>>>>>> Hi,
>>>>>>>>
>>>>>>>> You send var grid (see: return dict(grid=grid)). The first var grid
>>>>>>>> is a send var to your view, de second var grid is a local var of
>>>>>>>> your function.
>>>>>>>>
>>>>>>>> Then,
>>>>>>>> in controller use:
>>>>>>>> grid = SQLFORM.grid(db.new_table)
>>>>>>>> return dict(grid=grid)
>>>>>>>>
>>>>>>>> in the view use:
>>>>>>>> {{=grid}}
>>>>>>>>
>>>>>>>> Fabiano.
>>>>>>>>
>>>>>>>>
>>>>>>>> 2014-06-06 12:45 GMT-03:00 LoveWeb2py :
>>>>>>>>
>>>>>>>>>  SQLFORM isn't working for me with
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> new_table = db(db.table1.id.belongs(record_ids)).select()
>>>>>>>>> if I do {{=new_table}} in my view I can see the records which
>>>>>>>>> belong to record_ids, but if I do:
>>>>>>>>>
>>>>>>>>> SQLFORM.grid(new_table)
>>>>>>>>> return dict(grid=grid)
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> I get an error 'Rows' object has no attribute '_db'
>>>>>>>>>
>>>>>>>>>  --
>>>>>>>>> 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.
>>>>>

Re: [web2py] create a link SQLFORM to another table with id.belongs

2014-06-06 Thread Fabiano Almeida
Show your code


2014-06-06 15:18 GMT-03:00 LoveWeb2py :

> Now I get this error when I try to click edit on the query database:
>
>  invalid literal for int() with base 10:
> 'edit'
>
> I've tried changing signature to false, but I don't think thats the
> problem.
>
>
> On Friday, June 6, 2014 1:17:39 PM UTC-4, LoveWeb2py wrote:
>
>> yes
>>
>>
>> On Fri, Jun 6, 2014 at 1:09 PM, Fabiano Almeida 
>> wrote:
>>
>>> Are you logged in your app?
>>>
>>>>
>>>>
>>>> On Friday, June 6, 2014 1:03:35 PM UTC-4, Fabiano Almeida wrote:
>>>>>
>>>>> Try:
>>>>>
>>>>> grid = SQLFORM.grid(db.table,  user_signature=False)
>>>>>
>>>>> Em sexta-feira, 6 de junho de 2014 13h10min34s UTC-3, LoveWeb2py
>>>>> escreveu:
>>>>>>
>>>>>> Hi Fabiano,
>>>>>>
>>>>>> I actually was already using grid= SQLFORM.grid(db.new_table). That
>>>>>> is when I get the error.
>>>>>>
>>>>>> If I do grid='' to test it and just return the table without SQLFORM
>>>>>> I can see it in the view, but when I apply SQLFORM I get the error 'Rows'
>>>>>> object has no attribute '_db'.
>>>>>>
>>>>>> I'm guessing this is because of the way SQLFORM handles the grid?
>>>>>> Could there be something in  my model messing it up?
>>>>>>
>>>>>> On Friday, June 6, 2014 12:02:05 PM UTC-4, Fabiano Almeida wrote:
>>>>>>>
>>>>>>> Hi,
>>>>>>>
>>>>>>> You send var grid (see: return dict(grid=grid)). The first var grid
>>>>>>> is a send var to your view, de second var grid is a local var of
>>>>>>> your function.
>>>>>>>
>>>>>>> Then,
>>>>>>> in controller use:
>>>>>>> grid = SQLFORM.grid(db.new_table)
>>>>>>> return dict(grid=grid)
>>>>>>>
>>>>>>> in the view use:
>>>>>>> {{=grid}}
>>>>>>>
>>>>>>> Fabiano.
>>>>>>>
>>>>>>>
>>>>>>> 2014-06-06 12:45 GMT-03:00 LoveWeb2py :
>>>>>>>
>>>>>>>>  SQLFORM isn't working for me with
>>>>>>>>
>>>>>>>>
>>>>>>>> new_table = db(db.table1.id.belongs(record_ids)).select()
>>>>>>>> if I do {{=new_table}} in my view I can see the records which
>>>>>>>> belong to record_ids, but if I do:
>>>>>>>>
>>>>>>>> SQLFORM.grid(new_table)
>>>>>>>> return dict(grid=grid)
>>>>>>>>
>>>>>>>>
>>>>>>>> I get an error 'Rows' object has no attribute '_db'
>>>>>>>>
>>>>>>>>  --
>>>>>>>> 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.
>>>>>>>>
>>>>>>>
>>>>>>>  --
>>>> 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.
>>>>
>>>
>>>  --
>>> 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/I8aGvbVcQxk/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.
>

-- 
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] create a link SQLFORM to another table with id.belongs

2014-06-06 Thread Fabiano Almeida
Are you logged in your app?


2014-06-06 14:07 GMT-03:00 LoveWeb2py :

> That was it! THANK YOU! Why does it work without a signature though?
>
>
> On Friday, June 6, 2014 1:03:35 PM UTC-4, Fabiano Almeida wrote:
>>
>> Try:
>>
>> grid = SQLFORM.grid(db.table,  user_signature=False)
>>
>> Em sexta-feira, 6 de junho de 2014 13h10min34s UTC-3, LoveWeb2py escreveu:
>>>
>>> Hi Fabiano,
>>>
>>> I actually was already using grid= SQLFORM.grid(db.new_table). That is
>>> when I get the error.
>>>
>>> If I do grid='' to test it and just return the table without SQLFORM I
>>> can see it in the view, but when I apply SQLFORM I get the error 'Rows'
>>> object has no attribute '_db'.
>>>
>>> I'm guessing this is because of the way SQLFORM handles the grid? Could
>>> there be something in  my model messing it up?
>>>
>>> On Friday, June 6, 2014 12:02:05 PM UTC-4, Fabiano Almeida wrote:
>>>>
>>>> Hi,
>>>>
>>>> You send var grid (see: return dict(grid=grid)). The first var grid is
>>>> a send var to your view, de second var grid is a local var of your
>>>> function.
>>>>
>>>> Then,
>>>> in controller use:
>>>> grid = SQLFORM.grid(db.new_table)
>>>> return dict(grid=grid)
>>>>
>>>> in the view use:
>>>> {{=grid}}
>>>>
>>>> Fabiano.
>>>>
>>>>
>>>> 2014-06-06 12:45 GMT-03:00 LoveWeb2py :
>>>>
>>>>>  SQLFORM isn't working for me with
>>>>>
>>>>>
>>>>> new_table = db(db.table1.id.belongs(record_ids)).select()
>>>>> if I do {{=new_table}} in my view I can see the records which belong
>>>>> to record_ids, but if I do:
>>>>>
>>>>> SQLFORM.grid(new_table)
>>>>> return dict(grid=grid)
>>>>>
>>>>>
>>>>> I get an error 'Rows' object has no attribute '_db'
>>>>>
>>>>>  --
>>>>> 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.
>>>>>
>>>>
>>>>  --
> 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.
>

-- 
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] create a link SQLFORM to another table with id.belongs

2014-06-06 Thread Fabiano Almeida
How do you define tables?


2014-06-06 14:03 GMT-03:00 Fabiano Almeida :

> Try:
>
> grid = SQLFORM.grid(db.table,  user_signature=False)
>
> Em sexta-feira, 6 de junho de 2014 13h10min34s UTC-3, LoveWeb2py escreveu:
>
>> Hi Fabiano,
>>
>> I actually was already using grid= SQLFORM.grid(db.new_table). That is
>> when I get the error.
>>
>> If I do grid='' to test it and just return the table without SQLFORM I
>> can see it in the view, but when I apply SQLFORM I get the error 'Rows'
>> object has no attribute '_db'.
>>
>> I'm guessing this is because of the way SQLFORM handles the grid? Could
>> there be something in  my model messing it up?
>>
>> On Friday, June 6, 2014 12:02:05 PM UTC-4, Fabiano Almeida wrote:
>>>
>>> Hi,
>>>
>>> You send var grid (see: return dict(grid=grid)). The first var grid is
>>> a send var to your view, de second var grid is a local var of your
>>> function.
>>>
>>> Then,
>>> in controller use:
>>> grid = SQLFORM.grid(db.new_table)
>>> return dict(grid=grid)
>>>
>>> in the view use:
>>> {{=grid}}
>>>
>>> Fabiano.
>>>
>>>
>>> 2014-06-06 12:45 GMT-03:00 LoveWeb2py :
>>>
>>>>  SQLFORM isn't working for me with
>>>>
>>>>
>>>> new_table = db(db.table1.id.belongs(record_ids)).select()
>>>> if I do {{=new_table}} in my view I can see the records which belong to
>>>> record_ids, but if I do:
>>>>
>>>> SQLFORM.grid(new_table)
>>>> return dict(grid=grid)
>>>>
>>>>
>>>> I get an error 'Rows' object has no attribute '_db'
>>>>
>>>>  --
>>>> 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.
>>>>
>>>
>>>  --
> 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.
>

-- 
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] create a link SQLFORM to another table with id.belongs

2014-06-06 Thread Fabiano Almeida
Try:

grid = SQLFORM.grid(db.table,  user_signature=False)

Em sexta-feira, 6 de junho de 2014 13h10min34s UTC-3, LoveWeb2py escreveu:
>
> Hi Fabiano,
>
> I actually was already using grid= SQLFORM.grid(db.new_table). That is 
> when I get the error.
>
> If I do grid='' to test it and just return the table without SQLFORM I can 
> see it in the view, but when I apply SQLFORM I get the error 'Rows' object 
> has no attribute '_db'.
>
> I'm guessing this is because of the way SQLFORM handles the grid? Could 
> there be something in  my model messing it up?
>
> On Friday, June 6, 2014 12:02:05 PM UTC-4, Fabiano Almeida wrote:
>>
>> Hi,
>>
>> You send var grid (see: return dict(grid=grid)). The first var grid is a 
>> send var to your view, de second var grid is a local var of your 
>> function.
>>
>> Then, 
>> in controller use:
>> grid = SQLFORM.grid(db.new_table)
>> return dict(grid=grid)
>>
>> in the view use: 
>> {{=grid}}
>>
>> Fabiano.
>>
>>
>> 2014-06-06 12:45 GMT-03:00 LoveWeb2py :
>>
>>>  SQLFORM isn't working for me with 
>>>
>>>
>>> new_table = db(db.table1.id.belongs(record_ids)).select()
>>> if I do {{=new_table}} in my view I can see the records which belong to 
>>> record_ids, but if I do:
>>>
>>> SQLFORM.grid(new_table)
>>> return dict(grid=grid)
>>>
>>>
>>> I get an error 'Rows' object has no attribute '_db'
>>>
>>>  -- 
>>> 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.
>>>
>>
>>

-- 
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] create a link SQLFORM to another table with id.belongs

2014-06-06 Thread Fabiano Almeida
Hi,

You send var grid (see: return dict(grid=grid)). The first var grid is a
send var to your view, de second var grid is a local var of your function.

Then,
in controller use:
grid = SQLFORM.grid(db.new_table)
return dict(grid=grid)

in the view use:
{{=grid}}

Fabiano.


2014-06-06 12:45 GMT-03:00 LoveWeb2py :

>  SQLFORM isn't working for me with
>
>
> new_table = db(db.table1.id.belongs(record_ids)).select()
> if I do {{=new_table}} in my view I can see the records which belong to
> record_ids, but if I do:
>
> SQLFORM.grid(new_table)
> return dict(grid=grid)
>
>
> I get an error 'Rows' object has no attribute '_db'
>
>  --
> 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.
>

-- 
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] create a link SQLFORM to another table with id.belongs

2014-06-05 Thread Fabiano Almeida
I use this:

grid for table1
def index():
return dict(grid=SQLFORM.grid(Almoxarifado, links = [lambda row:
A('Listar Objetos',_href=URL('objeto','index',args=[row.id]))],
user_signature=False, csv=False))

grid for table2
def index():
if (not request.args)  and (not request.vars):
redirect(URL('almoxarifado','index'))
alm = None
if request.args: alm = request.args(0)
try:
if alm:
alm = int(alm)
session.almoxarifado=alm
session.nomealmox = Almoxarifado[alm].nome
except ValueError:
pass
Objeto.almoxarifado_id.default = session.almoxarifado
form = SQLFORM.grid(Objeto.almoxarifado_id == session.almoxarifado,
fields=[Objeto.nome, Objeto.quantidade, Objeto.localizacao],
user_signature=False, csv=False)
return dict(form=form, nome=session.nomealmox)

-- 
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: How to use createargs in SQLFORM.grid?

2014-06-03 Thread Fabiano Almeida
In manual dont have example of createargs:

while createargs, editargs and viewargs are passed only to the specific 
> create, edit and details SQLFORMs


this is the only reference manual


Em quarta-feira, 4 de junho de 2014 00h43min27s UTC-3, Fabiano Almeida 
escreveu:
>
> Hi,
>
> How to use creatargs in SQLFORM.grid?
>
> Table:
> Objeto = db.define_table('objeto',
>   SQLField('almoxarifado_id', db.almoxarifado, notnull=True, 
> readable=True, writable=True, label='Almoxarifado'),
>   SQLField('nome', 'string', length='50', notnull=True, label='Nome'),
>   SQLField('quantidade', 'integer', notnull=True, default=0),
>   SQLField('localizacao', 'string', length='50', label='Localização'),
>   SQLField('obs', 'text', label='Especificação'))
> Objeto.almoxarifado_id.requires=IS_IN_DB(db, 'almoxarifado.id', 
> '%(nome)s')
>
> def index():
> alm = request.args(0) or redirect(URL('almoxarifado','index'))
> form = SQLFORM.grid(Objeto.almoxarifado_id == alm, 
> fields=[Objeto.nome, Objeto.quantidade, Objeto.localizacao], 
> createargs={'Objeto.almoxarifado_id':alm}, user_signature=False, csv=False)
> return dict(form=form)
>
> I try create new record with field Objeto.almoxarifado_id = args(0), to 
> hide this field in form.
>
> Thanks in advance,
>
> Fabiano.
>

-- 
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] How to use createargs in SQLFORM.grid?

2014-06-03 Thread Fabiano Almeida
Hi,

How to use creatargs in SQLFORM.grid?

Table:
Objeto = db.define_table('objeto',
  SQLField('almoxarifado_id', db.almoxarifado, notnull=True, 
readable=True, writable=True, label='Almoxarifado'),
  SQLField('nome', 'string', length='50', notnull=True, label='Nome'),
  SQLField('quantidade', 'integer', notnull=True, default=0),
  SQLField('localizacao', 'string', length='50', label='Localização'),
  SQLField('obs', 'text', label='Especificação'))
Objeto.almoxarifado_id.requires=IS_IN_DB(db, 'almoxarifado.id', '%(nome)s')

def index():
alm = request.args(0) or redirect(URL('almoxarifado','index'))
form = SQLFORM.grid(Objeto.almoxarifado_id == alm, fields=[Objeto.nome, 
Objeto.quantidade, Objeto.localizacao], 
createargs={'Objeto.almoxarifado_id':alm}, user_signature=False, csv=False)
return dict(form=form)

I try create new record with field Objeto.almoxarifado_id = args(0), to 
hide this field in form.

Thanks in advance,

Fabiano.

-- 
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: How to add button on SQLFORM.grid?

2014-06-03 Thread Fabiano Almeida
Thanks Niphlod,

Using "links" worked!

Fabiano.


2014-06-03 19:21 GMT-03:00 Niphlod :

> two simple steps:
> 1)  read ALL this
> http://web2py.com/books/default/chapter/29/07/forms-and-validators#SQLFORM-grid-and-SQLFORM-smartgrid
> 2) if you don't know how to do it with the "links" argument, go to step 1)
>
> ^_^
>
>
> On Tuesday, June 3, 2014 9:24:26 PM UTC+2, Fabiano Almeida wrote:
>>
>> Hi,
>>
>> How to add button/field on SQLFORM.grid? I need create link to edit slave
>> table with row id.
>>
>> Thanks,
>>
>> Fabiano
>>
>  --
> 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.
>

-- 
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: web2py CMS

2014-06-03 Thread Fabiano Almeida
Plone +1


2014-06-03 15:52 GMT-03:00 Derek :

> I would recommend Plone (http://plone.org/). It's a very good Python CMS
> with a 13 year history. There's also Tactic (
> http://community.southpawtech.com/get-started) which is good, if you
> handle digital assets like video files.
>
>
> On Friday, May 30, 2014 7:21:04 AM UTC-7, Andrey K wrote:
>>
>> I am interested to add in CMS system for our web2py application.
>>  Quick search does not give me any solutions. Is there any CMS plugin
>> already or any recipes on it?
>> Any thoughts, suggestions, links and comments would be very appreciated.
>> Thank you in advance!
>>
>>  --
> 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.
>

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


  1   2   >