[web2py] How to know the IP address of the user client using my web2py site?

2016-01-12 Thread aston . ribat
Could you please tell the exact code? -- 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 G

[web2py] How to know the location of the user client on my site?

2016-01-12 Thread aston . ribat
Also can I increase by 5 hours and 20 minutes instead of time shown by the request.now Can I do like this?: HH+5:MM+20:SS -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Rep

[web2py] Re: How to know the IP address of the user client using my web2py site?

2016-01-12 Thread 黄祥
i think you can use request.client e.g. def oncreate_event(form, table): db.auth_event.insert(time_stamp = request.now, *client_ip = request.client*, user_id = auth.user_id, origin = '%s/%s' % (request.controller, request.function), description = 'ID %s created in table %s' % (form.vars.id, ta

[web2py] Re: How to know the location of the user client on my site?

2016-01-12 Thread 黄祥
i think you can achieve it with datetime.timedelta and set the default value of your table with that value. e.g. import datetime table.end_time.default = request.now + datetime.timedelta(seconds = 19200) p.s. 19200 seconds is 5 hours and 20 minutes best regards, stifan -- Resources: - http://w

Re: [web2py] Re: web2py httpserver log file location

2016-01-12 Thread Niphlod
for this and the previous issue, you should be on the path "I won't never ever start a process inside a web request". That being said, subprocess.Popen has cwdir . On Monday, January 11, 2016 at 8:52:58 PM UTC+1, Yebach wrote: > > What do u suggest I use to startthe exe program. It takes

[web2py] Re: web2py is giving me wrong time when I am using request.now for datetime. How to get time a/c as GMT?

2016-01-12 Thread Gael Princivalle
You can set your timezone like that in your model: import os os.environ['TZ'] = 'Europe/Rome' Il giorno lunedì 11 gennaio 2016 18:50:05 UTC+1, RAGHIB R ha scritto: > > Can we do it without any plugin? If yes, how? > -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - h

Re: [web2py] Re: web2py httpserver log file location

2016-01-12 Thread Vid Ogris
Using cwdir helped to solve the problem with httpserver.log file. Thank you for that So you suggest using scheduler to start my exe program? 2016-01-12 12:24 GMT+01:00 Niphlod : > for this and the previous issue, you should be on the path "I won't never > ever start a process inside a web reques

[web2py] Generic view pdf

2016-01-12 Thread Marlysson Silva
Person, I'm trying generating a generic view in pdf; but is showing this error RuntimeError: Table column/cell width not specified, unable to continue I Put the width at TDs ,then the this error dissapeares, then appeares this other: AttributeError: 'NoneType' object has no attribute 'get'

[web2py] Re: Can we use a web2py app on Android mobile?

2016-01-12 Thread eric cuver
you can also do this with web2py you just need to create a webview with Cordova or Kivy with the URL of your mobile website view. Me this is what I do and it works without problems Le lundi 11 janvier 2016 22:31:58 UTC+1, Alessio Varalta a écrit : > > Sorry, , you are right. Now i have developed

[web2py] Re: web2py is giving me wrong time when I am using request.now for datetime. How to get time a/c as GMT?

2016-01-12 Thread rgbapps1
thank you On Tuesday, January 12, 2016 at 12:34:47 AM UTC+5:30, Anthony wrote: > > web2py isn't giving you the "wrong" time -- it's the local time on your > server. If you want UTC, you can use request.utcnow (request.now and > request.utcnow are just datetime.datetime.now() and > datetime.date

Re: [web2py] Re: keepvalues - need help with this

2016-01-12 Thread szande333
hi Kiran, would you posting an extract of your final solution? cheers Steve On Thursday, 16 January 2014 02:32:31 UTC+8, Kiran Subbaraman wrote: > > Anthony, > Thanks for the explanation. Went ahead and created widgets, and things > work just fine. > >

[web2py] Cookie issues in Safari 9

2016-01-12 Thread asears
Hey guys. I'm having an issue with logging users in on Safari 9. It works in Chrome and Firefox fine. When I try to log in, it will take me back to the login screen and no errors are shown. This leads me to believe it is logging me in and then losing the session or something. Also, we are c

[web2py] Re: Why I am always being redirected? How to get a response.flash instead here?

2016-01-12 Thread rgbapps1
How to do that? Can you write a chunk of code please if it doesn't bother you? On Tuesday, January 12, 2016 at 12:31:27 AM UTC+5:30, Anthony wrote: > > On Monday, January 11, 2016 at 1:03:25 PM UTC-5, RAGHIB R wrote: >> >> {{= >> x.name}} >> this in my view calls this functions: >> def my_insert_

Re: [web2py] Re: web2py httpserver log file location

2016-01-12 Thread Niphlod
use anything you like EXCEPT something inside the web environment. On Tuesday, January 12, 2016 at 2:01:37 PM UTC+1, Yebach wrote: > > Using cwdir helped to solve the problem with httpserver.log file. Thank > you for that > > So you suggest using scheduler to start my exe program? > > 2016-01-12

[web2py] Re: web2py is giving me wrong time when I am using request.now for datetime. How to get time a/c as GMT?

2016-01-12 Thread Niphlod
this is not threadsafe. use utc and translate dates when presented to users. On Tuesday, January 12, 2016 at 12:41:44 PM UTC+1, Gael Princivalle wrote: > > You can set your timezone like that in your model: > > import os > > os.environ['TZ'] = 'Europe/Rome' > > > -- Resources: - http://web2py.co

Re: [web2py] Re: Can we use a web2py app on Android mobile?

2016-01-12 Thread Andrew Buchan
@eric That's interesting... So essentially you'd get an "app" on your mobile, but it just opens to a webpage on a server. That is probably the best solution offered so far although you need to be connected to and also don't get access to phone's features like contacts, notifications etc... On Tue

Re: [web2py] Re: web2py httpserver log file location

2016-01-12 Thread Vid Ogris
Hello I tried with sheduller In model I created a file called scheduler.py my code def runWoshiEngine(scriptId, path, outPath): import os, sys import subprocess count = 0 while ( count < 10 and ( os.path.isfile(outPath))): count += 1 os.remove(outPath) time

Re: [web2py] Email Registration

2016-01-12 Thread Tom Russell
I will try that but I also tried doing this locally and not on Pythonanywhere and get the same result so not too sure it is Pythonanywhere. On Monday, January 11, 2016 at 4:35:50 PM UTC-5, Alessio Varalta wrote: > > write in the pythonanywhere forum because for example on my server there > are a

[web2py] Re: problem with PostgreSQL database

2016-01-12 Thread Júlia Rizza
I'm using psycopg2 v2.4.5. Em terça-feira, 12 de janeiro de 2016 03:02:55 UTC-2, Massimo Di Pierro escreveu: > > very strange. ConnectionWrapper is not a web2py/dal object. which version > of psycopg2 are you using? > > On Monday, 11 January 2016 21:27:24 UTC-6, Júlia Rizza wrote: >> >> I have a

[web2py] Re: problem with PostgreSQL database

2016-01-12 Thread Niphlod
ouch. it's 4 years ago.. try to update it :D On Tuesday, January 12, 2016 at 5:05:50 PM UTC+1, Júlia Rizza wrote: > > I'm using psycopg2 v2.4.5. > > Em terça-feira, 12 de janeiro de 2016 03:02:55 UTC-2, Massimo Di Pierro > escreveu: >> >> very strange. ConnectionWrapper is not a web2py/dal object

Re: [web2py] Re: web2py httpserver log file location

2016-01-12 Thread Niphlod
no, it's not. please read the relevant section on the book to get acquainted with the scheduler. http://web2py.com/books/default/chapter/29/04/the-core#web2py-Scheduler On Tuesday, January 12, 2016 at 4:06:31 PM UTC+1, Yebach wrote: > > Hello > > I tried with sheduller > In model I created a fi

[web2py] Function fails when called from scheduler, but ok when called from a controller/function

2016-01-12 Thread Lisandro
I'm seeing this traceback error when I try to run a function defined in a model: Traceback (most recent call last): File "/var/www/medios/gluon/scheduler.py" , line 295, in executor _env = env(a=a, c=c, import_models=True) File "/var/www/medios/gluon/shell.py", line 166, in env sys.exit(1) Syste

[web2py] Why this HTML email not working? Please tell me the corrected version.

2016-01-12 Thread RAGHIB R
def result(): session.x=mail.send('smm...@gmail.com', 'hello', 'Hi Raghib, you have a new entry: ','session.name+session.name2+" with "+str(session.percent)') if session.x==True: response.flash="result" else: response.fla

[web2py] how to calculate size of uploads by user

2016-01-12 Thread Alex Glaros
what is easiest way to calculate total user uploaded data size so I can bill them for storage individually? each user will have multiple files loaded at different times. They will be billed each month. thanks Alex Glaros -- Resources: - http://web2py.com - http://web2py.com/book (Documenta

[web2py] Active Directories of multiple groups

2016-01-12 Thread Alex Glaros
Can someone please lay out the general concepts of how to implement Active Directory for multiple groups on a single cloud instance? Is it possible? Let's say I have cities of Sacramento and Los Angeles as clients on a single, cloud-based version of w2p. They want to integrate their own Active

[web2py] How to get ip address of the device user client is using and the server device?

2016-01-12 Thread aston . ribat
as I find out from different sources, request.env.server_addr and request.env.remote_addr should work but they don't really work. When I used this for my app on pythonanywhere, I always got request.env.server_addr as None and different ip address for request.env.remote_addr than what is show

[web2py] Tell me the difference between the three and tell me why they give different values:

2016-01-12 Thread aston . ribat
- request.client - request.env.remote_addr - request.env.http_x_forwarded_for -- 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

[web2py] Re: Tell me the difference between the three and tell me why they give different values:

2016-01-12 Thread Niphlod
request.client is equal to http_x_forwarded_for if the header is there, either remote_address. They can't be ALL three different, unless request.env.remote_addr is an ipv6 address. Either request.client equals remote_addr or request.client equals http_x_forwarded_for . on the "what they are" I s

[web2py] Re: Active Directories of multiple groups

2016-01-12 Thread Niphlod
with the default ldap adapter you can't. It won't be hard to hack to search in multiple AD domains, but the setup is highly unusual: one app should have one source-per-type identification provider. e.g. user: niphlod. I exist in Sacramento, but also on Los Angeles (because, basically, two niphl

[web2py] Re: how to calculate size of uploads by user

2016-01-12 Thread Niphlod
if you store the file-size as metadata it would be matter of a select sum(filesize) from thattable group by user if you choose not to do it (which I don't recommend), you'd have to retrieve the file for each user and sum the calculated size. On Tuesday, January 12, 2016 at 7:38:24 PM UTC+1, Al

[web2py] Re: Why this HTML email not working? Please tell me the corrected version.

2016-01-12 Thread Niphlod
If you read docs about mail.send, you'd know that it takes mail.send(to, subject, message, attachments, cc, .. etc etc etc). for html-only mails, it should be mail.send('recipi...@gmail.com, 'subject', 'thebody', etc etc etc) That being said, what's the error ? On Tuesday, January 12, 20

Re: [web2py] Re: Support for BIT(1) as boolean?

2016-01-12 Thread Alfonso Serra
Excuse me, one last question. Is it really necesary? import copy db._adapter.types = copy.copy(db._adapter.types) or modify the adapter right away will work? It looks like it does, but i dont know if theres any implication by skiping copy. Thanks -- Resources: - http://web2py.com - http://we

[web2py] Re: Function fails when called from scheduler, but ok when called from a controller/function

2016-01-12 Thread Niphlod
it seems an error in the model definition, as line 166 in gluon.shell is where an exception is raised when executing model files BEFORE calling the controller. As I repeatedly said, scheduler is just calling shell at regular intervals on steroids. If it works on the shell, it'll work on the sche

[web2py] Re: Active Directories of multiple groups

2016-01-12 Thread Alex Glaros
So for a rookie like me, does the simplest solution seem to be to create a special independent app for each organization just for auth/LDAP purposes, then transmit the user data to the centralized, common, shared instance? The goal is to allow for example, Paris and Chicago to auth independent o

[web2py] Re: Active Directories of multiple groups

2016-01-12 Thread Niphlod
On Tuesday, January 12, 2016 at 9:07:23 PM UTC+1, Alex Glaros wrote: > > So for a rookie like me, does the simplest solution seem to be to create a > special independent app for each organization just for auth/LDAP purposes, > then transmit the user data to the centralized, common, shared insta

Re: [web2py] Re: Active Directories of multiple groups

2016-01-12 Thread Richard Vézina
What about multi-tenancy? http://web2py.com/books/default/chapter/29/06/the-database-abstraction-layer?search=multi+#Common-fields-and-multi-tenancy He could check which domain is accessed and authenticate against the proper LDAP instance, no? Richard On Tue, Jan 12, 2016 at 3:43 PM, Niphlod w

[web2py] Re: Why I am always being redirected? How to get a response.flash instead here?

2016-01-12 Thread Anthony
http://web2py.com/books/default/chapter/29/11/jquery-and-ajax On Tuesday, January 12, 2016 at 9:12:02 AM UTC-5, rgbap...@gmail.com wrote: > > How to do that? Can you write a chunk of code please if it doesn't bother > you? > > On Tuesday, January 12, 2016 at 12:31:27 AM UTC+5:30, Anthony wrote: >

[web2py] How can we help with the documentation?

2016-01-12 Thread Alfonso Serra
Ive spent 6 hours wondering why i couldnt update or insert a record with the interactive console. After changing mysql user passwords, drop tables, remigrate everything, mounting a fresh new web2py installation, tried to disable caching, i wasnt able to update or insert a record even tho the do

[web2py] Re: how to calculate size of uploads by user

2016-01-12 Thread Alex Glaros
Can anyone help me with syntax for computing file size and posting to metadata? Niphlod got me started in the right direction. Is this the right idea? Am trying to get file size into field file_size below: def filesize(filename): import os, stat return os.uploadfolder(os.path.join(request

[web2py] Re: how to calculate size of uploads by user

2016-01-12 Thread Alex Glaros
also tried to enter file_size within form when adding the record if form.process().accepted: session.flash = 'profile update accepted' form.vars.file_size = filesize([form.vars.thumbnail]) result was return os.stat(os.path.join(request.uploadfolder,'uploads')) File "nt

[web2py] Re: How can we help with the documentation?

2016-01-12 Thread Anthony
You can send pull requests to the book repo: https://github.com/mdipierro/web2py-book If you want to suggest substantial changes to the organization/structure of the docs, you might first open a discussion on the developers group: https://groups.google.com/forum/#!forum/web2py-developers Antho

[web2py] Re: How can we help with the documentation?

2016-01-12 Thread Anthony
See also http://web2py.com/books/default/chapter/29/15/helping-web2py#Documentation--Updating-the-book. On Tuesday, January 12, 2016 at 9:42:55 PM UTC-5, Anthony wrote: > > You can send pull requests to the book repo: > https://github.com/mdipierro/web2py-book > > If you want to suggest substant

[web2py] Re: How to know the IP address of the user client using my web2py site?

2016-01-12 Thread Massimo Di Pierro
request.env.remote_addr is the socket remote address and request.client is the former or the HTTP_X_FORWRDED_FOR. none of them is 100% reliable as they can be tricked by the visitor. On Tuesday, 12 January 2016 04:10:50 UTC-6, 黄祥 wrote: > > i think you can use request.client > e.g. > def oncreate

[web2py] Re: web2py is giving me wrong time when I am using request.now for datetime. How to get time a/c as GMT?

2016-01-12 Thread Massimo Di Pierro
That is why we do not use the built-in python localization functions in web2py. They are not thread safe. On Tuesday, 12 January 2016 08:16:43 UTC-6, Niphlod wrote: > > this is not threadsafe. use utc and translate dates when presented to > users. > > On Tuesday, January 12, 2016 at 12:41:44 PM

[web2py] update 2 session value using module only first session value work

2016-01-12 Thread 黄祥
is it possible to update 2 sessions values using web2py module? i've tested it only first session value work, the second session value work if explicit define in the module (but the module is used by another controller, so i want to create just 1 module for all controllers). e.g. *modules/transa

[web2py] Re: keepvalues - need help with this

2016-01-12 Thread T.R.Rajkumar
I do this form.process(keepvalues=True,onvalidation=validate_meas).accepted: and the form retains values on submission. On Saturday, January 11, 2014 at 12:10:07 AM UTC+5:30, Kiran Subbaraman wrote: > > Hello All, > The *design *is: I have a custom form with the a controller that > inserts/upda

[web2py] Re: keepvalues - need help with this

2016-01-12 Thread T.R.Rajkumar
But I use FORM and not SQLFORM. On Saturday, January 11, 2014 at 12:10:07 AM UTC+5:30, Kiran Subbaraman wrote: > > Hello All, > The *design *is: I have a custom form with the a controller that > inserts/updates a table. Tthe form accepts data, and on successful > submission of this form, it sta

[web2py] web2pyslices again

2016-01-12 Thread Mirek Zvolský
I realy hate web2pyslices. Maybe there are people who like this page, however for me it is always pain. List of plugins is terrible and I think it is because their authors simple cannot understand how to upload some stuff. For final users it is then completly useless - and more: makes big shame t