Re: [web2py] logged in user and auth.user_id=None

2015-10-28 Thread Anthony
1. Instead of the web-based shell in admin, use the web2py Python shell (i.e., python web2py.py -S myapp/mycontroller -M). Note, specifying the controller is optional -- if you include it, you will have access to the functions defined in the controller. 2. You mentioned that

[web2py] Re: how to find and reference field names in tables

2015-10-28 Thread Anthony
Are you saying you have a "tables" table in your db that stores all the table and field names of the other tables in your db, and you need to know how to query it to get particular information, or are you looking for a way to loop over all the tables you have defined and identify those that

Re: [web2py] DAL alternatives

2015-10-28 Thread Bernard Letourmy
Hi Ramos, What's your project ? Because if you do some console, desktop or Python notebook doc. standalone pydal is there. But if you're looking at developing a web app or rest api Web2py Is quite good at it and quite well integrated with pydal ;) Or what inconvenience do you see with web2py

[web2py] format double data type

2015-10-28 Thread 黄祥
hi, is it possible to change format double data type? e.g. default format : 1,000.00 expected format (that used in my country) : 1.000,00 i've tried : represent = lambda net, field: format(net, ",.2f").replace(",", ".") got the result : 1.000.00 how can i got the result as expected format

[web2py] Problem calling a method field inside a virtual field

2015-10-28 Thread Carlos Cesar Caballero Díaz
I can't do this: db.business.test = Field.Method(lambdarow:4) db.business.testa = Field.Virtual(lambdarow: row.business.test()) printdb(db.business.id >0).select().first().testa It's a bug?, a feature? or I am having a bad day? the exception is the clasic " 'Row' object has no attribute

Re: [web2py] Fwd: aiosmtpd 1.0a1 - asyncio-based implementations of SMTP/LMTP

2015-10-28 Thread Michele Comitini
Let's hope that it's better than async in python2.7 with TLS/SSL ... I've got bitten by it... http://bugs.python.org/issue24906 Anyway no python2.7 mantainer seems to care... the bug persists happily despite of being very easy to fix! 2015-10-26 15:43 GMT+01:00 Niphlod : >

[web2py] as string() for email message

2015-10-28 Thread Ron Chatterjee
email_send_by = auth.user_id; mail.send(to=['my_email_address'],subject='New email',message = email_send_by ) Getting an error since I need to pass the message as a string. Any thoughts? -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) -

Re: [web2py] logged in user and auth.user_id=None

2015-10-28 Thread Pierre
thanks Anthony now i have an operational shell the virtual fields problem is fixed too Le mercredi 28 octobre 2015 14:10:12 UTC+1, Anthony a écrit : > > >1. Instead of the web-based shell in admin, use the web2py Python >shell (i.e., python web2py.py -S myapp/mycontroller -M).

Re: [web2py] DAL alternatives

2015-10-28 Thread António Ramos
my inconvenients: 1 - Bootstrap, i need layout.html but dont want bootstrap. How do i get rid of bootstrap or change it to semantic ? Bootstrap should not be a constraint but just an add-on. 2 - web2py custom forms and tables. Are nice tools but if they dont do what you want you will have a

[web2py] Re: as string() for email message

2015-10-28 Thread Ron Chatterjee
auth.user.first_name Had a typo in there and worked! On Wednesday, October 28, 2015 at 10:10:43 AM UTC-4, Ron Chatterjee wrote: > > email_send_by = auth_user.first_name; > mail.send(to=['my_email_address'],subject='New email',message > = email_send_by ) > > Getting an error since I need to

Re: [web2py] format double data type

2015-10-28 Thread Massimiliano
Try this way: import locale locale.setlocale(locale.LC_ALL, 'it_IT.UTF-8') represent_currency = lambda value, row=None: ‘-' if not value else locale.currency(value, symbol=True, grouping=True, international=False).replace('Eu', '€') change ‘it_IT.UTF-8' to your locale On Wed, Oct 28, 2015

[web2py] what's wrong with web2py.com homepage

2015-10-28 Thread Selman Kocael
home page is like this for me right now: web2py.com [image: Satır içi resim 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

[web2py] Re: what's wrong with web2py.com homepage

2015-10-28 Thread 黄祥
not sure but right now is back to normal again. best regards, stifan On Wednesday, October 28, 2015 at 1:21:36 PM UTC+7, xmarx wrote: > > home page is like this for me right now: web2py.com > > [image: Satır içi resim 1] > > > > > -- Resources: - http://web2py.com - http://web2py.com/book

Re: [web2py] Re: what's wrong with web2py.com homepage

2015-10-28 Thread Selman Kocael
yes. it is okey. 2015-10-28 8:48 GMT+02:00 黄祥 : > not sure but right now is back to normal again. > > best regards, > stifan > > On Wednesday, October 28, 2015 at 1:21:36 PM UTC+7, xmarx wrote: >> >> home page is like this for me right now: web2py.com >> >> [image:

[web2py] Re: Should this work in Web2py

2015-10-28 Thread Anthony Smith
added the following def create_stock_task(): form = SQLFORM (db.stock_task).process() if form.accepted: task = db(db.stock_task.id).select().first() pdays_row = db(db.product.withholding_period>0).select().first() pdays = pdays_row.withholding_period

[web2py] Re: Problem calling a method field inside a virtual field

2015-10-28 Thread Anthony
On Wednesday, October 28, 2015 at 10:30:13 AM UTC-4, Carlos Cesar Caballero wrote: > > I can't do this: > > db.business.test = Field.Method(lambda row: 4)db.business.testa = > Field.Virtual(lambda row: row.business.test()) > print db(db.business.id > 0).select().first().testa > > > It's a bug?,

Re: [web2py] DAL alternatives

2015-10-28 Thread Marin Pranjić
Hey! Bootstrap was never a constraint, I am removing it from every single project and adding foundation/semantic/custom - I can't stand it. I am also manually writing forms (everything in between of form.custom.begin and form.custom.end) while using the power of SQLFORMs on backend. What do you

Re: [web2py] Re: Problem calling a method field inside a virtual field

2015-10-28 Thread Carlos Cesar Caballero Díaz
I will submit the issue to github, it was a simple example of the problem, in the original code I do more precessing. This are the cases when the problem occours (using Version 2.10.3-stable+timestamp.2015.04.02.21.42.07 in 64 bits Ubuntu 15.04) db.business.test = Field.Virtual(lambdarow:4)

[web2py] Re: Problem calling a method field inside a virtual field

2015-10-28 Thread Anthony
> > An extra question: >> > why I need to do something like: >> >> lambda row: row.tablename.field >> >> something like this looks more elegant: >> >> lambda this: this.field >> >> just saying... >> > > You can do: > > lambda this: this.tablename.field > I should note that while you can use

[web2py] Multiple upload fields in a SQLFORM.factory

2015-10-28 Thread Carl Petersen
Hello, I am attempting to use multiple upload fields in a SQLFORM.factory. The first field uploads a file, and the second specifies a filename to be written out to. form = SQLFORM.factory(Field('billing_file', 'upload',uploadfolder=os.path.join(request.folder,

[web2py] Session problem

2015-10-28 Thread Gael Princivalle
Hello all. I've got a strange problem with session. I use PHPlist for mailing. When the user click on a link in a PHPlist mail the URL is URL + some variables like

[web2py] Re: how to find and reference field names in tables

2015-10-28 Thread Alex Glaros
I want to discover the field names in db.py (I do not have them listed in an already-existing table) can you help with syntax for a query? query = ((db.tables.field == 'organizationID') & (db.tables.field == 'last_name') & (db.tables.table_name.organizationID == 'California')) # so search is

Re: [web2py] Re: Problem calling a method field inside a virtual field

2015-10-28 Thread Carlos Cesar Caballero Díaz
Anthony, many thanks for your answer, I was thinking in "self" and not "this", I am working with python and java right now and sometimes I place ";" or brackets in python code... My team and I are used to working with object-oriented ORM, and that's why the "self" feels more natural to me

[web2py] Re: how to find and reference field names in tables

2015-10-28 Thread Anthony
> >> for tablename in db.tables: >> table = db[table] >> > > should this be table = db[tablename] ? > Yes, thanks. I updated the original answer. Anthony -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) -

[web2py] Re: how to find and reference field names in tables

2015-10-28 Thread Dave S
On Wednesday, October 28, 2015 at 6:35:27 AM UTC-7, Anthony wrote: > > Are you saying you have a "tables" table in your db that stores all the > table and field names of the other tables in your db, and you need to know > how to query it to get particular information, or are you looking for a

[web2py] Re: PostgreSQL

2015-10-28 Thread Val K
Postgresql can be fully portable and runing from flash (including PgAdminIII). All you need - write batch-file in few rows. It's fantastic, I love it! On Wednesday, October 21, 2015 at 4:30:28 PM UTC+3, Massimo Di Pierro wrote: > > >

Re: [web2py] Re: Problem calling a method field inside a virtual field

2015-10-28 Thread Anthony
> My team and I are used to working with object-oriented ORM, and that's why > the "self" feels more natural to me (and my lazy side says that there are > many innecesary characters...), I mean that why not pass only the row > object, "row" is an object of type row, and row.table is a row

[web2py] Re: how to find and reference field names in tables

2015-10-28 Thread Dave S
On Wednesday, October 28, 2015 at 9:39:52 AM UTC-7, Alex Glaros wrote: > > I want to discover the field names in db.py (I do not have them listed in > an already-existing table) > > can you help with syntax for a query? > > query = ((db.tables.field == 'organizationID') & (db.tables.field == >

[web2py] Re: how to find and reference field names in tables

2015-10-28 Thread Anthony
You can't do a query looking for tables -- you have to handle that part of it in Python with code like I showed. Once you have the table names, you can then do whatever queries you want. Anthony On Wednesday, October 28, 2015 at 12:39:52 PM UTC-4, Alex Glaros wrote: > > I want to discover the

Re: [web2py] DAL alternatives

2015-10-28 Thread Anthony
On Wednesday, October 28, 2015 at 11:07:42 AM UTC-4, Ramos wrote: > > my inconvenients: > > 1 - Bootstrap, i need layout.html but dont want bootstrap. How do i get > rid of bootstrap or change it to semantic ? > Bootstrap should not be a constraint but just an add-on. > How would you do it

[web2py] Re: how to find and reference field names in tables

2015-10-28 Thread Alex Glaros
ok, got it. Thanks 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] Re: Session problem

2015-10-28 Thread Anthony
Is the session cookie getting passed back and forth? On Wednesday, October 28, 2015 at 4:29:47 PM UTC-4, Gael Princivalle wrote: > > I'm running 2.9.12. > Anyway the problem is that I don't have any new session. All applications > functions that use sessions are down. > > In the same browser: >

[web2py] Re: Session problem

2015-10-28 Thread Gael Princivalle
I'm running 2.9.12. Anyway the problem is that I don't have any new session. All applications functions that use sessions are down. In the same browser: I click on the link in gmail. In the application session is unavailable. If I open a new tab in the same browser session still unavailable. If

[web2py] Re: Session problem

2015-10-28 Thread Niphlod
are you aware that recent version of web2py by default renew session every time a user logs in / logs out for security reasons ? On Wednesday, October 28, 2015 at 5:10:57 PM UTC+1, Gael Princivalle wrote: > > Hello all. > > I've got a strange problem with session. > I use PHPlist for mailing. >

[web2py] Re: Session problem

2015-10-28 Thread Niphlod
halt. Given you "receiver controller" being def index(): session.testmycart = 1 return dict(s=session) Only two things can happen if no login is required: a) either a user is coming back to the site (and the session isn't yet expired) and he gets s = {'testmycart' : 1,

[web2py] Detect Facebook/Twitter shares

2015-10-28 Thread Phillip
Is there a way to detect a user's id when the facebook/twitter share mechanism is used? A user's share activity would need to be tracked to, for instance, incentivize using the share function, If this has already been asked and detailed, please indicate where to find the post --

[web2py] possible error in fpdf module (solved)

2015-10-28 Thread Carlos Kitu
It was my first try with pyfpdf library, (great job of Mariano Reingart, thank you so much). In my first tests generating a PDF from html, the H1 tag displayed in red color. As far as I could see in pyfpdf there was no way to change the default style for H1. Then I resorted to the tag, but

Re: [web2py] logged in user and auth.user_id=None

2015-10-28 Thread Pierre
I installed web2py on 2 ubuntus but I can't use its internal shell on both machine. On the desktop after a few commands shell issues an error : error please reload the page and then it's not working anymore On the laptop shell always answer None whatever the command ? it seems to me there are