[web2py] Re: auth.wiki deployment issue

2015-09-07 Thread pj00016
Thanks for responding. Pythonanywhere.com has 2.9.12 installed. That is 
what I have installed on my local host as well. I do not see how to change 
versions on the pythonanywhere site.

Peter

On Monday, September 7, 2015 at 1:28:02 AM UTC-4, 黄祥 wrote:
>
> had you already tried the web2py latest version?
>
> best regards,
> stifan
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: How do I start the (workers of) queued tasks?

2015-09-07 Thread Phillip


*9-6-15: *The following code was expecting the scheduler to automatically 
start the queued workers:


for dataID in dataIDs:

  scheduler.queue_task(ImportData, [dataID], immediate=True, 
timeout=100)

# tried without immediate

# tried db.commit() after the loop or each queued task


Please tell me what I need to add to this loop to programmatically start 
workers after they are queued


To reiterate some of the previous notes, the task function is in a module 
and the queued tasks need to operate concurrently.

-- 
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: storing blob field on s3

2015-09-07 Thread Massimo Di Pierro
Sorry for the late reply:

pip install fs

Then on model:

import fs.s3fs
myfs = fs.s3fs.S3FS(bucket, prefix, aws_access_key, aws_secret_key)
db.define_table('image',Field('image','upload',uploadfs = myfs))

which is what you suggest basically. Should work our of the box.

On Sunday, 6 September 2015 19:44:20 UTC-5, Mark Graves wrote:
>
> Hey everyone,
>
> Quick question.
>
> Is there a quick workaround for storing a blob db field on s3?
>
> Would it work to set uploadfs = S3FS(bucket)?
>
> Or would I have to change it to an upload type field and then set the 
> uploadfs for the uploadfield?
>
> -Mark
>

-- 
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: storing blob field on s3

2015-09-07 Thread Mark Graves
Right.

No worries.

What about a field of type blob?

Will that also accept an uploadfs argument and act the same way?

Or do I have to store it as an upload?

On Mon, Sep 7, 2015 at 10:38 PM, Massimo Di Pierro <
massimo.dipie...@gmail.com> wrote:

> Sorry for the late reply:
>
> pip install fs
>
> Then on model:
>
> import fs.s3fs
> myfs = fs.s3fs.S3FS(bucket, prefix, aws_access_key, aws_secret_key)
> db.define_table('image',Field('image','upload',uploadfs = myfs))
>
> which is what you suggest basically. Should work our of the box.
>
>
> On Sunday, 6 September 2015 19:44:20 UTC-5, Mark Graves wrote:
>>
>> Hey everyone,
>>
>> Quick question.
>>
>> Is there a quick workaround for storing a blob db field on s3?
>>
>> Would it work to set uploadfs = S3FS(bucket)?
>>
>> Or would I have to change it to an upload type field and then set the
>> uploadfs for the uploadfield?
>>
>> -Mark
>>
> --
> 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/VuTTC40iWwI/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] custom validator error

2015-09-07 Thread kvthie0
Hello all,

I'm learning the inner workings of web2py and try to make a custom 
validator called IS_TIME_IN_RANGE (based on the IS_DATE_IN_RANGE 
validator). 

I saved the next code in : 
*www-data/web2py/applications/my_app/modules/customvalidators.py 
: *

*from gluon.validators import IS_TIME*

*class IS_TIME_IN_RANGE(IS_TIME):*

*def __init__(self,*
* minimum=None,*
* maximum=None,*
* error_message=None):*
*self.minimum = minimum*
*self.maximum = maximum*
*if error_message is None:*
*if minimum is None:*
*error_message = "Enter time on or before %(max)s"*
*elif maximum is None:*
*error_message = "Enter time on or after %(min)s"*
*else:*
*error_message = "Enter time in range %(min)s %(max)s"*
*IS_TIME.__init__(self,*
* error_message=error_message)*
*self.extremes = dict(min=self.minimum,*
* max=self.maximum)*

*def __call__(self, value):*
*ovalue = value*
*(value, msg) = IS_TIME.__call__(self, value)*
*if msg is not None:*
*return (value, msg)*
*if self.minimum and self.minimum > value:*
*return (ovalue, translate(self.error_message) % self.extremes)*
*if self.maximum and value > self.maximum:*
*return (ovalue, translate(self.error_message) % self.extremes)*
*return (value, None)*

*In models/db.py of my_app I added : *

*from customvalidators import IS_TIME_IN_RANGE*

*The function in controller/default :*

*def Schedule_Edit():*

*record = db.Schedules(request.args(0)) or redirect(URL('index'))*
*db.Schedules.Start_Time.requires = IS_TIME_IN_RANGE(minimum= 
'08:00:00',maximum= '10:00:00')*
*form = SQLFORM(db.Schedules,*
*   record=record)*
*if form.process().accepted:*
*session.flash = 'form accepted'*
*redirect(URL('Appl'))*
*elif form.errors:*
*response.flash = 'errors on form'*
*return dict(form = form)*

*And the corresponding view :*

*{{extend 'layout.html'}}*
*{{=form}}*

*The table definition "schedule" in models/db1.py :*

*db.define_table('Schedules',*
*Field('Schedule_Type', 'reference 
Schedule_Type',requires=IS_NOT_EMPTY()),*
*Field('Days', 'integer', requires=(IS_NOT_EMPTY(), 
IS_INT_IN_RANGE(1,8))),*
*Field('Start_Time',requires=(IS_TIME(), IS_NOT_EMPTY())),*
*Field('Stop_Time',requires=(IS_TIME(), IS_NOT_EMPTY())),*
*Field('Status', 'reference 
Status',requires=IS_NOT_EMPTY()),*
*auth.signature)*

Whenever I submit a form in Schedule_edit I get this error : 

* Validation error, field:Start_Time 
*

When I place the IS_TIME_IN_RANGE validator directly in models/db.py, I get 
the this error : 

* Validation error, field:Start_Time 
<__restricted__.IS_TIME_IN_RANGE object at 0x79df31d0>*

I've tried several hours to fix this problem but I don't know where to 
start exactly.
Any advice would be really appreciated. 

Regards, 

Koen. 

-- 
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] Matplotlib not loading on 2.12.3 while loading on 2.11.2

2015-09-07 Thread anonymous anonymous
I posted this question online and it seems that it would be useful to post 
it here.

tl;dr: I found a work around by creating a symbolic link to matplotlib in 
the modules folder.

http://stackoverflow.com/questions/32428845/why-does-matplotlib-not-work-on-a-digitalocean-vps-with-web2py

I've got a digitalocean droplet and I deployed web2py using this script 
.
 
I installed matplotlib as follows:


ssh root@ipdroplet
apt-get install python-matplotlib


and I can indeed import matplotlib if I simply run python on the command 
line after I've ssh'd. The problem is that when I run my app I get the 
following error:


 Cannot import module 
applications.app.modules.matplotlib

I'm guessing this has something to do with user www-data vs root but no 
idea how to resolve it. Any help much appreciated. The tips that are 
mentioned in this 
 
link unfortunately didn't help me.

Thanks

*EDIT*

I should also mention that I'm not using the binary version of web2py. I've 
also managed to run python as www-data by doing sudo -u www-data python and 
I can import matplotlib there just fine.

*EDIT2*

When I was running locally on web2py 2.11.2-stable it worked fine. On my 
server though I was under 2.12.3-stable. I'm guessing this is probably the 
reason.





-- 
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] auth_user_registration_key in web2admin

2015-09-07 Thread Dennis Bauszus
web2admin looks like just what i need to enable a super user to manage user 
profiles. however it doesn't seem to be possible to remove the pending 
status with web2admin, making it impossible to register user to an 
application that requires approval without the web2py admin logging on.

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] "Module proxy_http does not exist!" can't start Web2py

2015-09-07 Thread Chris Armour
Hello,

I want to use web2py for a Raspberry Pi project, but when I try to install 
the framework I get:

setting up apache modules
=
Module ssl already enabled
Module proxy already enabled
ERROR: /etc/apache2/mods-enabled/proxy_http.load is a dangling symlink!
ERROR: Module proxy_http does not exist!
Module headers already enabled
Module expires already enabled
Module wsgi already enabled
Module rewrite already enabled

Does anyone have any idea what the solution is to this? I have tried 
deleting the symlink file "/etc/apache2/mods-enabled/proxy_http.load" and 
that doesn't help. Is there some way to load the proxy_http module?

I've tried rerunning the install a few times with the same result. 

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

2015-09-07 Thread lenin . martinez
 Im triying import one test module form.py .

   Module
   class Form(object):
   def hi():
   return 'abc'
  
   my controller 
from form import form

but the app generate me one ticket with this error:

ImportError: No module named applications.apprueba.modules.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: "Module proxy_http does not exist!" can't start Web2py

2015-09-07 Thread Massimo Di Pierro
I do not know but I would recommend using the built-in rocket server on a 
raspberrypy or gunicorn or nginx. Not apache. Apache has lots of memory 
issue and it will crash your rpy very quickly.

On Monday, 7 September 2015 22:40:59 UTC-5, Chris Armour wrote:
>
> Hello,
>
> I want to use web2py for a Raspberry Pi project, but when I try to install 
> the framework I get:
>
> setting up apache modules
> =
> Module ssl already enabled
> Module proxy already enabled
> ERROR: /etc/apache2/mods-enabled/proxy_http.load is a dangling symlink!
> ERROR: Module proxy_http does not exist!
> Module headers already enabled
> Module expires already enabled
> Module wsgi already enabled
> Module rewrite already enabled
>
> Does anyone have any idea what the solution is to this? I have tried 
> deleting the symlink file "/etc/apache2/mods-enabled/proxy_http.load" and 
> that doesn't help. Is there some way to load the proxy_http module?
>
> I've tried rerunning the install a few times with the same result. 
>
> 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] Re: ImportError: No module named

2015-09-07 Thread Massimo Di Pierro
can you import it from a normal python shell from the folder where you 
defined it? is there a __init__.py in that folder?

On Monday, 7 September 2015 22:40:58 UTC-5, lenin.marti...@metamaxzone.com 
wrote:
>
>  Im triying import one test module form.py .
>
>Module
>class Form(object):
>def hi():
>return 'abc'
>   
>my controller 
> from form import form
>
> but the app generate me one ticket with this error:
>
> ImportError: No module named applications.apprueba.modules.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: auth.wiki deployment issue

2015-09-07 Thread 黄祥
please tried web2py latest version in your local first, after it's running 
well then please update the web2py in pythonanywhere
please backup your application first before doing the update and for 
pythonanywhere update please check this link
http://www.web2pyslices.com/slice/show/1942/upgrade-web2py-on-pythonanywhere

best regards,
stifan

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Error: unsupported format character 'n' (0x6e) at index 1

2015-09-07 Thread Heather Dawe
Hello there,

I am new to web2py - it is a brilliant framework thank you. I am running 
the latest version, defining my models and encountering this error when 
attempting to add a record to a table that defines a many-to-many 
relationship - when I attempt to add a record to table 
ModelInstanceDataItemValue (listed in the model code below). I have 
searched for solutions and can't find any. This may well be a beginner's 
problem but I can't see why it is throwing up the error. 

With thanks and best wishes,
Heather

db = DAL("postgres://heather:secret@localhost:5432/indyfabdb",migrate=True)

db.define_table('ItemType',
   Field('type'),
   Field('description'),
   format='%(type)s')

db.ItemType.type.requires = IS_NOT_IN_DB(db, db.ItemType.type)
db.ItemType.type.requires = IS_NOT_EMPTY()

db.define_table('DataItem',
   Field('name'),
   Field('type', 'reference ItemType'),
   format='%(name)s')

db.DataItem.name.requires = IS_NOT_IN_DB(db, db.DataItem.name)
db.DataItem.name.requires = IS_NOT_EMPTY()

db.define_table('DataSet',
   Field('name'),
   Field('location'),
   format='%(name)s')

db.DataSet.name.requires = IS_NOT_EMPTY()
db.DataSet.name.requires = IS_NOT_IN_DB(db, db.DataSet.name)
db.DataSet.location.requires = IS_NOT_EMPTY()

db.define_table('DataSetItem',
   Field('DataSetName', 'reference DataSet'),
   Field('DataItemName', 'reference DataItem'),
   Field('position'))

db.DataSetItem.position.requires = IS_NOT_EMPTY()

db.define_table('DataSetValidValue',
   Field('name'),
   Field('DataSet', 'reference DataSet'),
   Field('query', 'text'),
   format='%(name)s')

db.DataSetValidValue.name.requires = IS_NOT_EMPTY()
db.DataSetValidValue.query.requires = IS_NOT_EMPTY()

db.define_table('ModelType',
   Field('type'),
   Field('description'),
   format='%(type)s')

db.define_table('ModelInstance',
   Field('name'),
   Field('ModelType', 'reference ModelType'),
   format='%name)s')

db.ModelInstance.name.requires = IS_NOT_EMPTY()

db.define_table('ModelInstanceDataItemValue',
   Field('ModelInstance', 'reference ModelInstance'),
   Field('DataItem', 'reference DataItem'),
   Field('value'))

db.ModelInstanceDataItemValue.value.requires = IS_NOT_EMPTY()

-- 
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: Runtime error: unsupported format character

2015-09-07 Thread Heather Dawe
Thanks for your reply Dave. Sorry I missed it - I have posted a similar 
question above where I have listed my model code in the body of the 
question. 

On Thursday, 3 September 2015 02:04:28 UTC+1, Dave S wrote:
>
>
>
> On Tuesday, September 1, 2015 at 8:48:27 PM UTC-7, Heather Dawe wrote:
>>
>> Hi there,
>>
>> I am new to web2py. It is brilliant - thank you so much for its 
>> development. 
>>
>> I am using the latest stable version of web2py and am encountering this 
>> error when attempting to add a record to a particular table in my model
>>
>>  unsupported format character 't' (0x74) at 
>> index 1
>>
>> I have googled ' unsupported format 
>> character'  
>>
>
>> and have found a few similar issues on this forum but no real advised 
>> resolution apart from upgrade to the latest version of web2py (which I am 
>> running).
>>
>> Thank you in advance,
>> Heather
>>
>
>
> Can you post your table definitions?
>
> Can you show us anything about the input that causes the error?
>
> /dps
>  
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.