[web2py] git push error

2014-10-01 Thread olivier hubert
If I use the function git push from the admin console I get an error

Traceback

1.
2.
3.
4.
5.
6.

Traceback (most recent call last):
  File /home/olituks/web2py/gluon/restricted.py, line 224, in restricted
exec ccode in environment
  File /home/olituks/web2py/applications/admin/views/default/git_push.html, 
line 53, in module
TypeError: 'NoneType' object does not support item assignment

Error snapshot [image: help] 
https://olituks.pythonanywhere.com/admin/default/ticket/admin/81.164.136.7.2014-09-30.17-26-40.7e78b696-23f5-4282-8c68-640a32502b29#

type 'exceptions.TypeError'('NoneType' object does not support item 
assignment)

-- 
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: sqlite - how to use web2py built in driver or latest sqlite

2014-10-01 Thread Mohd Radzi Ibrahim


On Monday, 29 September 2014 21:26:11 UTC+8, Massimo Di Pierro wrote:

 can you tells us more about the problem. If in path it should just use it. 
 what error do you get?


Hi, 

This is the error message: 
type 'exceptions.RuntimeError' Failure to connect, tried 5 times: 
Traceback (most recent call last): File 
/home/radzi/devtools/web2py/gluon/dal.py, line 8038, in __init__ 
self._adapter = ADAPTERS[self._dbname](**kwargs) File 
/home/radzi/devtools/web2py/gluon/dal.py, line 700, in __call__ obj = 
super(AdapterMeta, cls).__call__(*args, **kwargs) File 
/home/radzi/devtools/web2py/gluon/dal.py, line 2398, in __init__ if 
do_connect: self.find_driver(adapter_args) File 
/home/radzi/devtools/web2py/gluon/dal.py, line 834, in find_driver raise 
RuntimeError(no driver available %s % str(self.drivers)) RuntimeError: no 
driver available ('sqlite2', 'sqlite3')

Just for your info, I did not install sqlite using apt-get, but using the 
source code at fossil.scm repo

Thank you in advance for your help.



 

 On Saturday, 27 September 2014 22:48:12 UTC-5, Mohd Radzi Ibrahim wrote:

 Hi,

 I've just install web2py and trying the welcome app.

 I have problem with sqlite database. I think it's because I uses sqlite3 
 database direct from fossil scm, for my other project. I did configure, 
 make and make install to install the sqlite.

 How could I configure web2py to use that sqlite library? Or how do I 
 configure web2py to use it's builtin sqlite?

 thanks.

 Radzi. 



-- 
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] login security and some doubts

2014-10-01 Thread harith54
Hi,

I am intending to use web2py to build some services and tools. I really 
admire how Massimo DiPierro and the contributors has created an amazing web 
app development platform from what I have seen so far. It takes away so 
much pain from web dev. Its been a month since I have started using web2py 
and I was going by the guide given in web2py.com website and youtube videos 
by Mdipierro on the same. I am a newbie on both  web2py and python and I am 
still figuring it out. I test on pythonanywhere. Getting back to topic

1. In the db.py file, I filled email and smtp mail settings and enabled 
'require email confirmation for registration', but it says connection 
refused when trying to register a user account. Is that because I am on 
pythonanywhere free account OR did I miss some other configuration settings?

2. I read that there was serious security flaw in oauth2 authentication. 
Should I be worried if I used it for user login and registration for my 
website. I am not asking about logging in with facebook or google, but the 
login and registration auth that I get with web2py.

3. Once I register a user, how would I implement user account deletion 
along with the associated data? I want my users to be able to delete their 
account and their data if they want to do so. But I couldn't find out how 
to do so on web2py. Can someone advise on how to do it? Also I'd like to 
know how to disable or deactivate a user's account.

4. After I define models, I can get {{=form}}. But how do I change button 
to a different type in the form that I get as a result? Say I want 
bootstrap 'btn-danger' just in one particular page (I'd like to use 
 'btn-danger' as the form submit button in a page instead of what I get 
when using {{=form}} in the view).

5. If I want to use realtime chat in one of my web2py app, is it possible? 
If so, can you point to some resource on how I can use tornado within 
web2py?

-- 
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: Web Editor Blank Screen

2014-10-01 Thread Trevor Strauss
All files have the same ownership...other thoughts?

On Fri, Sep 26, 2014 at 8:27 AM, Trevor Strauss trevor.stra...@gmail.com
wrote:

 Hi, upgraded through the admin console.  will check the user/file
 ownership but but think I recall them being the same when I checked file
 permissions.  Thanks for the help

 On Wed, Sep 24, 2014 at 6:16 PM, Leonel Câmara leonelcam...@gmail.com
 wrote:

 How did you upgrade web2py? Is the nginx's user the same as the files in
 the web2py folder?

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


[web2py] Re: Scheduler always QUEUED and no record in scheduler_worker and scheduler_run data table

2014-10-01 Thread Pengfei Yu
Hi Simone,

Thanks for your reply. I used the solution from the web2py document site: 
http://www.web2py.com/books/default/chapter/29/13/deployment-recipes, in 
section Start the scheduler as a Linux service (upstart). After I started 
it, the status check (sudo status web2py-scheduler) shows that it is 
already started:
ubuntu@ip-172-31-41-2:~$ sudo status web2py-scheduler
web2py-scheduler start/running, process 16262


Interesting thing is that when I restart web2py-scheduler again, it works 
out. The previous worker didn't show up in the db_scheduler_worker table 
but the current one shows up.

May I have another question? We are planning to use the power of 
distributed system cluster with multiple EC2 instances for this project. 
May I ask if the tasks in the scheduler just use different thread in a CPU 
or it can also be designed to use different cores or nodes with multiple 
processors? (From this post: 
https://groups.google.com/forum/#!topic/web2py/WlhvelFu8-Q, it seems the 
scheduler can be adapted for multiple cores). And if that is the case, is 
there any special design on web2py scheduler itself for the communication 
between master instance and others? 

Thanks a lot!


On Tuesday, September 30, 2014 3:04:07 AM UTC-4, Niphlod wrote:

 if there are no records in the scheduler_worker, the scheduler is not 
 running. Please check your permanent daemon solution to see if it's 
 running and what it logs.

 On Monday, September 29, 2014 4:37:53 PM UTC+2, Pengfei Yu wrote:

 Hi,

 I have a web application hosted on AWS EC2 with Apache2. I plan to use 
 web2py scheduler for some heavy tasks with user input files. Now I only use 
 some small tasks like wc -c to test the functions of scheduler. It seems 
 that the submitted tasks are always QUEUED and the status never changes. 
 After searching the google group, I added db.commit() right after 
 scheduler.queue_task(), but it still cannot work. 

 I've already Installed the scheduler as a permanent daemon on Linux and 
 started web2py-scheduler using sudo start web2py-scheduler.

 Here is part of my codes in default.py:
 def index():

 response.flash = T(Welcome to web2py!)
 form=SQLFORM(db.project,fields=['name', 
 'Genome',File_type,InputFile])
 if request.vars.InputFile!=None and 
 request.vars.InputFile.filename.split(.)[-1]!=request.vars.File_type:
 response.flash = 'The input file must match file type, please 
 fill again'
 return dict(form=form)
 if request.vars.InputFile!=None:
 form.vars.processID=0
 if form.process().accepted:
 response.flash = 'form accepted'
 filepath = form.vars.InputFile
 command = wc -c 
 /home/www-data/web2py/applications/BamToVcf/uploads/+filepath
 p = scheduler.queue_task('run',[command])
 db.commit()
 row = db(db.project.InputFile==filepath).select().first()
 row.update_record(processID = p.uuid)
 redirect(URL(progress,args=[p.uuid]))
 elif form.errors:
 response.flash = 'form has errors'
 else:
 response.flash = please fill out the form
 return dict(form=form)


 def progress():
 processID = request.args(0)
 project = db.project(db.project.processID==processID)
 status=scheduler.task_status(processID,output=True)
 start_time = utc_to_local(status.scheduler_task.start_time)
 return dict(project=project,p=status,start_time=start_time)

 def list():
 rows = db(db.project.id0).select()
 return dict(rows=rows)

 And the code in scheduler.py in Models folder:
 from gluon.scheduler import Scheduler
 import subprocess
 from collections import OrderedDict
 import os

 def run(command):
 p = subprocess.Popen(command,
  shell=False,
  stdout=subprocess.PIPE,
  stderr=subprocess.PIPE)
 startTime = time.time()
 stdout, stderr = p.communicate()
 endTime = time.time()
 return (command, p.returncode, stdout, stderr, round(endTime - 
 startTime))

 def demo2(a,b):
 return a+b

 scheduler = Scheduler(db,dict(run=run,demo2=demo2))

 From the database page (~/%app/appadmin/index), I can see the records 
 of tasks in db.scheduler_task table but no record in db.scheduler_worker 
 and db.scheduler_run table.

 Could any one help me figure out the problem?

 Thanks very much! 




-- 
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: Automate JQuery for Button

2014-10-01 Thread Bernhard Radermacher
Dave: This is exactly what I am looking for. 

Very good solution. Thanks!

On Tuesday, September 30, 2014 11:11:08 AM UTC-7, Dave S wrote:



 On Tuesday, September 30, 2014 12:02:32 AM UTC-7, Niphlod wrote:

 nope, just an A. if ou need a something that when you click on it it 
 brings you on another page, A is the thin you're searching for, not a 
 button.


 Would he perhaps be looking for a link styled as a button?  Appadmin does 
 that just by setting the link's style to btn, a technique that works for 
 me in one of my apps.


 a class=btn href=/LogServer/appadmin/insert/db/updatechecks/a

 (the non-Appadmin example points to a separate server)

 /dps



  


 On Monday, September 29, 2014 10:59:46 PM UTC+2, Bernhard Radermacher 
 wrote:

 Would that be just enclosing the button with a? 

 On Monday, September 29, 2014 6:35:15 AM UTC-7, Niphlod wrote:

 we did a pretty heavy job to discard any inline javascript  this 
 goes exactly in the opposite way. What are you seeking in functionality ? 
 It seems that your *button *is better suited with a normal *a*


 On Sunday, September 28, 2014 10:37:33 PM UTC+2, Bernhard Radermacher 
 wrote:

 I was always a bit disappointed with the features, or rather 
 non-features of the html button, basically that all functionality has to 
 be 
 programmed by hand. 

 I created a small class (and patched it into gluon.html) to make a 
 button and the respective JQuery script automatically. At this time the 
 button just works as a link to a page.

 Would like to discuss if something like this makes sense, if it would 
 make more sense to add to the standard by expanding gloun.html.BUTTON to 
 accept 'href' and behave accordingly...



 class linkBUTTON(DIV):
 
 Pseudo Component to automatically generate JavaScript to execute 
 on click
 
 
 tag = 'linkbutton'

 def xml(self):
 
 get attributes to generate the BUTTON, override _type to 
 'button'
 if href is defined, create the respective JavaScript
 
 href = None
 attr = {}
 for key, value in self.attributes.iteritems():
 if key == 'href':
 href = value
 continue
 if key[:1] != '_':
 continue
 attr[key] = value

 attr['_id'] = uuid4()
 attr['_type'] = 'button'
 
 result = BUTTON(self.components, **attr).xml()
 if href:
 result += '\n' + 
 SCRIPT($('#%s').click(function(){window.location.assign('%s');}); % 
 (attr['_id'], href)).xml()

 return result



-- 
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 trunk is broken??

2014-10-01 Thread Niphlod
in theory they should be in sync. In practice, sometimes googlecode falls 
behind. For sure the originator of new code is now github, thanks to its 
social features.

On Wednesday, October 1, 2014 6:11:13 AM UTC+2, pbreit wrote:

 Is Github the preferred source now?

 On Tuesday, September 30, 2014 8:45:46 AM UTC-7, Anthony wrote:

 You'll need to get it from Github -- Google Code is broken at the moment 
 (the commit is missing the entire new dal folder).

 Anthony

 On Tuesday, September 30, 2014 11:41:47 AM UTC-4, Jim S wrote:

 Sorry Niphlod, but I'm not exactly sure what you mean by that.

 I did this:

 hg clone http://code.google.com/p/web2py

 to get a fresh copy, but still have the same error.

 Also tried via https and am getting this error:

 abort: error: _ssl.c:504: error:1408E0F4:SSL 
 routines:SSL3_GET_MESSAGE:unexpecte
 d message

 ...this is not an emergency or anything.  I have plenty of 
 alternatives.  If you can just drop a note when it is all working again I'd 
 appreciate it.

 -Jim


 On Tue, Sep 30, 2014 at 10:17 AM, Niphlod nip...@gmail.com wrote:

 if you fetch the main repo instead of the old one it's all ok right now.

 On Tuesday, September 30, 2014 5:13:15 PM UTC+2, Jim S wrote:

 Thanks Niphlod, I'll be patient and let you guys do your work.  If you 
 could drop a note when it is resolved I'd really appreciate it.

 On Tue, Sep 30, 2014 at 10:00 AM, Niphlod nip...@gmail.com wrote:

 there's a biiig change going on on dal (modularization). it should 
 not go into exception but we're in the process of fixing those hiccups. 

 On Tuesday, September 30, 2014 4:51:24 PM UTC+2, Jim S wrote:

 Sorry, when I said I updated 'my code' I meant that I pulled the 
 latest web2py code.

 -Jim


 On Tuesday, September 30, 2014 9:49:54 AM UTC-5, Jim S wrote:

 I just pulled/updated my code from code.google.com using hg. 

 When I try to run web2py, I'm getting the following:

 C:\dev\bootstrap3\web2pypython web2py.py
 Traceback (most recent call last):
   File web2py.py, line 18, in module
 import gluon.widget
   File C:\dev\bootstrap3\web2py\gluon\__init__.py, line 17, in 
 module
 from validators import *
   File C:\dev\bootstrap3\web2py\gluon\validators.py, line 25, in 
 module
 from gluon.dal.objects import FieldVirtual, FieldMethod
 ImportError: No module named objects


 Any ideas?

 -Jim

  -- 
 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/pvVGtt7lpdc/unsubscribe.
 To unsubscribe from this group and all its topics, 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/pvVGtt7lpdc/unsubscribe.
 To unsubscribe from this group and all its topics, 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.


[web2py] Re: Scheduler always QUEUED and no record in scheduler_worker and scheduler_run data table

2014-10-01 Thread Niphlod
On Tuesday, September 30, 2014 3:42:41 PM UTC+2, Pengfei Yu wrote:

 Hi Simone,

 Thanks for your reply. I used the solution from the web2py document site: 
 http://www.web2py.com/books/default/chapter/29/13/deployment-recipes, in 
 section Start the scheduler as a Linux service (upstart). After I started 
 it, the status check (sudo status web2py-scheduler) shows that it is 
 already started:
 ubuntu@ip-172-31-41-2:~$ sudo status web2py-scheduler
 web2py-scheduler start/running, process 16262


 Interesting thing is that when I restart web2py-scheduler again, it works 
 out. The previous worker didn't show up in the db_scheduler_worker table 
 but the current one shows up.


well, solutions are ready to use but to check nonetheless ^_^'
 

 May I have another question? We are planning to use the power of 
 distributed system cluster with multiple EC2 instances for this project. 
 May I ask if the tasks in the scheduler just use different thread in a CPU 
 or it can also be designed to use different cores or nodes with multiple 
 processors? (From this post: 
 https://groups.google.com/forum/#!topic/web2py/WlhvelFu8-Q, it seems the 
 scheduler can be adapted for multiple cores). And if that is the case, is 
 there any special design on web2py scheduler itself for the communication 
 between master instance and others? 


each scheduler instance is a process. there's no piece of code in earth (in 
any programming language) that'll make a program go on a specific 
processor: that's something only the underlying operating system manages. 
The only communication needed is the connection to the 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.


[web2py] Re: Can't retrieve a picture for download function

2014-10-01 Thread Leonel Câmara
This error should never happen since that filename matches 
REGEX_UPLOAD_PATTERN, what version of web2py are you using?

-- 
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] translating the views

2014-10-01 Thread Pablo Angulo
I sometimes find very inconvenient the translate feature. Some views
contain a lot of static text, so if I want to translate it I would do:

p{{=T('I sometimes find very inconvenient the translate feature. Some
views contain a lot of text, so if I want to translate it I would
do:')}}/p

but if there are other html tags, I have to choose between:

{{=T('''pSome  strongimportant/strong text and other
liemphasizes/li items./p
pAnother paragraph/p
pand the last one/p''')}}

which is not ideal because any translator can break the DOM correctness
of the page for just one language, or
p{{=T('Some')}} strong{{=T(''important'')}}/strong ...

which is cumbersome, and the complete sentence may not make sense at all
if the pieces are translated at random order.

I'm considering using MARKMIN, so the view would be:

{{=MARKMIN(T('''
# Title

this is **bold** or ''italic'' and this [[a link http://web2py.com]]
'''))}}

But before I dive deeper: what do you think?

-- 
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: translating the views

2014-10-01 Thread Leonel Câmara
I think you shouldn't use the built in translation for big static texts. 
Static texts should be in the db in their different language versions and 
then you can pick the correct one using T.accepted_language.

-- 
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] Some dms (documental management system) on web2py?

2014-10-01 Thread damufo
Hi:
I search an dms (documental management system) as 
http://mayan.readthedocs.org/en/latest/contents.html than is in django.
I search some write on web2py, but not found anything.
Does anyone know any? Any idea?
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] Heroku: multiple dynos using Web2py

2014-10-01 Thread Louis Amon
I noticed a pretty nasty glitch while scaling my production server today :

The implementation of close_connection() in dal.py doesn't work well with 
multiple dynos in a cloud hosting solution.

Here's the code I have, runnint web2py 2.9.5 :


def close_connection(self):

if self.db is not None:

self.db.executesql(

DELETE FROM web2py_filesystem WHERE path='%s' % 
self.filename)

query = INSERT INTO web2py_filesystem(path,content) VALUES 
('%s','%s')\

% (self.filename, self.data.replace(',''))

self.db.executesql(query)

self.db.commit()

self.db = None


I'm getting tons of tickets like this one :
class 'psycopg2.IntegrityError' duplicate key value violates unique 
constraint web2py_filesystem_pkey DETAIL: Key 
(path)=(applications/*/databases/f1bf5dc7f74c28ea704f3313ce9b1535_**.table)
 
already exists.


I think both dynos are trying to do the INSERT operation at the same time, 
which shouldn't happen.

How can I fix this ? 

-- 
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 trunk is broken??

2014-10-01 Thread Johann Spies
On Tuesday, September 30, 2014 8:45:46 AM UTC-7, Anthony wrote:

 You'll need to get it from Github -- Google Code is broken at the moment
 (the commit is missing the entire new dal folder).



I have tried the github version now and it is broken:

 File /home/js/web2py/gluon/dal/base.py, line 891, in __getattr__
return ogetattr(self, key)
AttributeError: 'DAL' object has no attribute 'Table'



Regards
Johann

-- 
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 trunk is broken??

2014-10-01 Thread Niphlod
uhm. strange. did you care to prune the old dir before overwriting ? (i.e. 
you don't have a gluon/dal.py file) ?

On Wednesday, October 1, 2014 2:08:36 PM UTC+2, Johann Spies wrote:



 On Tuesday, September 30, 2014 8:45:46 AM UTC-7, Anthony wrote:

 You'll need to get it from Github -- Google Code is broken at the 
 moment (the commit is missing the entire new dal folder).


  
 I have tried the github version now and it is broken:

  File /home/js/web2py/gluon/dal/base.py, line 891, in __getattr__
 return ogetattr(self, key)
 AttributeError: 'DAL' object has no attribute 'Table'



 Regards
 Johann
  

-- 
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: Heroku: multiple dynos using Web2py

2014-10-01 Thread Niphlod
to be fair, you shouldn't have migration turned on on production. what 
you're seeing is some app trying to store the equivalent of .table files 
inside the db. Only one app should be allowed to do that, not both (i.e. 
only one frontend).

On Wednesday, October 1, 2014 2:07:58 PM UTC+2, Louis Amon wrote:

 I noticed a pretty nasty glitch while scaling my production server today :

 The implementation of close_connection() in dal.py doesn't work well 
 with multiple dynos in a cloud hosting solution.

 Here's the code I have, runnint web2py 2.9.5 :


 def close_connection(self):

 if self.db is not None:

 self.db.executesql(

 DELETE FROM web2py_filesystem WHERE path='%s' % 
 self.filename)

 query = INSERT INTO web2py_filesystem(path,content) VALUES 
 ('%s','%s')\

 % (self.filename, self.data.replace(',''))

 self.db.executesql(query)

 self.db.commit()

 self.db = None


 I'm getting tons of tickets like this one :
 class 'psycopg2.IntegrityError' duplicate key value violates unique 
 constraint web2py_filesystem_pkey DETAIL: Key 
 (path)=(applications/*/databases/f1bf5dc7f74c28ea704f3313ce9b1535_**.table)
  
 already exists.


 I think both dynos are trying to do the INSERT operation at the same time, 
 which shouldn't happen.

 How can I fix this ? 


-- 
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] ImportError: No module named myapp.modules

2014-10-01 Thread Alex


I've added a file to the modules folder, in a controller I import this 
module which works fine locally (Windows). When I deploy my application to 
the server (linux, apache) I get the following error when I try to import 
my module:

File web2pypath/gluon/custom_import.py, line 82, in custom_importer
modules_prefix, globals, locals, [itemname], level)
ImportError: No module named myapp.modules

I did not activate the custom importer (track_changes) and there is a file 
__init__.py (which is empty) in the modules folder. Does someone have an 
idea what could be wrong or what I could try to fix this?


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


[web2py] Re: ImportError: No module named myapp.modules

2014-10-01 Thread Leonel Câmara
How are you importing the module?

-- 
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: ImportError: No module named myapp.modules

2014-10-01 Thread Alex


import jasperclient

jasperclient is the module name (there is a file modules/jasperclient.py).

Am Mittwoch, 1. Oktober 2014 16:12:09 UTC+2 schrieb Leonel Câmara:

 How are you importing the module?


-- 
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: translating the views

2014-10-01 Thread pang
Let me check if I got your idea:

You mean I should create a table (slug,lang)-text

db.define_table('texts',
Field('slug', 'string'),
Field('language', 'string'),
Field('text', 'text')
)



and then use it in controllers and views like this:

def my_controller():
...
return dict(form=form,
text1=db.text(slug='info_help'),
)

{{=form}}
{{}}




-- 
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: translating the views

2014-10-01 Thread Leonel Câmara
That seems like a good solution. And yes you will need to make an interface 
in the backoffice for people to translate.

-- 
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: ImportError: No module named myapp.modules

2014-10-01 Thread Leonel Câmara
After you deployed your application with the module in the modules folder, 
did you restart apache?

-- 
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: ImportError: No module named myapp.modules

2014-10-01 Thread Alex
not until now. Restarting apache didn't make any difference.

Am Mittwoch, 1. Oktober 2014 16:53:01 UTC+2 schrieb Leonel Câmara:

 After you deployed your application with the module in the modules folder, 
 did you restart apache?


-- 
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: ImportError: No module named myapp.modules

2014-10-01 Thread Leonel Câmara
That's weird, it's normal to have to restart for web2py to detect new 
modules in the application, this should have solved the problem. How did 
you configure web2py and apache?

BTW if you're using Linux I seriously recommend a switch to nginx and 
uwsgi-emperor.

-- 
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: translating the views

2014-10-01 Thread lyn2py
Translation Markmin is available.

T.M('**bold** this text')

On Wednesday, October 1, 2014 6:03:44 PM UTC+8, Pablo Angulo wrote:

 I sometimes find very inconvenient the translate feature. Some views 
 contain a lot of static text, so if I want to translate it I would do: 

 p{{=T('I sometimes find very inconvenient the translate feature. Some 
 views contain a lot of text, so if I want to translate it I would 
 do:')}}/p 

 but if there are other html tags, I have to choose between: 

 {{=T('''pSome  strongimportant/strong text and other 
 liemphasizes/li items./p 
 pAnother paragraph/p 
 pand the last one/p''')}} 

 which is not ideal because any translator can break the DOM correctness 
 of the page for just one language, or 
 p{{=T('Some')}} strong{{=T(''important'')}}/strong ... 

 which is cumbersome, and the complete sentence may not make sense at all 
 if the pieces are translated at random order. 

 I'm considering using MARKMIN, so the view would be: 

 {{=MARKMIN(T(''' 
 # Title 

 this is **bold** or ''italic'' and this [[a link http://web2py.com]] 
 '''))}} 

 But before I dive deeper: what do you think? 



-- 
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] Storing 3rd Party Authentication and Executing Method In View

2014-10-01 Thread Patrick
Hello,

I'm working on a personal project using Rackspace's pyrax bindings to 
create a Control Panel. I've made some progress however am confused on a 
few things and could use some guidance.

1) Correctly storing authenticated user data. 

e.g.

I have a module called rs_auth.py that takes username/apikey and 
authenticates to the service.

import pyrax

def cloud_auth(username, apikey):
pyrax.set_setting(identity_type, rackspace)
ctx = pyrax.create_context(username=username, api_key=apikey)
try:
if ctx.authenticated == 'True':
pass
else:
ctx.authenticate()
except Exception as e:
return e
return ctx

I have tried doing session.dbaas = rs_auth.cloud_auth(session.username, 
session.apikey however this ends up not working and I have to instantiate 
dbaas = rs_auth.cloud_auth(session.username, session.apikey) in every 
controller function that requires to interact with the service. I'm sure 
there is a simpler way.

For example, databases.py:

def index():
if not session.username:
redirect(URL('default', 'login'))
else:
*dbaas = rs_auth.cloud_auth(session.username, session.apikey)*
ord_d = dbaas.ORD.database.client
dfw_d = dbaas.DFW.database.client
iad_d = dbaas.IAD.database.client
syd_d = dbaas.SYD.database.client
hkg_d = dbaas.HKG.database.client
cdb = (ord_d, dfw_d, iad_d, syd_d, hkg_d)
return dict(cdb=cdb)


def instance():
*dbaas = rs_auth.cloud_auth(session.username, session.apikey)*
region = request.args(0)
dbi = request.args(1)
instance = None
try:
if region == DFW:
instance = dbaas.DFW.database.client.get(dbi)
elif region == ORD:
instance = dbaas.ORD.database.client.get(dbi)
elif region == IAD:
instance = dbaas.IAD.database.client.get(dbi)
elif region == SYD:
instance = dbaas.SYD.database.client.get(dbi)
elif region == HKG:
instance = dbaas.HKG.database.client.get(dbi)
except Exception as e:
return e
return dict(instance=instance)

2) Executing a object method in a view. 

e.g. From the above instance function, a database is looked up and then 
returned to the view, instance.html.

{{extend 'layout.html'}}
Name: {{=instance.name}} br /
ID: {{=instance.id}} br /
Hostname: {{=instance.hostname}} br /
Status: {{=instance.status}} br /
Volume size: {{=instance.volume.size}} br /
Volume used: {{=instance.volume.used}} br /
*INPUT type=button value=Reboot onclick= / br / (no clue what to 
do here)*
INPUT type=button value=Back 
onclick=location.href='{{=URL('index')}}' /

There is a method available for the object, instance.restart(), but I've 
been unable to figure out how to execute it, (do I have to create a 
separate restart function to actually call the objects restart method? 
Having read the book I /think/ ajax/jquery would be the solution however I 
greatly lack skills in those areas.

Thus with that being mentioned, the issues here are most likely due to lack 
of know how on my end, if any references could be provided to provide a 
clearer understanding, it would be greatly appreciated.

-- 
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: ImportError: No module named myapp.modules

2014-10-01 Thread Leonel Câmara
Another idea, delete all .pyc files in your modules folder. Restart apache 
and try again.

-- 
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: Can't retrieve a picture for download function

2014-10-01 Thread Kenneth
2.5.1-stable


Den onsdagen den 1:e oktober 2014 kl. 12:54:51 UTC+3 skrev Leonel Câmara:

 This error should never happen since that filename matches 
 REGEX_UPLOAD_PATTERN, what version of web2py are you using?


-- 
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: Upgrading an old version - will my app work?

2014-10-01 Thread Marko Poutiainen
Looks like there's some issues with running the application. Those files pn 
mentioned were already there but I get the following (couldn't find 
anything about this in the changelog):

 type 'exceptions.TypeError' define_tables() got an unexpected keyword 
 argument 'signature'


This is the code:

from gluon.tools import Auth, Crud, Service, PluginManager, prettydate
auth = Auth(db)
crud, service, plugins = Crud(db), Service(), PluginManager()

## create all tables needed by auth if not custom tables

auth.define_tables(username=False, signature=False)

This was generated by the wizard. 

-- 
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: Can't retrieve a picture for download function

2014-10-01 Thread Anthony
Looks like something is wrong with the filename. It should be of the form:

[tablename].[fieldname].[first 16 characters of UUID].[b16encoded original 
filename].[extension]

Instead, it looks like it includes a full (non-truncated) UUID and no 
b16encoded filename. Was the file originally stored via a custom_store 
method?

Anthony

On Wednesday, October 1, 2014 12:27:46 AM UTC-4, Kenneth wrote:

 Hello,

 TAG.img(_height=50, _src=URL(r=request, c='default', f='download', 
 args=[value]))

 gives me:

 type 'exceptions.TypeError' Can't retrieve 
 product.image.4dfd23fe-ba46-43a0-9def-6bdbc929a68c.jpg


 This has worked before, the problem is that I have no idea when this has 
 stopped working, migth be years. The product.image.4dfd23fe file does exist 
 in uploads folder. 


 Kenneth





-- 
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: Upgrading an old version - will my app work?

2014-10-01 Thread Niphlod
you're having a problem with the upgrade. auth.define_tables() didn't 
change anything, and *signature* is a valid argument for it check again 
if your current version of web2py is correctly updated.

On Wednesday, October 1, 2014 8:40:49 PM UTC+2, Marko Poutiainen wrote:

 Looks like there's some issues with running the application. Those files 
 pn mentioned were already there but I get the following (couldn't find 
 anything about this in the changelog):

 type 'exceptions.TypeError' define_tables() got an unexpected keyword 
 argument 'signature'


 This is the code:

 from gluon.tools import Auth, Crud, Service, PluginManager, prettydate
 auth = Auth(db)
 crud, service, plugins = Crud(db), Service(), PluginManager()

 ## create all tables needed by auth if not custom tables

 auth.define_tables(username=False, signature=False)

 This was generated by the wizard. 


-- 
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: Can't retrieve a picture for download function

2014-10-01 Thread Kenneth
Hi,

yes I use this function:

def makeThumbnail(dbtable,ImageID,size=(150,150)):
try:
thisImage=db(dbtable.id==ImageID).select()[0]
import os, uuid
from PIL import Image
except: return
if thisImage.image == :
return
im=Image.open(request.folder + 'uploads/' + thisImage.image)
im.thumbnail(size,Image.ANTIALIAS)
thumbName='product.image.%s.jpg' % (uuid.uuid4())
im.save(request.folder + 'uploads/' + thumbName,'jpeg')
thisImage.update_record(thumbnail=thumbName)
return


Den onsdagen den 1:e oktober 2014 kl. 21:53:53 UTC+3 skrev Anthony:

 Looks like something is wrong with the filename. It should be of the form:

 [tablename].[fieldname].[first 16 characters of UUID].[b16encoded original 
 filename].[extension]

 Instead, it looks like it includes a full (non-truncated) UUID and no 
 b16encoded filename. Was the file originally stored via a custom_store 
 method?

 Anthony

 On Wednesday, October 1, 2014 12:27:46 AM UTC-4, Kenneth wrote:

 Hello,

 TAG.img(_height=50, _src=URL(r=request, c='default', f='download', 
 args=[value]))

 gives me:

 type 'exceptions.TypeError' Can't retrieve 
 product.image.4dfd23fe-ba46-43a0-9def-6bdbc929a68c.jpg


 This has worked before, the problem is that I have no idea when this has 
 stopped working, migth be years. The product.image.4dfd23fe file does exist 
 in uploads folder. 


 Kenneth





-- 
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] Sharing a site, some thoughts and looking for feedback

2014-10-01 Thread Russ King
I have a site at http://netdecisionmaking.appspot.com  and related code at 
https://github.com/NewGlobalStrategy/NetDecisionMaking. It demonstrates an 
asynchronous group decision making solution using web2py.  Moving group 
decision making online seems to be an opportunity.  The internet 
transformed communication from the synchronous telephone to asynchronous 
messaging and websites.  To date no such revolution has taken place in 
group decision making with meetings, discussion and voting continuing to 
prevail despite the explosion of social networking solutions.  We now have 
MOOCs so why not MOODS (Massively Open On-line Decision Systems)?
  
The site is geared to providing a more structured approach to group 
decision making to complement existing mechanisms.  This could 
provide an alternative approach to deciding the way forward for web2py or 
anything else that a group are interested in.  If anyone has time to either 
feeback directly on the site or reply here that would be appreciated. 
 
The latest version features rudimentary integration with jointjs and 
networkx for making and visualising links between questions and actions and 
laying out a network for an event and it includes the haystack plugin for 
full text search which has been roughly modified to support GAE as the 
search back-end.  It is still very much a work in progress and a long way 
short of providing a platform to run the world but small organisations may 
find it useful to make group decisions without meetings or to focus 
meetings on points of genuine contention.  
 
The site also has some deployment of boostrap3 which I generally like - 
however neither formstyle seems to support the existing std 3 column layout 
so it would be good if this could become available. 
 
I was also hoping that SQLFORM might get some more html5 datatype widgets 
available such as the range control which I also like before it was 
deprecated - I think the new approach(s) needs to become somewhat 
established, explained and clearly better before the old ones cease to be 
developed. Some examples of alternatives with more being done client side 
using various frameworks would be helfpful.  Concern is that you raise the 
bar for users if javascript skills become required to get going.  It's a 
great strenght of web2py that you only really need a little python to get 
up and running.
  
Best regards
Russ 

-- 
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: Upgrading an old version - will my app work?

2014-10-01 Thread Marko Poutiainen
Argh, just realised what the issue seems to be. I installed from Ubuntu 
repositories and I'm still running 12.04 on that box - web2py is from 
2011..

-- 
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: ImportError: No module named myapp.modules

2014-10-01 Thread Alex


thanks for your help. Unfortunately I could not resolve the issue so far. I 
deleted all .pyc files and restarted apache, still does not work (there are 
no .pyc files in the modules folder now). what web2py or apache 
configuration could have an effect on this? are there any specific 
settings? web2py runs in virtualenv, could this be related with the problem 
somehow? I've compiled the app on my machine and deploy the compiled app on 
the linux server. All the compiled files are in the dir 'compiled'.


maybe offtopic - but why should I switch to nginx? performance is great and 
our server load is hardly measurable.

-- 
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: Can't retrieve a picture for download function

2014-10-01 Thread Anthony


 def makeThumbnail(dbtable,ImageID,size=(150,150)):

try:
 thisImage=db(dbtable.id==ImageID).select()[0]
 import os, uuid
 from PIL import Image
 except: return
 if thisImage.image == :
 return
 im=Image.open(request.folder + 'uploads/' + thisImage.image)
 im.thumbnail(size,Image.ANTIALIAS)
 thumbName='product.image.%s.jpg' % (uuid.uuid4())
 im.save(request.folder + 'uploads/' + thumbName,'jpeg')
 thisImage.update_record(thumbnail=thumbName)


Hmm, I don't see how automatic retrieval ever would have worked in the past 
if that's the code you use to store the thumbnails.

Anyway, instead of storing the image manually, you should let web2py handle 
it:

import cStringIO
thumb = cStringIO.StringIO()
im.save(thumb, format='JPEG') # Save the PIL image to the StringIO object.
thisImage.update_record(thumbnail=dbtable.thumbnail.store(thumb, thumbName))

If you want to stick with your custom storage, then you should create a 
custom_retrieve function for the thumbnail field to override the default 
retrieve method of the field:

def retrieve_thumb(name, path):
[get the file]
return (filename, stream)

db.define_table('mytable',
...
Field('thumbnail', 'upload', custom_retrieve=retrieve_thumb))

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.


[web2py] web2py.py -G configure issues? Trouble with /admin on GAE

2014-10-01 Thread lpg
Testing the latest 2.9.11 on GAE, seems like /admin app is breaking, since 
many static resources can't be found.
I used the new web2py.py -G  configure.
However it seems like the .yaml may not have all the static routes?

See Screenshot here:
https://www.dropbox.com/s/6zbb2zezmfrzhxe/Screenshot%202014-10-01%2019.24.36.png?dl=0

And here:
https://www.dropbox.com/s/ywk8spbyd79oah2/Screenshot%202014-10-01%2019.21.34.png?dl=0

-- 
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: ImportError: No module named myapp.modules

2014-10-01 Thread Leonel Câmara
You can not compile the app and deploy in another machine as pyc files are 
not portable. You should remove the compiled directory and compile it again 
on the server.
Then go to admin clear all sessions and cache.
Restart apache and try again.


As for nginx, I find that Apache and mod_wsgi are constantly creating 
strange and hard to find errors due to some arcane configuration option, 
also nginx is quite faster.


-- 
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] Additional Vars for SQLFORM.grid

2014-10-01 Thread Alfonso de la Guarda
Hi,

Currently i have a problem with a sqlform.grid

def retail_rates():
user = auth.user.id
customer = auth.user.customer
customer_service = request.vars.customer_service
currency = request.vars.currency
information = data_voip(customer_service)
if len(information) == 0:
redirect('voip_accounts')
code_tariff = %s%s % (information[0], information[4])
query = (db.tariffs_integrated.id==code_tariff)
form = SQLFORM.grid(query, fields=[db.tariffs_integrated.code_prefix,
   db.tariffs_integrated.description,
   db.tariffs_integrated.voice_rate],
editable=False, deletable=False, create=False,
details=False,
)
return dict(form=form, currency=currency, customer_service=customer_service)

The problem is basicly that i need include in the vars of the form
grid the currency and customer_service because in case that the user
performs a search a error message appears meanwhile the controller
needs both fields (and only keywords was send).

I hay try to add additional fields with

extra_element = INPUT(_type='hidden', _name='customer_service',
_value=customer_service)
form[0].insert(-1,extra_element)
extra_element = INPUT(_type='hidden', _name='currency', _value=currency)
form[0].insert(-1,extra_element)

But nothing, when i press search just kewords parameter is sended,
any ideas how to fix this

Thanks in advance


Saludos,


Alfonso de la Guarda
Twitter: @alfonsodg
Redes sociales: alfonsodg
   Telef. 991935157
1024D/B23B24A4
5469 ED92 75A3 BBDB FD6B  58A5 54A1 851D B23B 24A4

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