Re: [web2py] [noob]html not properly rendered, class="ten columns" has no effect on where the elements are positioned.

2012-05-16 Thread Keith Edmunds
On Tue, 15 May 2012 14:28:04 -0700 (PDT), shortempe...@gmail.com said:

> all I get is a page with elements placed on default location

I would start by looking in the browser at the page source, and see what
is wrong, and I'd check that the CSS file is being loaded. Once you know
how the HTML differs from what you expect, you should be able to start
finding out why.
-- 
"You can have everything in life you want if you help enough other people
get what they want" - Zig Ziglar. 

Who did you help today?


Re: [web2py] [noob]html not properly rendered, class="ten columns" has no effect on where the elements are positioned.

2012-05-16 Thread Johann Spies
On 15 May 2012 23:28, Vinit Mahedia  wrote:

> Below is my html file, although I specify where do I want to put each
> element, all I get is a page with elements placed on default location (left
> most side of the page).
>
> I am following this tutorialto 
> learn.
>
> Where do you specify something else than the left most side of the page?
Specifying the "ten columns" as a class for the div is an indication of how
wide the div will be and is not an indication on where on the screen the
text will be shown.

Regards
Johann

-- 
Because experiencing your loyal love is better than life itself,
my lips will praise you.  (Psalm 63:3)


[web2py] Re: web2py uWSGI cherokee -- I give up

2012-05-16 Thread Gour
On Tue, 15 May 2012 23:13:33 -0700 (PDT)
Lewis  wrote:

> I hadn't realized Cherokee had been abandoned.  

Who told you that?

The main developer is busy with a new job and slowly working on a new
version which should support SPDY protocol.


Sincerely,
Gour

-- 
Never was there a time when I did not exist, 
nor you, nor all these kings; nor in the future 
shall any of us cease to be.

http://atmarama.net | Hlapicina (Croatia) | GPG: 52B5C810


signature.asc
Description: PGP signature


Re: [web2py] Re: web2py uWSGI cherokee -- I give up

2012-05-16 Thread Roberto De Ioris

> Thanks.  The versions I got were in the apt-get repositories for that
> version of Ubuntu.
>
> I hadn't realized Cherokee had been abandoned.


not abandoned, it is "on hold" ("or slowed down" in development)


-- 
Roberto De Ioris
http://unbit.it


Re: [web2py] Re: web2py uWSGI cherokee -- I give up

2012-05-16 Thread Roberto De Ioris

>>
>>
>> I hadn't realized Cherokee had been abandoned.   I am not in love with
>> anything. I can go back to Apache.  It is certainly well-documented and
>> well-supported.
>> Is Nginx the cat's meow?  My site is not at all performance bound.  I
>> was
>> just looking for an easier option.
>>
>
> uwsgi has a built-in webserver which is quite performant, you can find
> the
> solution I provided in in the group list
>

I have seen of lot of users/customers moving in that direction.

Expecially if you host assets on a dedicated cdn, having a simple http proxy
for your app seems to be a reasonable choice.

Maybe it is time to add https support...

-- 
Roberto De Ioris
http://unbit.it


Re: [web2py] Re: web2py uWSGI cherokee -- I give up

2012-05-16 Thread Vasile Ermicioi
>
> Maybe it is time to add https support...


that would be great... ))


and I know you are not interested in, but I would like also a windows
version


[web2py] Custom form with default values...

2012-05-16 Thread Jason Brower

Many values I don't need to show in the view so I have done this:
def join():
'''
NOTES:Covers the event bio and any payments if needed.
'''
event_details = db.event[request.args(0)]
if not event_details:
redirect(URL('default', 'index'))
attender_count = db(db.event_attender.event == request.args(0)).count()
event_full = attender_count >= event_details.maximum_attendance
payment_needed = event_details.ticket_cost
db.event_attender.event.default = request.args(0)
bio_form = crud.create(db.event_attender)
return dict(event_full = event_full,
payment_needed = payment_needed,
event_details = event_details,
bio_form = bio_form)

With this in the view:

{{=bio_form.custom.begin}}
Show Attendance: {{=bio_form.custom.widget.show_attendance}}
{{=bio_form.custom.widget.bio_text}}
{{=bio_form.custom.submit}}
{{=bio_form.custom.end}}
If I print the form with {{=bio_form}} it works just fine, but I see all 
the extra data fields.

Is there a way to fix this?
For a golden star I have the model as follows:
# -*- coding: utf-8 -*-
db.define_table('event_attender',
Field('attender', db.auth_user),
Field('event', db.event),
Field('role', 'string', default="attender"),
Field('status', 'string', default="not_present"),
Field('show_attendance', 'boolean', default=True),
Field('bio_text', 'text'),
Field('QR_quick_connect', 'string')
)

db.event_attender.role.requires = IS_IN_SET(["attender", 'admin', 
'organizer', 'speaker', 'booth'])
db.event_attender.status.requires = IS_IN_SET(["present", 'not_present', 
'banned'])
db.event_attender.attender.requires = 
IS_IN_DB(db,db.auth_user.id,'%(nickname)s')

db.event_attender.event.requires = IS_IN_DB(db,db.event.id,'%(name)s')
db.event_attender.bio_text.widget = lambda field,value: \
SQLFORM.widgets.text.widget(field,value,_class='text nicedit', 
_style="color:red")

if auth.is_logged_in():
db.event_attender.attender.default = auth.user.id

Best Regards,
Jason Brower


[web2py] Two LEFT JOINs and left=

2012-05-16 Thread Annet
How would I code this query in web2py using left=

SELECT organization.name, hub.name
FROM node LEFT JOIN organization ON node.id = organization.nodeID
LEFT JOIN hub ON node.id = hub.nodeID;


Kind regards,

Annet


[web2py] https for login

2012-05-16 Thread Lewis
I have been trying to add force https for login with apache directives to 
no avail.  Ideally, I would have a redirect, rather than simply "access 
denied" (not fair to expect a user to know to try https and type it in 
manually like we all do for admin and appadmin).  I guess I don't get 
regexp or apache.

Note that for apache config on ubuntu,  symlinks are used to access the 
virtual hosts for ports 80 and 443, so each is in a separate file instead 
of one big httpd.conf file.

I can't get apache to load and the error suggests that the aliasmatch 
directives are either in the wrong place or are expressed incorrectly.  

If someone has a recipe/slice for this, that would be great.  You could 
skip the remaining, gory details... !

Here are the port 80 (http) directives I tried using RewriteRules:


> ServerAdmin m...@me.org
> Alias /Test /var/www/Test
> WSGIScriptAlias /myapp "/usr/local/www/wsgi-scripts/myapp/myapp.wsgi"
> 
> AllowOverride None
> Order allow,deny
> Allow from all
> 
>
 

RewriteEngine On
> RewriteCond %{HTTPS} !=on
> RewriteRule ^/?(.*)/user/(.*) https://%{SERVER_NAME}/user/$1 [R,L]
>
> #routing for web2py
>
> WSGIDaemonProcess web2py user=www-data group=www-data
> WSGIProcessGroup web2py
> WSGIScriptAlias / /var/web2py/wsgihandler.py
> 
> AllowOverride None
> Order Allow,Deny
> Deny from all
> 
> Allow from all
> 
> 


#aliases to pages that must be visible outside of web2py
> AliasMatch ^/([^/]+)/static/(.*) \
>/var/web2py/applications/$1/static/$2
> 
> Options -Indexes
> Order Allow,Deny
> Allow from all
> 
> 
> Deny from all
> 
> 
> Deny from all
> 


Here are the port 443 (https:) directives:


> 
> ServerAdmin m...@me.org
> # DocumentRoot /var/www  # I never understood this part!
> # 
> # Options FollowSymLinks
> # AllowOverride None
> # 
> # 
> # Options Indexes FollowSymLinks MultiViews
> # AllowOverride None
> # Order allow,deny
> # allow from all
> # 
> ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
> 
> AllowOverride None
> Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
> Order allow,deny
> Allow from all
> 
> Alias /phppgadmin /usr/share/phppgadmin
> 
> AllowOverride None
> Order Allow,Deny
> Allow from all
> 
>
> Alias /phpmyadmin /usr/share/phpmyadmin
> 
> AllowOverride None
> Order Allow,Deny
> Allow from all
> 
>
> # routings for web2py admin interface via ssl only (port 443)
> WSGIProcessGroup web2py
> WSGIScriptAlias / /var/web2py/wsgihandler.py
> 
> AllowOverride None
> Order Allow,Deny
> Deny from all
> 
> Allow from all
> 
> 
> AliasMatch ^/([^/]+)/static/(.*) \
> /var/web2py/applications/$1/static/$2
>   
> Options -Indexes
> ExpiresActive On
> ExpiresDefault "access plus 1 hour"
> Order Allow,Deny
> Allow from all
>
>
>
> # other settings 
>
> ErrorLog ${APACHE_LOG_DIR}/error.log
> # Possible values include: debug, info, notice, warn, error, crit,
> # alert, emerg.
> LogLevel warn
> CustomLog ${APACHE_LOG_DIR}/ssl_access.log combined
> Alias /doc/ "/usr/share/doc/"
> 
> Options Indexes MultiViews FollowSymLinks
> AllowOverride None
> Order deny,allow
> Deny from all
> Allow from 127.0.0.0/255.0.0.0 ::1/128
> 
> #   SSL Engine Switch:
> #   Enable/Disable SSL for this virtual host.
> SSLEngine on
> #   A self-signed (snakeoil) certificate can be created by installing
> #   the ssl-cert package. See
> #   /usr/share/doc/apache2.2-common/README.Debian.gz for more info.
> #   If both key and certificate are stored in the same file, only the
> #   SSLCertificateFile directive is needed.
> SSLCertificateFile/etc/apache2/ssl/apache.pem
> SSLCertificateKeyFile /etc/apache2/ssl/apache.key


Here is the Apache log (error on last line):

[Wed May 16 08:05:22 2012] [warn] RSA server certificate is a CA 
> certificate (BasicConstraints: CA == TRUE !?)
> [Wed May 16 08:05:22 2012] [warn] RSA server certificate is a CA 
> certificate (BasicConstraints: CA == TRUE !?)
> [Wed May 16 08:05:22 2012] [warn] mod_wsgi: Compiled for Python/2.7.2rc1.
> [Wed May 16 08:05:22 2012] [warn] mod_wsgi: Runtime using Python/2.7.2+.
> [Wed May 16 08:05:22 2012] [notice] Apache/2.2.20 (Ubuntu) 
> PHP/5.3.6-13ubuntu3.3 with Suhosin-Patch mod_ssl/2.2.20 OpenSSL/1.0.0e 
> mod_wsgi/3.3 Python/2.7.2+ configured -- resuming normal operations
> [Wed May 16 08:12:57 2012] [notice] caught SIGTERM, shutting down
> [Wed May 16 08:12:58 2012] [warn] RSA server certificate is a CA 
> certificate (BasicConstraints: CA == TRUE !?)
> [Wed May 16 08:12:58 2012] [warn] RSA server certificate is a CA 
> certificate (BasicConstraints: CA == TRUE !?)
> [Wed May 16 08:12:58 2012] [warn] mod_wsgi: Compiled for Python/2.7.2rc1.
> [Wed May 16 08:12:58 2012] [warn] mod_wsgi: Runtime using Python/2.7.2+.
> [Wed May 16 08:12:58 2012] [notice] Apache/2.2.20 (Ubuntu) 
> PHP/5.3.6-13ubuntu3.3 with Suhosin-Patch mod_ssl/2.2.20 OpenSSL/1.0.0e 
> mod_wsgi/3.3 Python/2.7.2+ configured -- resuming normal operations
> [Wed May 16 08:13:48 2012] [error] [client 76.104.195.84] File does not

[web2py] Re: Two LEFT JOINs and left=

2012-05-16 Thread Annet
I tried:

row=db().select(db.Organization.name,db.Hub.name,\
left=[db.Node.on(db.Node.id==db.Organization.nodeID),db.Node.on(db.Node.id==db.Hub.nodeID)]).first()

but that results in:

 invalid reference to FROM-clause entry 
for table "organization" LINE 1: ...OM Organization, Hub LEFT JOIN Node ON 
(Node.id = Organizati... ^ HINT: There is an entry for table 
"organization", but it cannot be referenced from this part of the query. 

Annet


[web2py] Re: Questions about background process using homemade task queue

2012-05-16 Thread Niphlod
you can do what you want, celery is a task queue "handler" on steroids. 
with that you can pass messages, assign more workers if your "message 
queue" is lagging behind (i.e. 2 workers if the queue contains < 100 
updates, 8 workers if queue contains > 1000) and so on.
For basic task you can roll your own, but if your requirements may vary in 
time (and general "dimensions") you'll end up with celery anyway.

I know that seems overkill, but it comes batteries included, with init 
scripts, supervisord confs, daemons, it's heavily tested, etc. etc. etc.

Il giorno mercoledì 16 maggio 2012 02:24:00 UTC+2, cyan ha scritto:
>
>
> I think I'm not mistaken by saying that celery is the most used library 
>> for this kind of operations, it's written in python and founded on rabbitMQ 
>> (also on others, but primarily rabbit) to handle queues. Seems huge, but 
>> it's fairly easy to setup (especially if you planned to use rabbitmq 
>> anyway) and can be used with a few statements to make very simple tasks, 
>> but can be extremely fine-tuned for most of the requirements out there.
>>
>
> A follow-up question, I'm a bit puzzled by the differences between Celery 
> and RabbitMQ. Is Celery the same idea as the built-in scheduler of web2py? 
> In particular, in my specific case, I just need to a channel which 
> transports data from one server to the other, and receiving end will save 
> these data into a database. For that, I guess RabbitMQ alone is sufficient. 
> Why do I need an extra Celery task queue? Is it for some scaling 
> consideration - that is, when I have multiple instances of server on each 
> end? Thanks.
>


Re: [web2py] Custom form with default values...

2012-05-16 Thread Johann Spies
On 16 May 2012 09:43, Jason Brower  wrote:

>
> If I print the form with {{=bio_form}} it works just fine, but I see all
> the extra data fields.
> Is there a way to fix this?
>

Yes.  'bio_form' contains the whole form with all the fields including
hidden ones..  In your view you chose to  show only some of the fiields.
If you want to print only some of the fields, you must spesify which fields
must be printed otherwise it will print everything in bio_form.

Regards
Johann
-- 
Because experiencing your loyal love is better than life itself,
my lips will praise you.  (Psalm 63:3)


Re: [web2py] Re: Two LEFT JOINs and left=

2012-05-16 Thread Johann Spies
On 16 May 2012 10:51, Annet  wrote:

> I tried:
>
> row=db().select(db.Organization.name,db.Hub.name,\
> left=[db.Node.on(db.Node.id==db.Organization.nodeID),db.Node.on(db.Node.id
> ==db.Hub.nodeID)]).first()
>
> but that results in:
>
>  invalid reference to FROM-clause entry
> for table "organization" LINE 1: ...OM Organization, Hub LEFT JOIN Node ON
> (Node.id = Organizati... ^ HINT: There is an entry for table
> "organization", but it cannot be referenced from this part of the query.


I have seen this in Postgresql and normally solve it by putting (in the
select part) the table referenced last so I would try

rows = db().select(db.Hub.name, db.Organization_name)...

Regards
Johann


-- 
Because experiencing your loyal love is better than life itself,
my lips will praise you.  (Psalm 63:3)


Re: [web2py] Re: Two LEFT JOINs and left=

2012-05-16 Thread Marin Pranjić
Can you post entire query generated using _select method?

On Wed, May 16, 2012 at 10:51 AM, Annet  wrote:

> I tried:
>
> row=db().select(db.Organization.name,db.Hub.name,\
> left=[db.Node.on(db.Node.id==db.Organization.nodeID),db.Node.on(db.Node.id
> ==db.Hub.nodeID)]).first()
>
> but that results in:
>
>  invalid reference to FROM-clause entry
> for table "organization" LINE 1: ...OM Organization, Hub LEFT JOIN Node ON
> (Node.id = Organizati... ^ HINT: There is an entry for table
> "organization", but it cannot be referenced from this part of the query.
>
> Annet
>


[web2py] How can you configure memcache and built-in cache to be present at the same time

2012-05-16 Thread Robert Clark

Is there a way to configure both MemcacheClient and the built-in cache at 
the same time?

We would like to use built-in cache to hold singleton or short-life python 
objects across requests (being a process-only cache it suits well) and 
Memcache for everything else (sessions and expensive-to-create application 
data).  It looks like we could configure memcache as described in the 
web2py book, so we're really after a way make another process-only cache 
available for selective use.

Thanks,
Rob

[web2py] Re: Schemas, search parth, auth_user and table definitions in modules

2012-05-16 Thread Johann Spies
The following code seems to have solved my problem (I replaced the class 
with a function to which db is passed by the controller):

def docs(db):
T = current.T
auth = current.session.auth
if auth:
auth_user = self.auth.user.id
else:
auth_user = None
request = current.request
akb_signature_uuid = signature(db)
dctabelle = set(['dc_location', 'dc_category',
'doccenter'])
db_tabelle = db.tables()
dbtabelle = set(db.tables())
if dctabelle - dbtabelle:
db.define_table('dc_location',
Field('location'),
akb_signature_uuid)
...

Regards
Johann



[web2py] External lib import issue ( opencv )

2012-05-16 Thread web2py_tn
Hey guys- I installed opencv and it works great integrated with python when 
I run it from the command line. Actually even web2py runs fine with opencv 
with the line of code "import cv" when I run it from the terminal.
My problem is with Aptana ( pydev ). When I run the project in pydev, 
"import cv" causes issues because the interpreter can't find/understand cv. 
When I go to the settings and look for the command that pydev runs, it 
looks like:  "/usr/bin/python -u /Users/bb/Workspace/web2py/web2py.py" And 
when I run the same command on the terminal, it works fine.
Can someone understand what's going on?


Re: [web2py] Re: Two LEFT JOINs and left=

2012-05-16 Thread Marin Pranjić
Also, can you try:

row=db().select(db.Organization.name ,
db.Hub.name ,\
left=[db.Organization.on(db.Node.id ==
db.Organization.nodeID),db.Hub.on(db.Node.id ==db.Hub.
nodeID)]).first()

Marin

On Wed, May 16, 2012 at 11:22 AM, Marin Pranjić wrote:

> Can you post entire query generated using _select method?
>
>
> On Wed, May 16, 2012 at 10:51 AM, Annet  wrote:
>
>> I tried:
>>
>> row=db().select(db.Organization.name,db.Hub.name,\
>> left=[db.Node.on(db.Node.id==db.Organization.nodeID),db.Node.on(
>> db.Node.id==db.Hub.nodeID)]).first()
>>
>> but that results in:
>>
>>  invalid reference to FROM-clause
>> entry for table "organization" LINE 1: ...OM Organization, Hub LEFT JOIN
>> Node ON (Node.id = Organizati... ^ HINT: There is an entry for table
>> "organization", but it cannot be referenced from this part of the query.
>>
>> Annet
>>
>
>


[web2py] Re: [noob]html not properly rendered, class="ten columns" has no effect on where the elements are positioned.

2012-05-16 Thread Anthony
My reply on Stack Overflow: http://stackoverflow.com/a/10609558/440323. Let 
me know if you have questions.

Anthony

On Tuesday, May 15, 2012 5:28:04 PM UTC-4, Vinit Mahedia wrote:
>
> Below is my html file, although I specify where do I want to put each 
> element, all I get is a page with elements placed on default location (left 
> most side of the page).
>
> I am following this tutorialto 
> learn.
>
>
> 
>   
> Web On Steroids
> {{response.files.append(URL('static','css/skelton.css'))}}
> {{include 'web2py_ajax.html'}}
>   
> 
>   
> 
>   tukker.me
>   
> 
>   
> 
>   Home
>   Help
>   Login 
>   Privacy
>  
> 
>   
> 
>   
> 
>   Messages With 300 Chars
>   
>   
> Register
>   
>   
>   
> About
> Terms
> Contact
>  
> 
> 
>
>

[web2py] Re: Custom form with default values...

2012-05-16 Thread Anthony
You could set the "readable" and "writable" attributes of the fields you 
want to hide to False. Another option is to use SQLFORM instead of Crud and 
pass the "fields" argument with a list of fields to include. In this case, 
SQLFORM is probably just as easy to use as Crud.

bio_form = SQLFORM(db.event_attender, fields=['show_attendance', 'bio_text'
]).process()

Anthony

On Wednesday, May 16, 2012 3:43:09 AM UTC-4, encompass wrote:
>
> Many values I don't need to show in the view so I have done this: 
> def join(): 
>  ''' 
>  NOTES:Covers the event bio and any payments if needed. 
>  ''' 
>  event_details = db.event[request.args(0)] 
>  if not event_details: 
>  redirect(URL('default', 'index')) 
>  attender_count = db(db.event_attender.event == 
> request.args(0)).count() 
>  event_full = attender_count >= event_details.maximum_attendance 
>  payment_needed = event_details.ticket_cost 
>  db.event_attender.event.default = request.args(0) 
>  bio_form = crud.create(db.event_attender) 
>  return dict(event_full = event_full, 
>  payment_needed = payment_needed, 
>  event_details = event_details, 
>  bio_form = bio_form) 
>
> With this in the view: 
>  
>  {{=bio_form.custom.begin}} 
>  Show Attendance: {{=bio_form.custom.widget.show_attendance}} 
>  {{=bio_form.custom.widget.bio_text}} 
>  {{=bio_form.custom.submit}} 
>  {{=bio_form.custom.end}} 
> If I print the form with {{=bio_form}} it works just fine, but I see all 
> the extra data fields. 
> Is there a way to fix this? 
> For a golden star I have the model as follows: 
> # -*- coding: utf-8 -*- 
> db.define_table('event_attender', 
>  Field('attender', db.auth_user), 
>  Field('event', db.event), 
>  Field('role', 'string', default="attender"), 
>  Field('status', 'string', default="not_present"), 
>  Field('show_attendance', 'boolean', default=True), 
>  Field('bio_text', 'text'), 
>  Field('QR_quick_connect', 'string') 
>  ) 
>
> db.event_attender.role.requires = IS_IN_SET(["attender", 'admin', 
> 'organizer', 'speaker', 'booth']) 
> db.event_attender.status.requires = IS_IN_SET(["present", 'not_present', 
> 'banned']) 
> db.event_attender.attender.requires = 
> IS_IN_DB(db,db.auth_user.id,'%(nickname)s') 
> db.event_attender.event.requires = IS_IN_DB(db,db.event.id,'%(name)s') 
> db.event_attender.bio_text.widget = lambda field,value: \ 
>  SQLFORM.widgets.text.widget(field,value,_class='text nicedit', 
> _style="color:red") 
> if auth.is_logged_in(): 
>  db.event_attender.attender.default = auth.user.id 
>
> Best Regards, 
> Jason Brower 
>


[web2py] Re: How can you configure memcache and built-in cache to be present at the same time

2012-05-16 Thread Anthony
Can't you just use cache.memcache for memcache and cache.ram/cache.disk as 
usual? The example in the book re-assigns cache.ram and cache.disk to point 
to cache.memcache, but I don't think that is required. Try just leaving 
that line out.

Anthony

On Wednesday, May 16, 2012 5:40:50 AM UTC-4, Robert Clark wrote:
>
>
> Is there a way to configure both MemcacheClient and the built-in cache at 
> the same time?
>
> We would like to use built-in cache to hold singleton or short-life python 
> objects across requests (being a process-only cache it suits well) and 
> Memcache for everything else (sessions and expensive-to-create application 
> data).  It looks like we could configure memcache as described in the 
> web2py book, so we're really after a way make another process-only cache 
> available for selective use.
>
> Thanks,
> Rob



[web2py] Re: web2py uWSGI cherokee -- I give up

2012-05-16 Thread John-Kim Murphy
These are the best guides for installing Web2Py + Cherokee:

   - 
   
http://stackoverflow.com/questions/4332514/set-up-cherokee-web2py-on-ubuntu-10-04-lucid/4528543#4528543
   - Based on my personal experience from installing Web2Py on Cherokee 
  about a year ago
   - 
   
http://www.web2pyslices.com/slice/show/1435/web2py-uwsgi-cherokee-on-ubuntu-1004
   
I'm not sure how much has changed since then...

John

On Wednesday, May 16, 2012 2:00:22 PM UTC+9, Lewis wrote:
>
> I thought Apache was hard.  Cherokee seems impossible to configure.  A web 
> ui doesn't help much if it doesn't work.  I have tried to follow the 
> application cookbook carefully.  I have failed in some fundamental way.  I 
> have to say that of the dozens of webpages I have looked, there are many 
> inconsistencies in the scripts and instructions for this configuration.  It 
> seems a very sad state of affairs.
>
> Here is what I have on Ubuntu 11.10:
> installed:
>cherokee
>cherokee-admin
>libcherokee-base0
>libcherokee-mod-libssl
>libcherokee-mod-rrd
>libcherokee-server0
>rrdtool
>uwsgi
>uwsgi-core
>uwsgi-plugin-python
>
> version of cherokee is v 1.2.2
> version of uwsgi is v 0.9.8.1-1
>
> That seems to be all of the dependencies anyone has ever mentioned.  Am I 
> missing anything?
>
> Here is my config.xml file, located in my web2py home (/var/web2py/):
> 
> /var/web2py/
> 
> wsgihandler
> 
> 127.0.0.1:40292
> 8
> 
> 
>
> There seem to be many variations in config.  Some people use  
> outside of the  tag.  Some people don't use mount point.  Some people 
> don't hard code the socket and simply refer to a file in /tmp.  
>
> I attempted to follow the cookbook for the config of cherokee via the web 
> ui:
>
>one virtual server: document root (/var/www)
>rules: regular expression: ^(/.+?/static/.+)$ with a static content 
> handler at /var/web2py/applications and i/o cache enabled
>  default: handler (uWSGI), Balancer (Failover),
> source: remote host, nickname (uWSGI 1), connection: 127.0.0.1:40292
>
> Perhaps it is easier to diagnose with the cherokee.conf file:  
> config!version = 001002002
> server!bind!1!port = 80
> server!bind!2!port = 443
> server!bind!2!tls = 1
> server!group = www-data
> server!ipv6 = 0
> server!keepalive = 1
> server!keepalive_max_requests = 500
> server!panic_action = /usr/share/cherokee/cherokee-panic
> server!pid_file = /var/run/cherokee.pid
> server!server_tokens = full
> server!timeout = 15
> server!tls = libssl
> server!tls!protocol!SSLv2 = 1
> server!user = www-data
> vserver!10!directory_index = index.html
> vserver!10!document_root = /var/www
> vserver!10!error_writer!filename = /var/log/cherokee/cherokee.error
> vserver!10!error_writer!type = file
> vserver!10!logger = combined
> vserver!10!logger!access!buffsize = 16384
> vserver!10!logger!access!filename = /var/log/cherokee/cherokee.access
> vserver!10!logger!access!type = file
> vserver!10!nick = default
> vserver!10!rule!101!document_root = /var/web2py/applications
> vserver!10!rule!101!handler = file
> vserver!10!rule!101!match = request
> vserver!10!rule!101!match!request = ^(/.+?/static/.+)$
> vserver!10!rule!1!handler = uwsgi
> vserver!10!rule!1!handler!balancer = failover
> vserver!10!rule!1!handler!balancer!source!10 = 1
> vserver!10!rule!1!handler!iocache = 1
> vserver!10!rule!1!match = default
> vserver!10!ssl_certificate_file = /etc/apache2/ssl/apache.pem
> vserver!10!ssl_certificate_key_file = /etc/apache2/ssl/apache.key
> source!1!host = 127.0.0.1:40292
> source!1!nick = uWSGI 1
> source!1!type = host
> 
>
> I start uwsgi with the following command in terminal starting in my web2py 
> home directory (/var/web2py):
> uwsgi -x config.xml -d /tmp/uwsgi.log
>
> The best I have ever done is have the cherokee index.html page come up, 
> but not with the above config.  At this point all I get is a 500 internal 
> server error.  I can send the logs if anyone things they would help--they 
> are gibberish to me.  
>
> A problem the uwsgi log does show is that it sees another instance of 
> uwsgi at the socket address.  IT IS VERY HARD TO KILL uwsgi. Normal linux 
> kill doesn't do it.  Only kill -KILL - seems to do it--and only 
> very inconsistently.  It is not clear to me if I need to start uwsgi 
> manually or if Cherokee will do it.  In any case, it just won't die so that 
> I can restart.  I really dread rebooting the VPS (linode) as I don't know 
> how many things will break and not restart normally. 
>
>
> (note that it is sudo kill... which only did the job once...)
>
> I am really at my wit's end here after hours of research and 
> reconfiguring.  These things are so fragile and poorly documented (except 
> for the cookbook, which is entirely clear as far as it goes--but like any 
> cookbook, it doesn't provide much in the way of diagnostics).  Such a waste 
> of time when we could be writing nice Python code for web2py sites...
>
>
>
>
>

[web2py] Re: quotes & invoices app

2012-05-16 Thread Alan Etkin
Check out this projects:

*GestionLibre* 
*FacturaLibre*

The first is an open source ERP software with a web2py app for the web 
interface. A Basic CRM and invoice generation system is available also. 
Although most of the current features are built for the wxPython 
application.

The second project is a web2py client app for electronic invoice (Afip, 
Argentina) web services. It manages company, customer and sales data.

Both were released with AGPLv3 
license

El martes, 15 de mayo de 2012 12:06:24 UTC-3, Gour escribió:
>
> Hello! 
>
> Is there some web2py appliance to create quotes & invoices, handling 
> customers etc. suitable for freelancers, iow. no corporate environment? 
>
> I'm aware about CRM, but didn't found anything for invoices... 
>
>
> Sincerely, 
> Gour 
>
> -- 
> The working senses are superior to dull matter; mind is higher 
> than the senses; intelligence is still higher than the mind; 
> and he [the soul] is even higher than the intelligence. 
>
> http://atmarama.net | Hlapicina (Croatia) | GPG: 52B5C810 
>


[web2py] Re: SNI or dedicated IP.

2012-05-16 Thread Ross Peoples
I'd never heard of SNI before, but looking at the Wikipedia page for 
it: http://en.wikipedia.org/wiki/Server_Name_Indication

This will NOT work. The main reason being that Python 2 (which web2py runs 
on) does not support SNI. Python 3.2 does, however. So until there is a 
web3py, SNI will not be an option unless you use it through Apache (and 
figure out how to enable it). It's still pretty new; they just added 
support for it to Java 7 and Qt 4.8 (which were both just released a few 
months ago). Just because the OS supports it doesn't mean that the 
applications or the frameworks for those applications supports it.

This quote seems to sum up SNI: "As of 2012 there are still many users of 
browsers that do not support SNI"

On Wednesday, May 16, 2012 1:33:48 AM UTC-4, Annet wrote:
>
> To be able to access web2py's admin online I had a dedicated IP address at 
> WebFaction, and referenced admin 
> with a subdomain: admin.mydomain.com. A few weeks ago I changed accounts and 
> when I asked for a dedicated IP 
> address they answered:
>
> The connection using SNI is just as strong as a normal SSL connection
> except that the domain is sent in cleartext.
>
> If you are not using a really old browser/OS combination
> you can just use SNI instead of getting a dedicated IP.
>
>
> Is anybody using SNI to access web2py's admin, how does it work, and how do I 
> set it up?
>
>
> Kind regards,
>
> Annet
>
>

[web2py] Re: quotes & invoices app

2012-05-16 Thread Alan Etkin
The second link is wrong. FacturaLibre is at 
http://code.google.com/p/pyafipws/source/checkout?repo=web2py-app

El miércoles, 16 de mayo de 2012 09:32:06 UTC-3, Alan Etkin escribió:
>
> Check out this projects:
>
> *GestionLibre* 
> *FacturaLibre*
>
>

[web2py] Re: https for login

2012-05-16 Thread Ross Peoples
You could force a redirect within web2py. I do this with most of my 
applications:

In a model:

if request.controller == 'default' and request.function == 'user':
   request.requires_https()

This will force all user operations (login, profile, reset_password, etc) 
to use HTTPS. The advantage to doing it through web2py rather than through 
the web server is that if you get sick of Apache, you don't have to worry 
about this again with your new web server.


[web2py] Re: https for login

2012-05-16 Thread Ross Peoples
By the way, in case you are wondering, I stopped using Apache once I tried 
Nginx. Configuration is much easier (in my humble opinion) and it's way 
faster. So I've been using Nginx for all of my stuff for over 6 months now 
and haven't looked back. However, I still try to write my applications to 
be server-agnostic when I can.

[web2py] How to use web2py DAL with sybase?

2012-05-16 Thread dlypka
I see this posting which has some sybase adapter code:
https://groups.google.com/forum/?fromgroups#!searchin/web2py/sybase/web2py/LXdEdc1th3M/8ZIOxE8tJQgJ
 

Is there anything else?

I have a need to use web2y + sybase at work.

Thanks.


Re: [web2py] Re: Error facebook login

2012-05-16 Thread www.diazluis.com
greetings.

I repeat this properly configured facebook

I have no write permission on / etc / hosts

I have write permission only for:
/ apache2
/ htdocs
/ web2py

not my domain provider allows me to create PTR type DNS
not as you would with CNAME

thanks for your time and help .. I'm still here waiting for a solution ...


El martes, 15 de mayo de 2012 18:03:40 UTC-4:30, mcm escribió:
>
> You need a domain name, a PTR record a CNAME whatever is good. 
> OR you can put *ANY* hostname you want in your /etc/hosts file and you 
> will see that facebook will accept that. 
>
>
> mic 
>
>
> 2012/5/15 Christian Foster Howes
> > i don't understand, 
> > 
> > 
> https://graph.facebook.com/oauth/authorize?redirect_uri=http%3A%2F%2Fjuegozona.com%2Fuser%2Flogin&response_type=code&client_id=225870074195502
>  
> > 
> > is not an option?  i think that is what facebook needs. 
> > 
> > cfh 
> > 
> > 
> > On 5/15/12 13:54 , www.diazluis.com wrote: 
> >> 
> >> Thanks for responding 
> >> 
> >> no, not possible. 
> >> would have to be able to specify a dns PTR type, and I have that option 
> >> 
> >> CAS system not work for me, I retornava error "infinite redirect" 
> >> 
> >> I had several customers excited about the idea of being able to log 
> into 
> >> facebook ... pity it does not work .. 
> >> 
> >> 
> >> El martes, 15 de mayo de 2012 12:50:42 UTC-4:30, howesc escribió: 
> >>> 
> >>> 
> >>> what are you using the generate the return URL that you pass to 
> facebook 
> >>> when you make the login request?  it looks like that is the culprit - 
> i 
> >>> always use a hostname and not IP address for the return URL. 
> >>> 
> >>> On Tuesday, May 15, 2012 7:17:02 AM UTC-7, : 
>  
>  
>  I'll try to explain better: 
>  I need my app to do login using facebook. 
>  
>  you can test in juegozona.com 
>  
>  juegozona.com is configured in the "panel WebFaction" to use the ip: 
>  108.59.6.232 
>  http://i.minus.com/iFYHPECFl6LpM.png 
>  
>  
>  when the visitor tries to login, facebook return to the page from 
>  which you made the request. 
>  
>  here I present the following error: 
>  http://i.minus.com/iyuafE7P1RyB.png 
>  
>  
>  in the browser address bar displays the following code: 
>  
>  
>  
> https://graph.facebook.com/oauth/authorize?redirect_uri=http%3A%2F%2F200.8.87.32%2Fuser%2Flogin&response_type=code&client_id=225870074195502
>  
>  
>  in which one can extract the ip address of return is: 200.8.87.32 
>  
>  
>  my config dns is: 
>  http://i.minus.com/ibod18TSOmp3vE.png 
>  http://i.minus.com/irFLEZdFvmfsS.png 
>  
>  
>  the facebook settings are correct: 
>  http://i.minus.com/iYiz3kKyMV1Ll.png 
>  
>  
>  what is the problem? 
>  
>  Díaz Luis 
>  Analista Programador Facultad de Odontología UC 
>  http://www.about.me/diazluis 
>  User Linux 532223 
>  
> >>> 
> > 
>


[web2py] Re: https for login

2012-05-16 Thread Anthony

>
>request.requires_https()
>

Yet another secret feature. :-) 


[web2py] update not updating

2012-05-16 Thread lucas
hello one and all,

trying to update, but not updating.  here is my code:

db.lecture_items.fileetag.writable = True
upload = db(db.lecture_items.id==uidi).select().first()
upload.update(fileetag='%s' % request.vars.etag)
db.commit()

i even threw in the commit and i have verified that request.vars.etag is a 
valid string and that upload.fileetag is getting filled with that value.  
but when i check it using psql for postgresql, the value is empty or null.  
here is the field structure:

Field('fileetag', length=128, default='', writable=False, 
readable=False),

thank you in advance and have a great day.  lucas



[web2py] Re: https for login

2012-05-16 Thread Ross Peoples
I only know about it because I submitted it :) We really need to open the 
book up for editing so that we can add these kinds of things.

On Wednesday, May 16, 2012 9:22:28 AM UTC-4, Anthony wrote:
>
>request.requires_https()
>>
>
> Yet another secret feature. :-) 
>


[web2py] Re: https for login

2012-05-16 Thread Anthony
On Wednesday, May 16, 2012 9:52:34 AM UTC-4, Ross Peoples wrote:
>
> I only know about it because I submitted it :) We really need to open the 
> book up for editing so that we can add these kinds of things.
>

+1 


[web2py] Re: https for login

2012-05-16 Thread Anthony
I'm tempted to say we should just go back to the old book app for the time 
being so we can do editing as well as have working reference links, an 
index, and a working TOC for the Deployment chapter (all of which are 
broken in the current book app).

Anthony

On Wednesday, May 16, 2012 10:01:14 AM UTC-4, Anthony wrote:
>
> On Wednesday, May 16, 2012 9:52:34 AM UTC-4, Ross Peoples wrote:
>>
>> I only know about it because I submitted it :) We really need to open the 
>> book up for editing so that we can add these kinds of things.
>>
>
> +1 
>


Re: [web2py] update not updating

2012-05-16 Thread Richard Vézina
I think that this is wrong : upload = db(db.lecture_items.id==uidi).
select().first()

try not use upload var at first, do this instead :

db(db.lecture_items.id==uidi).update(fileetag='%s' % request.vars.etag)

If still not working, you should investigate if "uidi" is really the id of
the record you attempt to update.

Also, you don't need to select a record to update it, just precise which
one in the "where clause" : db.lecture_items.id==uidi is equivalent to the
where clause in SQL :

http://web2py.com/books/default/chapter/29/6?search=update#count,-isempty,-delete,-update



Richard

On Wed, May 16, 2012 at 9:51 AM, lucas  wrote:

> hello one and all,
>
> trying to update, but not updating.  here is my code:
>
> db.lecture_items.fileetag.writable = True
> upload = db(db.lecture_items.id==uidi).select().first()
> upload.update(fileetag='%s' % request.vars.etag)
> db.commit()
>
> i even threw in the commit and i have verified that request.vars.etag is a
> valid string and that upload.fileetag is getting filled with that value.
> but when i check it using psql for postgresql, the value is empty or null.
> here is the field structure:
>
> Field('fileetag', length=128, default='', writable=False,
> readable=False),
>
> thank you in advance and have a great day.  lucas
>
>


[web2py] Re: update not updating

2012-05-16 Thread Anthony

>
> db.lecture_items.fileetag.writable = True
> upload = db(db.lecture_items.id==uidi).select().first()
> upload.update(fileetag='%s' % request.vars.etag)
> db.commit()
>

First, the writable attribute only determines whether the field will be 
displayed and editable in SQLFORMs -- you don't have to set it to do a 
manual update.

As for the update, the upload object you have created is a Row object. If 
you call the .update() method on it, you will only update the Row object 
itself, not the original record in the db. To update the db record, you 
have to do upload.update_record(...) -- see 
http://web2py.com/books/default/chapter/29/6#update_record. Also, if you 
don't need to do anything with the Row object (i.e., all you need to do is 
update the record), then no need to create the Row object to begin with -- 
just use the .update() method on the Set object:

db(db.lecture_items.id==uidi).update(fileetag='%s' % request.vars.etag)

Finally, if this is happening in a regular application request (i.e., not 
in a background process script or shell), you don't need db.commit().

Anthony


[web2py] Re: RFC: web2py-based workflow engine

2012-05-16 Thread Cliff
I have collected my thoughts into a specification, available at this 
link
.

Comments invited and welcome.

Thank you.

On Tuesday, May 1, 2012 12:00:42 PM UTC-4, Ross Peoples wrote:
>
> In reference to: 
> https://groups.google.com/forum/#!searchin/web2py/workflow/web2py/osEmmtu9hlg/2MHi_ZCeMBMJ
>
> Has anyone done any work on this yet? I was thinking about making a 
> web2py-based workflow engine.
>
> I mentioned previously that I built one of these for an application I 
> wrote several years ago, but it was built specifically for that app. This 
> will be my first attempt at making a general-use workflow engine, so let me 
> know if you find any problems with my design:
>
> Make a contrib module that is initialized like the Auth module:
> from gluon.contrib.workflow_engine import WorkflowEngine, Step
> workflow_engine = WorkflowEngine()
> workflow_engine.define_tables()
>
>
> I will use the example that I know best, which is passing around a sales 
> order throughout a company's departments. This first example would define a 
> workflow template because every sales order will have the same workflow:
> workflow_engine.add_template('Sales Order',
> Step(group_id=2, hours=4), # Engineering gets 4 hours to complete 
> their step
> Step(user_id=7, hours=0), # The engineering manager (user) has no 
> time limit
> Step(group_id=3, hours=2), # Quality department gets 2 hours to 
> inspect the order
> Step(group_id=8, hours=6.5), # Shipping department gets 6.5 hours to 
> ship order
> )
>
>
> You would start this workflow like this:
> workflow_id = workflow_engine.load_template('Sales Order', item_type=
> 'document', item_id=1)
> workflow_id = workflow_engine.
> workflow_engine.start(workflow_id)
>
>
> Optionally, a workflow can be created on the fly (if the workflow will 
> only be used once):
> workflow_id = workflow_engine.create_workflow('One-time Workflow', 
> 'document', 1 # same as item_type and item_id used in load_template()
> Step(group_id=2, hours=4)
> Step(group_id=3, due_date=request.now + datetime.timedelta(days=1)) # 
> set time limit to an exact datetime
> )
>
> workflow_engine.start(workflow_id) # start the workflow we just created
>
>
> We assume that we are going to associate this workflow with another 
> object. In this case, we will assume there is a table called "document" and 
> that the document we want to pass around has an id of 1. The "item_type" 
> argument allows you to pass around any type of database object. In this 
> case, we will call it the same thing as our table: "document".
>
> These are some common operations that could be done:
> workflow_engine.active_workflows() # returns a list of all active 
> workflows
> workflow_engine.active_workflows(user_id=1) # all active workflows for 
> the user_id
> workflow_engine.active_workflows(user_id=1, include_groups=True) # same 
> as above, but includes groups the user is a member of
> workflow_engine.active_workflows(group_id=2) # all active workflows for 
> the group_id
> workflow_engine.late_workflows() # returns a list of all late/overdue 
> workflows
> workflow_engine.step_complete(workflow_id, notes='General info about 
> completed task') # moves workflow to the next step
> workflow_engine.step_reject(workflow_id, to_step=2, notes='Why step was 
> rejected') # moves workflow back to step 2 incase there was a problem 
> with one of the previously completed steps
>
>
> Workflow triggers:
> workflow_engine.before_start = function(workflow, step)
> workflow_engine.after_start = function(workflow, step)
> workflow_engine.before_step_complete = function(workflow, step)
> workflow_engine.after_step_complete = function(workflow, step)
> workflow_engine.before_step_reject = function(workflow, step)
> workflow_engine.after_step_reject = function(workflow, step)
> workflow_engine.before_finish = function(workflow, step)
> workflow_engine.after_finish = function(workflow, step)
>
>
> Finally, (and I MIGHT do this) since we are using time limits in hours, we 
> should set some time ranges where users are available. For example, if the 
> company is only open from 8 AM to 5 PM, you wouldn't want something to be 
> late at 7 PM. You would want to roll over the extra 2 hours so that it 
> becomes late at 10 AM the next business day. A list of time ranges would be 
> created, and a user would be assigned to one of the time ranges. This would 
> accommodate users in different time zones or with different "work" hours. 
> Again, this last part I MIGHT do if I have enough time. I've done it 
> before, but I'm sure you can imagine how complicated this part is.
>
>
> So any questions, comments, improvements? Thanks!
>


[web2py] Re: quotes & invoices app

2012-05-16 Thread Gour
On Wed, 16 May 2012 05:32:06 -0700 (PDT)
Alan Etkin  wrote:

> Check out this projects:
> 
> *GestionLibre* 
> *FacturaLibre*

Thank you...Let me check it out...


Sincerely,
Gour


-- 
Before giving up this present body, if one is able to tolerate 
the urges of the material senses and check the force of desire and 
anger, he is well situated and is happy in this world.

http://atmarama.net | Hlapicina (Croatia) | GPG: 52B5C810


signature.asc
Description: PGP signature


[web2py] modules

2012-05-16 Thread Aurigadl
I always work with modules. In the latest versions of web2py not work.
doing the following to import:

from  applications.examples.modules import test

Restricting the application name.The modules are placed in the / app / 
modules/.
As this problem solved.



Re: [web2py] modules

2012-05-16 Thread Bruno Rocha
For that to work you need a bare __init__.py file in all directories and
subdirectories. /applications/__init__.py,
/applications/yourapp/__init__.py, .../modules/__init__.py

On Wed, May 16, 2012 at 12:13 PM, Aurigadl  wrote:

> I always work with modules. In the latest versions of web2py not work.
> doing the following to import:
>
> from  applications.examples.modules import test
>
> Restricting the application name.The modules are placed in the / app /
> modules/.
> As this problem solved.
>
>


-- 

Bruno Rocha
[http://rochacbruno.com.br]


[web2py] Re: External lib import issue ( opencv )

2012-05-16 Thread Wikus van de Merwe
Where is the opencv installed in your system? When you check python 
interpreters in PyDev options is that path on the list?

If you still struggling with it, a workaround could be to add the 
installation folder to the system path by hand:
import sys
sys.path.append("opencv")



[web2py] Re: RFC: web2py-based workflow engine

2012-05-16 Thread Ross Peoples
Cliff,

Thanks for putting this into a spec. My current code follows most of what 
is in there. I still haven't finished writing (or testing it), but I do 
have some thoughts on implementation for one or two of the items listed at 
the end:

I imagine a "workflow_monitor" table that has the fields: user_id, 
workflow_id. By default, when a workflow is started, the user that started 
gets added to this table along with the workflow they started. Using this, 
an application can design an interface that shows two lists: one listing 
workflows waiting on the user, and another listing workflows being 
monitored by the user. Templates should have to ability to set a default 
list of users or groups that automatically get added as monitoring the 
workflow. This would be great for managers to see a birds-eye view of 
everything going on for every person they manage.

Approvers should be part of the workflow, since it should not continue 
unless approved.

I'm not sure how to handle reviewers, since they don't really have any 
control over the workflow. Maybe reviewers can be marked as "monitoring", 
and when they need to comment on something, they just leave a note. For 
this, I see a "workflow_comment" table that has these fields: workflow_id, 
user_id, event_date, is_active, comment. The is_active field will be set to 
True by default. Once the comment / issue has been addressed, is_active 
gets set to False.

I could also imagine a high-level list of goals that need to be 
accomplished with the workflow, sort of like a checklist, that users mark 
as completed as the workflow moves through the system. This would probably 
satisfy a use case that exists in my current company. They currently use a 
page within a document as a "sign off" page to make sure everyone inspected 
their section of the document. Having this workflow checklist would remove 
the need for this extra page within the document.

Thoughts?

Thanks, Ross


[web2py] Re: Why the web2py shell returns different results?

2012-05-16 Thread sesenmaister
1.-both editor and shell use different type of encofing: sure

2.-both editor and shell throw the same answer: yes
>>> import sys
>>> sys.stdin.encoding
‘cp850'

3.-both editor and shell throw the same answer: yes
>>>import sys
>>>sys.getdefaultencoding()
'ascii'

4.-due to my lack of knowledge, I must be practical, and forget the 
environent encoding and go to the point directly

>>html_txt=urllib2.urlopen(url).read()
>>print html_txt.headers.getheader('Content-Type')
text/html; charset=iso-latin-1

ok, its encoding is iso-latin-1 (same as iso-8859-1) so, If I want my 
documents in UTF-8:
>>html_inPreferredEncoding=unicode(html_txt,'iso-8859-1').encode('utf-8')

the same as:
>>html_inPreferredEncoding=html_txt.unicode('iso-8859-1').encode('utf-8')




Re: [web2py] Re: Book Update - Chapter 9 - Pyjamas and jsonrpc

2012-05-16 Thread Massimo Di Pierro
I promise. Tonight.

On Tuesday, 15 May 2012 09:19:41 UTC-5, Anthony wrote:
>
> On Tuesday, May 15, 2012 10:12:32 AM UTC-4, Massimo Di Pierro wrote:
>>
>> Agreed.
>>
>
> Nevertheless, we need the book to be editable again so we can fix 
> all the other errors that have been reported and start documenting newer 
> features.  :-)
>
> Anthon
>


[web2py] Re: modules

2012-05-16 Thread Anthony
Are you importing from within the "examples" application? In that case you 
can just do:

import test

Anthony

On Wednesday, May 16, 2012 11:13:16 AM UTC-4, Aurigadl wrote:
>
> I always work with modules. In the latest versions of web2py not work.
> doing the following to import:
>
> from  applications.examples.modules import test
>
> Restricting the application name.The modules are placed in the / app / 
> modules/.
> As this problem solved.
>
>

[web2py] Re: AttributeError: 'thread._local' object has no attribute 'request'

2012-05-16 Thread Massimo Di Pierro
what python version and os version do you have?

On Tuesday, 15 May 2012 22:20:00 UTC-5, JungHyun Kim wrote:
>
> Hi. 
>
> I got a error "AttributeError: 'thread._local' object has no attribute 
> 'request'" when trying to run web2py with wsgi.
>
> The application was "welcome" which is sample application of web2py.
>
> in db.py
>
> from gluon.tools import Auth, Crud, Service, PluginManager, prettydate
> auth = Auth(db, hmac_key=Auth.get_or_create_key())
>
>
>
> and in gluon/tools.py
>
> @staticmethod
> def get_or_create_key(filename=None):
> request = current.request
>
>
>
> Variablesglobal currentrequestundefinedcurrent.
> requestundefined
>
> I have two questions about this.
>
> 1. Does global current variable mean thread._local ?
>
> 2. If then, why thread._local doesn't have request attribute? Did I set 
> wsgi configuration wrong?
>
>
> Thank you very much.
>
>
>

Re: [web2py] Re: Two LEFT JOINs and left=

2012-05-16 Thread Annet
Johann and Marin,

Thanks for your replies.

Also, can you try:
>
> row=db().select(db.Organization.name ,
> db.Hub.name ,\
> left=[db.Organization.on(db.Node.id ==
> db.Organization.nodeID),db.Hub.on(db.Node.id ==db.Hub.
> nodeID)]).first() 
>
>
This solved my problem!


Kind regards,

Annet. 


[web2py] Re: GAE datastore: how to unindex a field?

2012-05-16 Thread Wikus van de Merwe
This is really a GAE question, not related to web2py. By default the 
indexes are set automatically when you run your app in dev environment 
depending on what queries you use. But you can do it manually to by editing 
the index.yaml (above the #AUTOGENERATED line). On the next deploy the 
indexes will be updated.

To disable the autogenerated indexes and test your index definitions, you 
can run your app locally with:
dev_appserver.py --require_indexes

Read this article for more details:
https://developers.google.com/appengine/articles/indexselection



[web2py] Re: modules

2012-05-16 Thread Aurigadl
if you have:

/applications/examples/modules/prueba.py

$python web2py.py -S examples

>>import prueba

this does not work

But if you used:

>>from applications.examples.modules import prueba
this work very well.

way?? I have all whit the __init__py for import modules.


El miércoles, 16 de mayo de 2012 10:32:00 UTC-5, Anthony escribió:
>
> Are you importing from within the "examples" application? In that case you 
> can just do:
>
> import test
>
> Anthony
>
> On Wednesday, May 16, 2012 11:13:16 AM UTC-4, Aurigadl wrote:
>>
>> I always work with modules. In the latest versions of web2py not work.
>> doing the following to import:
>>
>> from  applications.examples.modules import test
>>
>> Restricting the application name.The modules are placed in the / app / 
>> modules
>>
>

[web2py] Re: How to use web2py DAL with sybase?

2012-05-16 Thread Massimo Di Pierro
web2py includes an adapter but nobody has tested it. If you can help us 
test it we can help you debug any problem that may arise. Compatibility 
with sybase and other SQL DB engines is a priority.



On Wednesday, 16 May 2012 07:47:59 UTC-5, dlypka wrote:
>
> I see this posting which has some sybase adapter code:
>
> https://groups.google.com/forum/?fromgroups#!searchin/web2py/sybase/web2py/LXdEdc1th3M/8ZIOxE8tJQgJ
>  
>
> Is there anything else?
>
> I have a need to use web2y + sybase at work.
>
> Thanks.
>


[web2py] Re: modules

2012-05-16 Thread Massimo Di Pierro
Please open a ticket in googlecode and give more details about your web2py 
version, python version and os version.

On Wednesday, 16 May 2012 10:40:54 UTC-5, Aurigadl wrote:
>
> if you have:
>
> /applications/examples/modules/prueba.py
>
> $python web2py.py -S examples
>
> >>import prueba
>
> this does not work
>
> But if you used:
>
> >>from applications.examples.modules import prueba
> this work very well.
>
> way?? I have all whit the __init__py for import modules.
>
>
> El miércoles, 16 de mayo de 2012 10:32:00 UTC-5, Anthony escribió:
>>
>> Are you importing from within the "examples" application? In that case 
>> you can just do:
>>
>> import test
>>
>> Anthony
>>
>> On Wednesday, May 16, 2012 11:13:16 AM UTC-4, Aurigadl wrote:
>>>
>>> I always work with modules. In the latest versions of web2py not work.
>>> doing the following to import:
>>>
>>> from  applications.examples.modules import test
>>>
>>> Restricting the application name.The modules are placed in the / app / 
>>> modules
>>>
>>

[web2py] Re: How to use web2py DAL with sybase? Please point me to the sybase adapter

2012-05-16 Thread dlypka

I do not see any reference to "sybase" in 1.99.7 dal.py.

Please point me to the sybase adapter.

There are 2 of us developers here at work who can test it for you on a 
large corporate sybase database.

Thanks.

On Wednesday, May 16, 2012 10:42:05 AM UTC-5, Massimo Di Pierro wrote:
>
> web2py includes an adapter but nobody has tested it. If you can help us 
> test it we can help you debug any problem that may arise. Compatibility 
> with sybase and other SQL DB engines is a priority.
>
>
>
> On Wednesday, 16 May 2012 07:47:59 UTC-5, dlypka wrote:
>>
>> I see this posting which has some sybase adapter code:
>>
>> https://groups.google.com/forum/?fromgroups#!searchin/web2py/sybase/web2py/LXdEdc1th3M/8ZIOxE8tJQgJ
>>  
>>
>> Is there anything else?
>>
>> I have a need to use web2y + sybase at work.
>>
>> Thanks.
>>
>

[web2py] Re: SNI or dedicated IP.

2012-05-16 Thread Annet
Hi Ross,

Thanks for the reply. I'll stick to the dedicated IP address solution.


Kind regards,

Annet


[web2py] require login on submit

2012-05-16 Thread Marco Prosperi
hi all, 
what could be a clean way to require login (if not already logged in) when 
a user clicks on the submit button of a form?

thanks in advance for advice

Marco


[web2py] Re: modules

2012-05-16 Thread Aurigadl
I did
Thank you for entering  Issue 
800



El miércoles, 16 de mayo de 2012 10:43:36 UTC-5, Massimo Di Pierro escribió:
>
> Please open a ticket in googlecode and give more details about your web2py 
> version, python version and os version.
>
> On Wednesday, 16 May 2012 10:40:54 UTC-5, Aurigadl wrote:
>>
>> if you have:
>>
>> /applications/examples/modules/prueba.py
>>
>> $python web2py.py -S examples
>>
>> >>import prueba
>>
>> this does not work
>>
>> But if you used:
>>
>> >>from applications.examples.modules import prueba
>> this work very well.
>>
>> way?? I have all whit the __init__py for import modules.
>>
>>
>> El miércoles, 16 de mayo de 2012 10:32:00 UTC-5, Anthony escribió:
>>>
>>> Are you importing from within the "examples" application? In that case 
>>> you can just do:
>>>
>>> import test
>>>
>>> Anthony
>>>
>>> On Wednesday, May 16, 2012 11:13:16 AM UTC-4, Aurigadl wrote:

 I always work with modules. In the latest versions of web2py not work.
 doing the following to import:

 from  applications.examples.modules import test

 Restricting the application name.The modules are placed in the / app / 
 modules

>>>

[web2py] change the size of a text field in a form

2012-05-16 Thread Marco Prosperi

hello, how can I change the default size of a 'text' field in a form? (at 
first appearance, not dragging the corner)

thanks

Marco


Re: [web2py] Re: GAE datastore: how to unindex a field?

2012-05-16 Thread Christian Foster Howes
actually the question at hand here i think is whether or not web2py can 
support indexed=False in the property constructor when defining GAE models:


https://developers.google.com/appengine/docs/python/datastore/propertyclass

class Property(verbose_name=None, name=None, default=None, 
required=False, validator=None, choices=None, indexed=True)


i was hoping there was a way to specify that in index.yaml so that we 
didn't have to do extra work in the web2py GAE dal.  i have not found 
that there is or is not a way to specify that in index.yaml.


cfh

On 5/16/12 8:39 , Wikus van de Merwe wrote:

This is really a GAE question, not related to web2py. By default the
indexes are set automatically when you run your app in dev environment
depending on what queries you use. But you can do it manually to by editing
the index.yaml (above the #AUTOGENERATED line). On the next deploy the
indexes will be updated.

To disable the autogenerated indexes and test your index definitions, you
can run your app locally with:
dev_appserver.py --require_indexes

Read this article for more details:
https://developers.google.com/appengine/articles/indexselection




[web2py] Re: SNI or dedicated IP.

2012-05-16 Thread Anthony

>
> I'd never heard of SNI before, but looking at the Wikipedia page for it: 
> http://en.wikipedia.org/wiki/Server_Name_Indication
>
> This will NOT work. The main reason being that Python 2 (which web2py runs 
> on) does not support SNI. Python 3.2 does, however. So until there is a 
> web3py, SNI will not be an option unless you use it through Apache (and 
> figure out how to enable it).
>

Wouldn't that only be a limitation with the Rocket server? But on 
WebFaction, the app would probably be served with 
Apacheor 
Nginx,
 
so should work, no?

Anthony 


[web2py] Re: change the size of a text field in a form

2012-05-16 Thread Anthony
You can do it via CSS:

textarea {width: 400px;}

Anthony

On Wednesday, May 16, 2012 11:59:14 AM UTC-4, Marco Prosperi wrote:
>
>
> hello, how can I change the default size of a 'text' field in a form? (at 
> first appearance, not dragging the corner)
>
> thanks
>
> Marco
>


[web2py] Re: https for login

2012-05-16 Thread Lewis
Well, thats easy!

Does anyone do it with RedirectMatch?

Should I really switch to nginx?

Thanks,
(I hate config.)


[web2py] Re: require login on submit

2012-05-16 Thread Anthony
What user workflow are you trying to achieve? Is it possible to simply not 
present the form unless the user is logged in (i.e., require login to get 
to the page with the form)? Otherwise, I suppose you could handle it via 
Javascript and Ajax -- when submit is clicked, check for login, and if not 
logged in, login via Ajax with a modal dialog.

Anthony

On Wednesday, May 16, 2012 11:55:23 AM UTC-4, Marco Prosperi wrote:
>
> hi all, 
> what could be a clean way to require login (if not already logged in) when 
> a user clicks on the submit button of a form?
>
> thanks in advance for advice
>
> Marco
>


[web2py] Re: AttributeError: 'thread._local' object has no attribute 'request'

2012-05-16 Thread JungHyun Kim

The server is Redhat Openshift (cloud PAAS). It uses Python 2.6 on RHEL 6.



2012년 5월 17일 목요일 오전 12시 34분 54초 UTC+9, Massimo Di Pierro 님의 말:
>
> what python version and os version do you have?
>
> On Tuesday, 15 May 2012 22:20:00 UTC-5, JungHyun Kim wrote:
>>
>> Hi. 
>>
>> I got a error "AttributeError: 'thread._local' object has no attribute 
>> 'request'" when trying to run web2py with wsgi.
>>
>> The application was "welcome" which is sample application of web2py.
>>
>> in db.py
>>
>> from gluon.tools import Auth, Crud, Service, PluginManager, prettydate
>> auth = Auth(db, hmac_key=Auth.get_or_create_key())
>>
>>
>>
>> and in gluon/tools.py
>>
>> @staticmethod
>> def get_or_create_key(filename=None):
>> request = current.request
>>
>>
>>
>> Variablesglobal currentrequestundefinedcurrent.
>> requestundefined
>>
>> I have two questions about this.
>>
>> 1. Does global current variable mean thread._local ?
>>
>> 2. If then, why thread._local doesn't have request attribute? Did I set 
>> wsgi configuration wrong?
>>
>>
>> Thank you very much.
>>
>>
>>

[web2py] Re: Is there anyone who running web2py application on Redhat openshift?

2012-05-16 Thread JungHyun Kim
Thank you Andrew!

I connected mysql successfully (I guess, cause the error message 
disappeared).

But I still have some problems. (
https://groups.google.com/forum/#!topic/web2py/wMDDCsisic4)

If I can see your project settings, it will be really helpful!




2012년 5월 16일 수요일 오전 3시 15분 28초 UTC+9, Andrew 님의 말:
>
> JungHyun,
>
> I've deployed the default web2py app to Openshift with no issues but 
> haven't played with it much. I'd be happy to share my project dir so you 
> can see how I've structured my wsgi file and various libs like gluon so 
> that the app will run. 
>
> I'll try and create a mysql cartridge and put the model in that to see 
> what happens.
>
> Andrew
>
> On Tuesday, May 15, 2012 2:55:07 AM UTC-5, JungHyun Kim wrote:
>>
>> Hello. I'm now trying to use redhat openshift.
>>
>> I am struggling access database - mysql-5.1 - which is set via openshift 
>> cartridge.
>> I got admin user(admin), password and database name(we2py).
>> So I modified database setting in models/db.py 
>>
>> as
>>
>> db = DAL('mysql://admin:passw...@web2py-codingday.rhcloud.com/web2py')
>>
>> But web2py application can't connect to mysql.
>>
>> OperationalError: (2003, "Can't connect to MySQL server on '
>> web2py-codingday.rhcloud.com' (111)")
>>
>> I think I couldn't understand enough. I am a noob for both web2py and 
>> openshift.
>>
>> How can I make web2py connect to database right?
>>
>> Thank you.
>>
>>
>>

[web2py] Re: SNI or dedicated IP.

2012-05-16 Thread Ross Peoples
I wouldn't know the first thing about setting up SNI, so I would tell 
WebFaction that if they will do it for me and it works, then sure, I'll use 
SNI, otherwise stick with what you know.

On Wednesday, May 16, 2012 12:14:42 PM UTC-4, Anthony wrote:
>
> I'd never heard of SNI before, but looking at the Wikipedia page for it: 
>> http://en.wikipedia.org/wiki/Server_Name_Indication
>>
>> This will NOT work. The main reason being that Python 2 (which web2py 
>> runs on) does not support SNI. Python 3.2 does, however. So until there is 
>> a web3py, SNI will not be an option unless you use it through Apache (and 
>> figure out how to enable it).
>>
>
> Wouldn't that only be a limitation with the Rocket server? But on 
> WebFaction, the app would probably be served with 
> Apacheor 
> Nginx,
>  
> so should work, no?
>
> Anthony 
>


[web2py] Re: RFC: web2py-based workflow engine

2012-05-16 Thread Cliff
Ross,

I like the workflow monitor table, though I think it should be tied to the 
template rather than individual workflows.  Since each stage knows the id 
of its parent workflow and the workflow knows the id of its template, it 
would be a simple matter to get the monitors and ping them when there's a 
state transition.

I think approvers need to be tied to specific stages.  Again I'm thinking 
of things like large software development project where the sales jocks 
have veto power on the product specifications but no input to the 
acceptance test plan.  There could be a flag in the monitor table to 
indicate that certain members have approval at every stage, I suppose.

Likewise the comments should be tied to stages.  I'm assuming that the 
workflow status of some system object would be accessible through links on 
the object page, or via a tab on the page.  The comments could be pulled 
together and displayed there.

Reviewers rights should be limited to comments.

Here is my current thinking WRT the data model:

db.define_table('wf_template',
Field('name', length=64, required=True, notnull=True),
Field('comment', length=254),
)

db.define_table('wf_state',
Field('template_id', db.wf_template, requires=IS_IN_DB(db,
'wf_template.id', '%(name)s')),
Field('name', length=64, required=True, notnull=True),
Field('objective', length=254,),
Field('past_tense', length=64, required=True, notnull=True),
Field('max_duration', 'decimal(6,2)',
requires=IS_EMPTY_OR(IS_DECIMAL_IN_RANGE(0, None)),
label = 'Maximum duration',
comment = 'Hours.  Considered late if takes longer. Optional',
),
)

query = ((db.auth_user.is_active==True) & 
(db.auth_user.tenant_link==tenant_link_default))
db.define_table('state_user',
Field('user_id', db.auth_user, 'auth_user.id', requires=IS_IN_DB(
db(query), 'auth_user.id', 
'%(first_name)s %(middle_name)s %(last_name)s %(generation)s'
)
),
Field('user_role', requires=IS_IN_SET(['Performer', 'Approver on 
entry', 
'Approver on exit','Reviewer', 'FYI', ]),
),
Field('notify_on', requires=IS_IN_SET(['Entry', 'Completion', 
'Change',
'Comment',]),)
)

db.define_table('state_link',
Field('from_state_id', db.wf_state, requires=IS_IN_DB(db,
'wf_state.id', '%(name)s')),
Field('to_state_id', db.wf_state, requires=IS_IN_DB(db,
'wf_state.id', '%(name)s')),
)


On Wednesday, May 16, 2012 11:22:46 AM UTC-4, Ross Peoples wrote:
>
> Cliff,
>
> Thanks for putting this into a spec. My current code follows most of what 
> is in there. I still haven't finished writing (or testing it), but I do 
> have some thoughts on implementation for one or two of the items listed at 
> the end:
>
> I imagine a "workflow_monitor" table that has the fields: user_id, 
> workflow_id. By default, when a workflow is started, the user that started 
> gets added to this table along with the workflow they started. Using this, 
> an application can design an interface that shows two lists: one listing 
> workflows waiting on the user, and another listing workflows being 
> monitored by the user. Templates should have to ability to set a default 
> list of users or groups that automatically get added as monitoring the 
> workflow. This would be great for managers to see a birds-eye view of 
> everything going on for every person they manage.
>
> Approvers should be part of the workflow, since it should not continue 
> unless approved.
>
> I'm not sure how to handle reviewers, since they don't really have any 
> control over the workflow. Maybe reviewers can be marked as "monitoring", 
> and when they need to comment on something, they just leave a note. For 
> this, I see a "workflow_comment" table that has these fields: workflow_id, 
> user_id, event_date, is_active, comment. The is_active field will be set to 
> True by default. Once the comment / issue has been addressed, is_active 
> gets set to False.
>
> I could also imagine a high-level list of goals that need to be 
> accomplished with the workflow, sort of like a checklist, that users mark 
> as completed as the workflow moves through the system. This would probably 
> satisfy a use case that exists in my current company. They currently use a 
> page within a document as a "sign off" page to make sure everyone inspected 
> their section of the document. Having this workflow checklist would remove 
> the need for this extra page within the document.
>
> Thoughts?
>
> Thanks, Ross
>


Re: [web2py] Re: External lib import issue ( opencv )

2012-05-16 Thread Bassem Bouguerra
Thanks Willis


Do I add that into the web2py.py ?

On Wed, May 16, 2012 at 8:17 AM, Wikus van de Merwe <
dupakrop...@googlemail.com> wrote:

> Where is the opencv installed in your system? When you check python
> interpreters in PyDev options is that path on the list?
>
> If you still struggling with it, a workaround could be to add the
> installation folder to the system path by hand:
> import sys
> sys.path.append("opencv")
>
>


-- 
http://bouguerra.org


[web2py] Re: SNI or dedicated IP.

2012-05-16 Thread Anthony
On Wednesday, May 16, 2012 1:08:20 PM UTC-4, Ross Peoples wrote:
>
> I wouldn't know the first thing about setting up SNI, so I would tell 
> WebFaction that if they will do it for me and it works, then sure, I'll use 
> SNI, otherwise stick with what you know.
>

I think in this case, "what you know" (i.e., dedicated IP address) is an 
extra $5/month. The downside of SNI, though, is that it appears not to be 
supported on Android 2.x (also not on Windows XP). SSL will still 
technically work on those clients, but will result in a certificate error 
being displayed.

Anthony



[web2py] Re: Automatically reload custom modules?

2012-05-16 Thread howesc
i'm on a mac using GAE, but i have a script that calls dev_appserver 
(rather than using their gui launcher).  and my keystrokes memorized to 
alt+tab to terminal, ctrl+c, up arrow, enter, alt+tab to FFperhaps not 
quite as efficient as auto-reload of modules but it keeps me happy enough.

cfh

On Tuesday, May 15, 2012 12:56:12 PM UTC-7, Alex Benfica wrote:
>
> Hi!
>
>
> I have it on my only file at models folder, at first line.
> from gluon.custom_import import track_changes; track_changes(True)
>
> When using GAE SDK, this option does NOTE reloads modules!
>
> The tickets shows erros on wrong line numbers... and changes made on 
> module files are only displayed when App Engine is stoped and started again.
>
> I'm really in trouble now... since I found that there is a huge difference 
> on performance when I keep filles on models compared to modules... but have 
> to start \ stop the development server each time I want to test my code is 
> not productive.
>
> Is there any way of make the reload work on Google App Engine?
> or... to avoid the problem... how can I develop using models and have no 
> problems changing files to modules when I decide upload then to App Engine?
>
> I'm in Windows 7 64bits
>
> Web2py Version 1.99.7 (2012-03-04 22:12:08) stable
>
> App Engine SDK 
> release: "1.6.5" 
> timestamp: 1332880663 
> api_versions: ['1'] 
> Python 2.5.2 
> wxPython 2.8.8.1 (msw-unicode) 
>
>
>
>
>
> On Tuesday, February 21, 2012 10:14:06 PM UTC-2, Massimo Di Pierro wrote:
>>
>> from gluon.custom_import import track_changes; track_changes(True) 
>>
>> On Feb 21, 5:18 pm, Bruce Wade  wrote: 
>> > Hi, 
>> > 
>> > I am starting to find this situation a little annoying. I have a 
>> package at 
>> > the same level as gluon, adviewerAPI. Which contains several modules 
>> that I 
>> > will be using across all my applications. (Main website, customer 
>> service 
>> > app etc...) 
>> > 
>> > Now the issue is whenever I make a change to any of the modules, I need 
>> to 
>> > stop and restart the development server. Is there a setting to for auto 
>> > reload when a module changes? 
>> > 
>> > -- 
>> > -- 
>> > Regards, 
>> > Bruce Wadehttp://
>> ca.linkedin.com/in/brucelwadehttp://www.wadecybertech.comhttp://www.warplydesigned.comhttp://www.fitnessfriendsfinder.com
>
>

Re: [web2py] Re: External lib import issue ( opencv )

2012-05-16 Thread Bassem Bouguerra
Also, I installed opencv using homebew and I can find OpenCV folder
in /usr/local/share/ where there is OpenCVConfig-version.cmake
 haarcascades OpenCVConfig.cmake lbpcascades doc
That means OpenCV's installation path is /usr/local/share/, right?

On Wed, May 16, 2012 at 10:33 AM, Bassem Bouguerra wrote:

> Thanks Willis
>
>
> Do I add that into the web2py.py ?
>
>
> On Wed, May 16, 2012 at 8:17 AM, Wikus van de Merwe <
> dupakrop...@googlemail.com> wrote:
>
>> Where is the opencv installed in your system? When you check python
>> interpreters in PyDev options is that path on the list?
>>
>> If you still struggling with it, a workaround could be to add the
>> installation folder to the system path by hand:
>> import sys
>> sys.path.append("opencv")
>>
>>
>
>
> --
> http://bouguerra.org
>
>
>


-- 
http://bouguerra.org


Re: [web2py] Re: External lib import issue ( opencv )

2012-05-16 Thread Bassem Bouguerra
Actually I think the installation path is

/usr/local/lib/

But where do I have to manually set it, in web2py?

On Wed, May 16, 2012 at 10:42 AM, Bassem Bouguerra wrote:

> Also, I installed opencv using homebew and I can find OpenCV folder
> in /usr/local/share/ where there is OpenCVConfig-version.cmake
>  haarcascades OpenCVConfig.cmake lbpcascades doc
> That means OpenCV's installation path is /usr/local/share/, right?
>
>
> On Wed, May 16, 2012 at 10:33 AM, Bassem Bouguerra wrote:
>
>> Thanks Willis
>>
>>
>> Do I add that into the web2py.py ?
>>
>>
>> On Wed, May 16, 2012 at 8:17 AM, Wikus van de Merwe <
>> dupakrop...@googlemail.com> wrote:
>>
>>> Where is the opencv installed in your system? When you check python
>>> interpreters in PyDev options is that path on the list?
>>>
>>> If you still struggling with it, a workaround could be to add the
>>> installation folder to the system path by hand:
>>> import sys
>>> sys.path.append("opencv")
>>>
>>>
>>
>>
>> --
>> http://bouguerra.org
>>
>>
>>
>
>
> --
> http://bouguerra.org
>
>
>


-- 
http://bouguerra.org


[web2py] Re: web2py uWSGI cherokee -- I give up

2012-05-16 Thread pbreit
As has been suggested, you might reconsider Apache or Nginx (my preference).

I haven't tried this in awhile but this worked at one point:
https://bitbucket.org/pbreit/web2py-automation/src/bc2ac095b592/setup-ubuntu-cherokee.sh

Also, for Nginx:
https://bitbucket.org/pbreit/web2py-automation/src/bc2ac095b592/setup-ubuntu-nginx.sh

Both are quite outdated. I may take a look a them soon. Instead of running 
the scripts "as is" you could try running the command manually, updating 
the versions as appropriate.


[web2py] Re: RFC: web2py-based workflow engine

2012-05-16 Thread Ross Peoples
The data model I already have does things a bit differently, but I think it 
accomplishes the same thing. I am in the process of writing all of the 
support methods.

This is my current data model:

# workflow table
db.define_table('workflow',
Field('name', length=50),
Field('is_template', 'boolean', default=False),
Field('created_by', db.auth_user, default=current_user),
Field('created_on', 'datetime', default=self.request.now),
Field('table_name', length=128),
Field('row_id', 'integer'),
Field('order_id', 'integer', default=self.ORDER_ID_STOP, 
comment='Current position of the workflow'),
Field('priority', 'integer', requires=IS_INT_IN_RANGE(1, 9), 
default=self.DEFAULT_PRIORITY)
)

# allow users / groups to "monitor" select workflows without needing to be 
a part of the workflow
# if workflow is template, this list is copied to the new workflow
db.define_table('workflow_monitor',
Field('workflow_id', db.workflow),
Field('user_id', db.auth_user),
Field('group_id', db.auth_group),
Field('viewed', 'boolean', default=False) # once the monitor looks at 
it, mark as viewed until another change happens
)

# comments can be attached to workflows so that users can voice questions 
and concerns
db.define_table('workflow_comment',
Field('workflow_id', db.workflow),
Field('user_id', db.auth_user, default=current_user),
Field('event_date', 'datetime', default=self.request.now),
Field('is_active', 'boolean', default=True, comment='Is the comment 
waiting to be addressed'),
Field('comment', length=512, comment='The question, comment, or 
concern'),
Field('response', length=512, comment='Response to the question, 
comment, or concern')
)

# high-level list of goals for workflows. Users mark items as completed as 
they complete the goals
# if workflow is template, the checklist is copied to new workflow
db.define_table('workflow_checklist',
Field('workflow_id', db.workflow),
Field('name', length=50),
Field('order_id', 'integer', comment='Ordering position of the item'),
Field('is_active', 'boolean', default=True, comment='Is the item 
waiting to be addressed'),
Field('completed_by', db.auth_user),
Field('completed_at', 'datetime'),
Field('completed_note', length=512)
)

# workflow step table
db.define_table('workflow_step',
Field('workflow_id', db.workflow),
Field('order_id', 'integer', comment='Ordering position of the step'),
Field('name', length=50),
Field('user_id', db.auth_user),
Field('group_id', db.auth_group),
Field('hours', 'decimal(10,2)', requires=IS_DECIMAL_IN_RANGE(0), 
default=0, comment='Optional time limit in hours'),
Field('due_date', 'datetime', comment='Optional due date'),
Field('note', length=512, comment='Note on current state of the step') 
# represents a stateful note (i.e. kickback reason). Can change at any time.
)

# audit tables
db.define_table('workflow_event',
Field('workflow_id', 'integer'),
Field('table_name', length=128), # i.e. document, folder, etc
Field('row_id', 'integer'), # i.e. the ID of the document
Field('user_id', db.auth_user, default=current_user),
Field('event_date', 'datetime', default=self.request.now),
Field('action', length=10, default='update'), # could be: create, 
update, delete
Field('field_name', length=128), # i.e order_id, name, hours, etc
Field('value_before', length=128), # None if create or delete
Field('value_after', length=128) # None if delete
)

db.define_table('workflow_step_event',
Field('workflow_id', 'integer'),
Field('step_id', 'integer'), # the ID of the workflow_step modified 
(used to match up fields in batch changes)
Field('user_id', db.auth_user, default=current_user),
Field('event_date', 'datetime', default=self.request.now),
Field('action', length=10, default='update'), # could be: create, 
update, delete
Field('field_name', length=128), # i.e order_id, name, hours, etc
Field('value_before', length=128), # None if create or delete
Field('value_after', length=128) # None if delete
)


As you can see, this model has quite a few of the features we discussed: 
workflows, templates, monitors, comments, checklists, and auditing. It also 
has triggers that applications can register (i.e. before_step_complete, 
after_step_complete, etc) so applications can interact with the workflow 
engine when an event is triggered.

Workflows are copied from templates so that changes can be made to 
templates and workflows without one affecting the other. This has worked 
very well in my previous implementation. Tying monitors to templates 
wouldn't work well like this. Attaching monitors to workflows themselves 
also offers the advantage of giving the monitors a read/unread indicator 
and when a workflow has been changed (i.e step completed), the indicator 
turns back to "unread" so that way they keep up with workflows and not have 
to remember if a workflow has changed

[web2py] Filling the page as data is being processed

2012-05-16 Thread Fabiano Faver
I have a page that have a slow query using group by but it are slowing down 
the query so I thought to load each item separately and showing them as 
they are done. Web2py have any tool that can help me with this or I need to 
use another approach?

Re: [web2py] Filling the page as data is being processed

2012-05-16 Thread Richard Vézina
Show code, very difficult to follow you...

Richard

On Wed, May 16, 2012 at 2:44 PM, Fabiano Faver  wrote:

> I have a page that have a slow query using group by but it are slowing
> down the query so I thought to load each item separately and showing them
> as they are done. Web2py have any tool that can help me with this or I need
> to use another approach?


Re: [web2py] Filling the page as data is being processed

2012-05-16 Thread Fabiano Faver
I'm trying to display a table with the name of some companies with the 
background color of each TD or DIV  dependent of the last day the printers 
company were checked

this it what I have now:

def exibicao_empresas():
#get companies
empr = db(auth.accessible_query('read', db.empresa, 
auth.user_id)).select()
tabela_empresa = TABLE( _class='grid_color')
tr = TR()
columns = 6
count_cl = 0
#for each company get all their printers and the last date it were 
checked
for td in empr:
lista_1 = []
count_menos = count_mais = 0
#getting printers
impress = db((db.impressora.id_filial_empresa==db.filial_empresa.id
)&(db.filial_empresa.id_empresa==td.id))._select(db.impressora.id)

quant_impressoras = len(impress)
maxdata = db.contadores.data.max()
#getting dates
dias = db(db.contadores.id_impressora.belongs(impress)).select( 
maxdata,db.contadores.id_impressora, groupby=db.contadores.id_impressora)

# checking to show the indicative background-color
for dia in dias:
if (((dia_hoje-dia[maxdata]).days >= 1) and 
((dia_hoje-dia[maxdata]).days < 5)): count_menos = count_menos+1
if ((dia_hoje-dia[maxdata]).days > 5): count_mais = count_mais+1
bg_td = 'background-color: #99FFCC'
if count_menos: bg_td = 'background-color: #EAEA9F'
if count_mais == len(dias): bg_td = 'background-color: #FF'

tr.append(TD(td.nome_fantasia, _style = bg_td))
count_cl = count_cl + 1
if count_cl==columns:
tabela_empresa.append(tr)
tr=TR()
else:
if len(tr): tabela_empresa.append(tr)

return dict(tabela_empresa =tabela_empresa )

>
>

Re: [web2py] Filling the page as data is being processed

2012-05-16 Thread Fabiano Faver
But because of the group by clause it are too slow and I curious to know if
I can query each company separately  do what i must with the data and show
the result on page as soon as they are ready

2012/5/16 Fabiano Faver 

> I'm trying to display a table with the name of some companies with the
> background color of each TD or DIV  dependent of the last day the printers
> company were checked
>
> this it what I have now:
>
> def exibicao_empresas():
> #get companies
> empr = db(auth.accessible_query('**read', db.empresa,
> auth.user_id)).select()
> tabela_empresa = TABLE( _class='grid_color')
> tr = TR()
> columns = 6
> count_cl = 0
> #for each company get all their printers and the last date it were
> checked
> for td in empr:
> lista_1 = []
> count_menos = count_mais = 0
> #getting printers
> impress = db((db.impressora.id_filial_**empresa==
> db.filial_empresa.id)**&(db.filial_empresa.id_**empresa==td.id))._select(
> db.**impressora.id )
>
> quant_impressoras = len(impress)
> maxdata = db.contadores.data.max()
> #getting dates
> dias = db(db.contadores.id_**impressora.belongs(impress)).**select(
> maxdata,db.contadores.id_**impressora, groupby=db.contadores.id_**
> impressora)
>
> # checking to show the indicative background-color
> for dia in dias:
> if (((dia_hoje-dia[maxdata]).days >= 1) and
> ((dia_hoje-dia[maxdata]).days < 5)): count_menos = count_menos+1
> if ((dia_hoje-dia[maxdata]).days > 5): count_mais =
> count_mais+1
> bg_td = 'background-color: #99FFCC'
> if count_menos: bg_td = 'background-color: #EAEA9F'
> if count_mais == len(dias): bg_td = 'background-color: #FF'
>
> tr.append(TD(td.nome_fantasia, _style = bg_td))
> count_cl = count_cl + 1
> if count_cl==columns:
> tabela_empresa.append(tr)
> tr=TR()
> else:
> if len(tr): tabela_empresa.append(tr)
>
> return dict(tabela_empresa =tabela_empresa )
>
>>
>>


[web2py] Problem with storage object

2012-05-16 Thread Rod Watkins
I have created a Storage object in a model to expose some settings gathered 
from the database.
But I am facing a problem.

When I access the object from a view, it works correctly, e.g., 
{{=gsettings.setting_name}} produces the correct text in my html.

But if I try to access that value in my controller (e.g., value = 
gsettings.setting_name) I get an error: 


'function' object has no attribute 'setting_name'

Any help would be appreciated.

Thanks
Rod



Re: [web2py] Problem with storage object

2012-05-16 Thread Bruno Rocha
do you have a function named "gsettings" in controller?



-- 

Bruno Rocha
[http://rochacbruno.com.br]


Re: [web2py] Filling the page as data is being processed

2012-05-16 Thread Richard Vézina
Would you show your models...

You make complexe queries, maybe your models are not pretty well design for
the purpose.

Richard

On Wed, May 16, 2012 at 3:22 PM, Fabiano Faver  wrote:

> But because of the group by clause it are too slow and I curious to know
> if I can query each company separately  do what i must with the data and
> show the result on page as soon as they are ready
>
>
> 2012/5/16 Fabiano Faver 
>
>> I'm trying to display a table with the name of some companies with the
>> background color of each TD or DIV  dependent of the last day the printers
>> company were checked
>>
>> this it what I have now:
>>
>> def exibicao_empresas():
>> #get companies
>> empr = db(auth.accessible_query('**read', db.empresa,
>> auth.user_id)).select()
>> tabela_empresa = TABLE( _class='grid_color')
>> tr = TR()
>> columns = 6
>> count_cl = 0
>> #for each company get all their printers and the last date it were
>> checked
>> for td in empr:
>> lista_1 = []
>> count_menos = count_mais = 0
>> #getting printers
>> impress = db((db.impressora.id_filial_**empresa==
>> db.filial_empresa.id)**&(db.filial_empresa.id_**empresa==td.id))._select(
>> db.**impressora.id )
>>
>> quant_impressoras = len(impress)
>> maxdata = db.contadores.data.max()
>> #getting dates
>> dias = db(db.contadores.id_**impressora.belongs(impress)).**select(
>> maxdata,db.contadores.id_**impressora, groupby=db.contadores.id_**
>> impressora)
>>
>> # checking to show the indicative background-color
>> for dia in dias:
>> if (((dia_hoje-dia[maxdata]).days >= 1) and
>> ((dia_hoje-dia[maxdata]).days < 5)): count_menos = count_menos+1
>> if ((dia_hoje-dia[maxdata]).days > 5): count_mais =
>> count_mais+1
>> bg_td = 'background-color: #99FFCC'
>> if count_menos: bg_td = 'background-color: #EAEA9F'
>> if count_mais == len(dias): bg_td = 'background-color: #FF'
>>
>> tr.append(TD(td.nome_fantasia, _style = bg_td))
>> count_cl = count_cl + 1
>> if count_cl==columns:
>> tabela_empresa.append(tr)
>> tr=TR()
>> else:
>> if len(tr): tabela_empresa.append(tr)
>>
>> return dict(tabela_empresa =tabela_empresa )
>>
>>>
>>>
>


[web2py] cannot find the adapter for sybase which Massimo is referring to

2012-05-16 Thread dlypka
Please advise where it is.
I do not see 'sybase' in dal.py.
Is is somewhere else?

Thanks.



Re: [web2py] Filling the page as data is being processed

2012-05-16 Thread Fabiano Faver
For this purpose they are not...I may include a field on printers table 
that inform the date I searching for.

If what I want to do in this page is still not clear I can try to explain 
more.
basically its a grid that each TD have a bg-color dependant on it last date



EmpresaTb = db.define_table("empresa",
Field('nome_fantasia','string'),
format='%(nome_fantasia)s'
#migrate=False
)

FilialTb = db.define_table("filial_empresa",
Field('descricao_filial','string'),
Field('endereco','string'),
Field('telefone','string'),
Field('Contato',default=''),
Field('email','string'),
Field('id_empresa','reference empresa'),
format='%(descricao_filial)s',
migrate=False
)

FabricanteTb = db.define_table("fabricante",
Field('nome_fabricante','string'),
format='%(nome_fabricante)s'
#migrate=False
)

ModeloTb = db.define_table("modelo",
Field('nome_modelo','string'),
Field('id_fabricante','reference fabricante'),
format='%(nome_modelo)s'
#migrate=False
)


ImpressoraTb = db.define_table("impressora",
Field('serial','string'),
Field('macaddress','string'),
Field('id_modelo','reference modelo'),
Field('id_filial_empresa','reference filial_empresa'),
format=lambda r: r.serial or r.macaddress
#migrate=False
)


ContadoresTb = db.define_table("contadores",
Field('printpb','integer'),
Field('copypb','integer'),
Field('printcolor','integer'),
Field('copycolor','integer'),
Field('singlecolor','integer'),
Field('twocolor','integer'),
Field('copysinglecolor','integer'),
Field('copytwocolor','integer'),
Field('scanner','integer'),
Field('fax','integer'),
Field('total','integer'),
Field('data','date'),
Field('hora','time'),
Field('id_impressora','reference impressora')
#Field('fkempresa','reference empresa'),
#migrate=False
)

Em quarta-feira, 16 de maio de 2012 16h50min35s UTC-3, Richard escreveu:
>
> Would you show your models... 
>
> You make complexe queries, maybe your models are not pretty well design 
> for the purpose.
>
> Richard
>
> On Wed, May 16, 2012 at 3:22 PM, Fabiano Faver  wrote:
>
>> But because of the group by clause it are too slow and I curious to know 
>> if I can query each company separately  do what i must with the data and 
>> show the result on page as soon as they are ready
>>
>>
>> 2012/5/16 Fabiano Faver 
>>
>>> I'm trying to display a table with the name of some companies with the 
>>> background color of each TD or DIV  dependent of the last day the printers 
>>> company were checked
>>>
>>> this it what I have now:
>>>  
>>> def exibicao_empresas():
>>> #get companies
>>> empr = db(auth.accessible_query('**read', db.empresa, 
>>> auth.user_id)).select()
>>> tabela_empresa = TABLE( _class='grid_color')
>>> tr = TR()
>>> columns = 6
>>> count_cl = 0
>>> #for each company get all their printers and the last date it were 
>>> checked
>>> for td in empr:
>>> lista_1 = []
>>> count_menos = count_mais = 0
>>> #getting printers
>>> impress = db((db.impressora.id_filial_**empresa==
>>> db.filial_empresa.id)**&(db.filial_empresa.id_**empresa==td.id
>>> ))._select(db.**impressora.id )
>>>
>>> quant_impressoras = len(impress)
>>> maxdata = db.contadores.data.max()
>>> #getting dates
>>> dias = db(db.contadores.id_**impressora.belongs(impress)).**select( 
>>> maxdata,db.contadores.id_**impressora, groupby=db.contadores.id_**
>>> impressora)
>>>
>>> # checking to show the indicative background-color
>>> for dia in dias:
>>> if (((dia_hoje-dia[maxdata]).days >= 1) and 
>>> ((dia_hoje-dia[maxdata]).days < 5)): count_menos = count_menos+1
>>> if ((dia_hoje-dia[maxdata]).days > 5): count_mais = 
>>> count_mais+1
>>> bg_td = 'background-color: #99FFCC'
>>> if count_menos: bg_td = 'background-color: #EAEA9F'
>>> if count_mais == len(dias): bg_td = 'background-color: #FF'
>>>
>>> tr.append(TD(td.nome_fantasia, _style = bg_td))
>>> count_cl = count_cl + 1
>>> if count_cl==columns:
>>> tabela_empresa.append(tr)
>>> tr=TR()
>>> else:
>>> if len(tr): tabela_empresa.append(tr)
>>>
>>> return dict(tabela_empresa =tabela_empresa )
>>>


>>
>

Re: [web2py] Filling the page as data is being processed

2012-05-16 Thread Richard Vézina
If you don't need this page to be update more then once a day or once a
hour what you can do is this :

You make sub-function that you gonna cache

def __sub_func_NAME():
complex query
return var

def display_func():
var = cache.ram('var',
  lambda: __sub_func_samples_list(),
  time_expire=3600)
from = RESULT OF YOUR FORM GENERATION
return dict(form=form)

That way you can cache the long query, so it will be slow only once in a
wild...

Sorry, I don't have time to analyse in details if what you are doing could
be optimize. I think that if you just want to make it faster you can follow
the path a suggest as long as your code give you the result you expect.

Richard


On Wed, May 16, 2012 at 4:06 PM, Fabiano Faver  wrote:

> For this purpose they are not...I may include a field on printers table
> that inform the date I searching for.
>
> If what I want to do in this page is still not clear I can try to explain
> more.
> basically its a grid that each TD have a bg-color dependant on it last date
>
>
>
> EmpresaTb = db.define_table("empresa",
> Field('nome_fantasia','string'**),
> format='%(nome_fantasia)s'
> #migrate=False
> )
>
> FilialTb = db.define_table("filial_**empresa",
> Field('descricao_filial','**string'),
> Field('endereco','string'),
> Field('telefone','string'),
> Field('Contato',default=''),
> Field('email','string'),
> Field('id_empresa','reference empresa'),
> format='%(descricao_filial)s',
> migrate=False
> )
>
> FabricanteTb = db.define_table("fabricante",
> Field('nome_fabricante','**string'),
> format='%(nome_fabricante)s'
> #migrate=False
> )
>
> ModeloTb = db.define_table("modelo",
> Field('nome_modelo','string'),
> Field('id_fabricante','**reference fabricante'),
> format='%(nome_modelo)s'
> #migrate=False
> )
>
>
> ImpressoraTb = db.define_table("impressora",
> Field('serial','string'),
> Field('macaddress','string'),
> Field('id_modelo','reference modelo'),
> Field('id_filial_empresa','**reference filial_empresa'),
> format=lambda r: r.serial or r.macaddress
> #migrate=False
> )
>
>
> ContadoresTb = db.define_table("contadores",
> Field('printpb','integer'),
> Field('copypb','integer'),
> Field('printcolor','integer'),
> Field('copycolor','integer'),
> Field('singlecolor','integer')**,
> Field('twocolor','integer'),
> Field('copysinglecolor','**integer'),
> Field('copytwocolor','integer'**),
> Field('scanner','integer'),
> Field('fax','integer'),
> Field('total','integer'),
> Field('data','date'),
> Field('hora','time'),
> Field('id_impressora','**reference impressora')
> #Field('fkempresa','reference empresa'),
> #migrate=False
> )
>
> Em quarta-feira, 16 de maio de 2012 16h50min35s UTC-3, Richard escreveu:
>
>> Would you show your models...
>>
>> You make complexe queries, maybe your models are not pretty well design
>> for the purpose.
>>
>> Richard
>>
>> On Wed, May 16, 2012 at 3:22 PM, Fabiano Faver  wrote:
>>
>>> But because of the group by clause it are too slow and I curious to know
>>> if I can query each company separately  do what i must with the data and
>>> show the result on page as soon as they are ready
>>>
>>>
>>> 2012/5/16 Fabiano Faver 
>>>
 I'm trying to display a table with the name of some companies with the
 background color of each TD or DIV  dependent of the last day the printers
 company were checked

 this it what I have now:

 def exibicao_empresas():
 #get companies
 empr = db(auth.accessible_query('**read**', db.empresa,
 auth.user_id)).select()
 tabela_empresa = TABLE( _class='grid_color')
 tr = TR()
 columns = 6
 count_cl = 0
 #for each company get all their printers and the last date it were
 checked
 for td in empr:
 lista_1 = []
 count_menos = count_mais = 0
 #getting printers
 impress = db((db.impressora.id_filial_**em**presa==
 db.filial_empresa.id)**&(**db.filial_empresa.id_**empresa==**td.id
 ))._select(db.**impressora.**id )

 quant_impressoras = len(impress)
 maxdata = db.contadores.data.max()
 #getting dates
 dias = 
 db(db.contadores.id_**impressora**.belongs(impress)).**select(
 maxdata,db.contadores.id_**impre**ssora, groupby=db.contadores.id_**
 impre**ssora)

 # che

Re: [web2py] Problem with storage object

2012-05-16 Thread Rod Watkins
No, no such function.

On Wednesday, 16 May 2012 12:46:26 UTC-7, rochacbruno wrote:
>
> do you have a function named "gsettings" in controller?
>
>
>
> -- 
>
> Bruno Rocha
> [http://rochacbruno.com.br]
>
>

Re: [web2py] Re: Error facebook login

2012-05-16 Thread Michele Comitini
The /etc/hosts i am talking about is the one on the client I.e. the
computer running the browser not the one running web2py.

If you want a public domain name you can one at afraid.org.
No PTR just A is needed.

mic
Il giorno 16/mag/2012 15:16, "www.diazluis.com"  ha
scritto:

> greetings.
>
> I repeat this properly configured facebook
>
> I have no write permission on / etc / hosts
>
> I have write permission only for:
> / apache2
> / htdocs
> / web2py
>
> not my domain provider allows me to create PTR type DNS
> not as you would with CNAME
>
> thanks for your time and help .. I'm still here waiting for a solution ...
>
>
> El martes, 15 de mayo de 2012 18:03:40 UTC-4:30, mcm escribió:
>>
>> You need a domain name, a PTR record a CNAME whatever is good.
>> OR you can put *ANY* hostname you want in your /etc/hosts file and you
>> will see that facebook will accept that.
>>
>>
>> mic
>>
>>
>> 2012/5/15 Christian Foster Howes
>> > i don't understand,
>> >
>> > https://graph.facebook.com/**oauth/authorize?redirect_uri=**
>> http%3A%2F%2Fjuegozona.com%**2Fuser%2Flogin&response_type=**
>> code&client_id=225870074195502
>> >
>> > is not an option?  i think that is what facebook needs.
>> >
>> > cfh
>> >
>> >
>> > On 5/15/12 13:54 , www.diazluis.com wrote:
>> >>
>> >> Thanks for responding
>> >>
>> >> no, not possible.
>> >> would have to be able to specify a dns PTR type, and I have that
>> option
>> >>
>> >> CAS system not work for me, I retornava error "infinite redirect"
>> >>
>> >> I had several customers excited about the idea of being able to log
>> into
>> >> facebook ... pity it does not work ..
>> >>
>> >>
>> >> El martes, 15 de mayo de 2012 12:50:42 UTC-4:30, howesc escribió:
>> >>>
>> >>>
>> >>> what are you using the generate the return URL that you pass to
>> facebook
>> >>> when you make the login request?  it looks like that is the culprit -
>> i
>> >>> always use a hostname and not IP address for the return URL.
>> >>>
>> >>> On Tuesday, May 15, 2012 7:17:02 AM UTC-7, :
>> 
>> 
>>  I'll try to explain better:
>>  I need my app to do login using facebook.
>> 
>>  you can test in juegozona.com
>> 
>>  juegozona.com is configured in the "panel WebFaction" to use the
>> ip:
>>  108.59.6.232
>>  http://i.minus.com/**iFYHPECFl6LpM.png
>> 
>> 
>>  when the visitor tries to login, facebook return to the page from
>>  which you made the request.
>> 
>>  here I present the following error:
>>  http://i.minus.com/**iyuafE7P1RyB.png
>> 
>> 
>>  in the browser address bar displays the following code:
>> 
>> 
>>  https://graph.facebook.com/**oauth/authorize?redirect_uri=**
>> http%3A%2F%2F200.8.87.32%**2Fuser%2Flogin&response_type=**
>> code&client_id=225870074195502
>> 
>>  in which one can extract the ip address of return is: 200.8.87.32
>> 
>> 
>>  my config dns is:
>>  http://i.minus.com/**ibod18TSOmp3vE.png
>>  http://i.minus.com/**irFLEZdFvmfsS.png
>> 
>> 
>>  the facebook settings are correct:
>>  http://i.minus.com/**iYiz3kKyMV1Ll.png
>> 
>> 
>>  what is the problem?
>> 
>>  Díaz Luis
>>  Analista Programador Facultad de Odontología UC
>>  http://www.about.me/diazluis
>>  User Linux 532223
>> 
>> >>>
>> >
>>
>


Re: [web2py] Problem with storage object

2012-05-16 Thread Rod Watkins
Ahh, found it. I did have a function named gsettings. It was in a different 
model file and I had forgotten to delete it. Thanks for the suggestion. 
That was two hours wasted. :)

Rod

On Wednesday, 16 May 2012 12:46:26 UTC-7, rochacbruno wrote:
>
> do you have a function named "gsettings" in controller?
>
>
>
> -- 
>
> Bruno Rocha
> [http://rochacbruno.com.br]
>
>

Re: [web2py] Configuring web2py with nginx - domain error ("gaierror: [Errno -2] Name or service not known")

2012-05-16 Thread Chris

I wrote a patch to fix the problem on my server, which is basically just 
commenting out that line (main.py:390ish):

local_hosts = 
[http_host,'::1','127.0.0.1',':::127.0.0.1']
if not global_settings.web2py_runtime_gae:
local_hosts += [socket.gethostname()]
#socket.gethostbyname(http_host)]

It looks like that line is just to check for the request is coming from the 
externally facing IP. Could that perhaps be wrapped in a try-catch block 
and the results cached?

Thanks,
Chris


On Tuesday, December 6, 2011 10:01:33 AM UTC-5, Richard wrote:
>
> I don't know if you have any constrain, but for testing purpose you can 
> use nginx setup script in web2py/scripts folder... There is one for ubuntu 
> at least...
>
> RicharD
>
> On Mon, Dec 5, 2011 at 5:48 PM, Chris <> wrote:
>
>> I'm using web2py with nginx, and I've experienced the following error
>> on redeploying my app:
>>
>>socket.gethostbynamesocket.gethostbyname(http_host)  File "/var/
>> web2py/cow/gluon/main.py", line 396, in wsgibase
>>socket.gethostbyname(http_host)]
>>gaierror: [Errno -2] Name or service not known
>>
>>
>> I traced this down to a particular section in gluon/main.py:
>>
>>local_hosts = [http_host,'::1','127.0.0.1',':::
>> 127.0.0.1']
>>if not global_settings.web2py_runtime_gae:
>>local_hosts += [socket.gethostname(),
>>socket.gethostbyname(http_host)]
>>
>> As it turns out, http_host (the value above) is mapped to the
>> nginx.conf value for http_host:
>>
>>upstream custom_server_name {
>>server 127.0.0.1:8000;
>>}
>>
>>
>> It seems like what's happening is that web2py is receiving the http;//
>> custom_server_name instead of http://localhost, and
>> socket.gethostbyname() chokes on that. Is there something I should be
>> changing in the configuration to prevent this from happening?
>>
>
>
On Tuesday, December 6, 2011 10:01:33 AM UTC-5, Richard wrote:
>
> I don't know if you have any constrain, but for testing purpose you can 
> use nginx setup script in web2py/scripts folder... There is one for ubuntu 
> at least...
>
> RicharD
>
> On Mon, Dec 5, 2011 at 5:48 PM, Chris <> wrote:
>
>> I'm using web2py with nginx, and I've experienced the following error
>> on redeploying my app:
>>
>>socket.gethostbynamesocket.gethostbyname(http_host)  File "/var/
>> web2py/cow/gluon/main.py", line 396, in wsgibase
>>socket.gethostbyname(http_host)]
>>gaierror: [Errno -2] Name or service not known
>>
>>
>> I traced this down to a particular section in gluon/main.py:
>>
>>local_hosts = [http_host,'::1','127.0.0.1',':::
>> 127.0.0.1']
>>if not global_settings.web2py_runtime_gae:
>>local_hosts += [socket.gethostname(),
>>socket.gethostbyname(http_host)]
>>
>> As it turns out, http_host (the value above) is mapped to the
>> nginx.conf value for http_host:
>>
>>upstream custom_server_name {
>>server 127.0.0.1:8000;
>>}
>>
>>
>> It seems like what's happening is that web2py is receiving the http;//
>> custom_server_name instead of http://localhost, and
>> socket.gethostbyname() chokes on that. Is there something I should be
>> changing in the configuration to prevent this from happening?
>>
>
>
On Tuesday, December 6, 2011 10:01:33 AM UTC-5, Richard wrote:
>
> I don't know if you have any constrain, but for testing purpose you can 
> use nginx setup script in web2py/scripts folder... There is one for ubuntu 
> at least...
>
> RicharD
>
> On Mon, Dec 5, 2011 at 5:48 PM, Chris <> wrote:
>
>> I'm using web2py with nginx, and I've experienced the following error
>> on redeploying my app:
>>
>>socket.gethostbynamesocket.gethostbyname(http_host)  File "/var/
>> web2py/cow/gluon/main.py", line 396, in wsgibase
>>socket.gethostbyname(http_host)]
>>gaierror: [Errno -2] Name or service not known
>>
>>
>> I traced this down to a particular section in gluon/main.py:
>>
>>local_hosts = [http_host,'::1','127.0.0.1',':::
>> 127.0.0.1']
>>if not global_settings.web2py_runtime_gae:
>>local_hosts += [socket.gethostname(),
>>socket.gethostbyname(http_host)]
>>
>> As it turns out, http_host (the value above) is mapped to the
>> nginx.conf value for http_host:
>>
>>upstream custom_server_name {
>>server 127.0.0.1:8000;
>>}
>>
>>
>> It seems like what's happening is that web2py is receiving the http;//
>> custom_server_name instead of http://localhost, and
>> socket.gethostbyname() chokes on that. Is there something I should be
>> changing in the configuration to prevent this from happening?
>>
>
>

[web2py] Re: How to use web2py DAL with sybase? Please point me to the sybase adapter

2012-05-16 Thread Massimo Di Pierro
Will send it tonight. Basically Sybase is almost the same as MSSQL. Do you 
a preference for one of the pyhton drivers for sybase?

On Wednesday, 16 May 2012 10:51:39 UTC-5, dlypka wrote:
>
>
> I do not see any reference to "sybase" in 1.99.7 dal.py.
>
> Please point me to the sybase adapter.
>
> There are 2 of us developers here at work who can test it for you on a 
> large corporate sybase database.
>
> Thanks.
>
> On Wednesday, May 16, 2012 10:42:05 AM UTC-5, Massimo Di Pierro wrote:
>>
>> web2py includes an adapter but nobody has tested it. If you can help us 
>> test it we can help you debug any problem that may arise. Compatibility 
>> with sybase and other SQL DB engines is a priority.
>>
>>
>>
>> On Wednesday, 16 May 2012 07:47:59 UTC-5, dlypka wrote:
>>>
>>> I see this posting which has some sybase adapter code:
>>>
>>> https://groups.google.com/forum/?fromgroups#!searchin/web2py/sybase/web2py/LXdEdc1th3M/8ZIOxE8tJQgJ
>>>  
>>>
>>> Is there anything else?
>>>
>>> I have a need to use web2y + sybase at work.
>>>
>>> Thanks.
>>>
>>

[web2py] Re: web2py uWSGI cherokee -- I give up

2012-05-16 Thread Lewis
Thanks.  I am going with nginx.  Already had apache up and running for many 
months.

The slices are way out of date (and the site has bad visuals, is hard to 
navigate and search despite being a volunteer effort by a community member).
The cookbook is better but contains obvious errors (symbolic links setup to 
refer to wrong directories).  Still it is useful and clear.
I am checking the forum for new news and suggestions.

Thanks again.

On Wednesday, May 16, 2012 11:21:57 AM UTC-7, pbreit wrote:
>
> As has been suggested, you might reconsider Apache or Nginx (my 
> preference).
>
> I haven't tried this in awhile but this worked at one point:
>
> https://bitbucket.org/pbreit/web2py-automation/src/bc2ac095b592/setup-ubuntu-cherokee.sh
>
> Also, for Nginx:
>
> https://bitbucket.org/pbreit/web2py-automation/src/bc2ac095b592/setup-ubuntu-nginx.sh
>
> Both are quite outdated. I may take a look a them soon. Instead of running 
> the scripts "as is" you could try running the command manually, updating 
> the versions as appropriate.
>


[web2py] Re: AttributeError: 'thread._local' object has no attribute 'request'

2012-05-16 Thread Massimo Di Pierro
Any chance you can try 2.5 or 2.7?

On Wednesday, 16 May 2012 11:28:32 UTC-5, JungHyun Kim wrote:
>
>
> The server is Redhat Openshift (cloud PAAS). It uses Python 2.6 on RHEL 6.
>
>
>
> 2012년 5월 17일 목요일 오전 12시 34분 54초 UTC+9, Massimo Di Pierro 님의 말:
>>
>> what python version and os version do you have?
>>
>> On Tuesday, 15 May 2012 22:20:00 UTC-5, JungHyun Kim wrote:
>>>
>>> Hi. 
>>>
>>> I got a error "AttributeError: 'thread._local' object has no attribute 
>>> 'request'" when trying to run web2py with wsgi.
>>>
>>> The application was "welcome" which is sample application of web2py.
>>>
>>> in db.py
>>>
>>> from gluon.tools import Auth, Crud, Service, PluginManager, prettydate
>>> auth = Auth(db, hmac_key=Auth.get_or_create_key())
>>>
>>>
>>>
>>> and in gluon/tools.py
>>>
>>> @staticmethod
>>> def get_or_create_key(filename=None):
>>> request = current.request
>>>
>>>
>>>
>>> Variablesglobal currentrequestundefinedcurrent.
>>> requestundefined
>>>
>>> I have two questions about this.
>>>
>>> 1. Does global current variable mean thread._local ?
>>>
>>> 2. If then, why thread._local doesn't have request attribute? Did I set 
>>> wsgi configuration wrong?
>>>
>>>
>>> Thank you very much.
>>>
>>>
>>>

[web2py] Re: How to use web2py DAL with sybase? Please point me to the sybase adapter

2012-05-16 Thread dlypka
No preference on which python driver for sybase.
So whatever you select is fine with us.
Thanks.
- Dave Lypka.

On Wednesday, May 16, 2012 4:10:28 PM UTC-5, Massimo Di Pierro wrote:
>
> Will send it tonight. Basically Sybase is almost the same as MSSQL. Do you 
> a preference for one of the pyhton drivers for sybase?
>
> On Wednesday, 16 May 2012 10:51:39 UTC-5, dlypka wrote:
>>
>>
>> I do not see any reference to "sybase" in 1.99.7 dal.py.
>>
>> Please point me to the sybase adapter.
>>
>> There are 2 of us developers here at work who can test it for you on a 
>> large corporate sybase database.
>>
>> Thanks.
>>
>> On Wednesday, May 16, 2012 10:42:05 AM UTC-5, Massimo Di Pierro wrote:
>>>
>>> web2py includes an adapter but nobody has tested it. If you can help us 
>>> test it we can help you debug any problem that may arise. Compatibility 
>>> with sybase and other SQL DB engines is a priority.
>>>
>>>
>>>
>>> On Wednesday, 16 May 2012 07:47:59 UTC-5, dlypka wrote:

 I see this posting which has some sybase adapter code:

 https://groups.google.com/forum/?fromgroups#!searchin/web2py/sybase/web2py/LXdEdc1th3M/8ZIOxE8tJQgJ
  

 Is there anything else?

 I have a need to use web2y + sybase at work.

 Thanks.

>>>

[web2py] Re: How to use web2py DAL with sybase? Please point me to the sybase adapter

2012-05-16 Thread Massimo Di Pierro
I just committed a SybaseAdapter using this driver:

http://python-sybase.sourceforge.net/

It extends the MSSQLAdapter but uses the other driver and Sybase types.
It needs testing.

You can use it with

DAL('sybase://dsnstring')

or

DAL('sybase://username:password@hostname:port/dbname')

It uses this line to built the dsn string:

   dsn = 'sybase:host=%s:%s;dbname=%s' % (host,port,db)

This is one line I am not sure about because the docs for the adapter do 
not explain it and I cannot try it.

Massimo





On Wednesday, 16 May 2012 16:24:02 UTC-5, dlypka wrote:
>
> No preference on which python driver for sybase.
> So whatever you select is fine with us.
> Thanks.
> - Dave Lypka.
>
> On Wednesday, May 16, 2012 4:10:28 PM UTC-5, Massimo Di Pierro wrote:
>>
>> Will send it tonight. Basically Sybase is almost the same as MSSQL. Do 
>> you a preference for one of the pyhton drivers for sybase?
>>
>> On Wednesday, 16 May 2012 10:51:39 UTC-5, dlypka wrote:
>>>
>>>
>>> I do not see any reference to "sybase" in 1.99.7 dal.py.
>>>
>>> Please point me to the sybase adapter.
>>>
>>> There are 2 of us developers here at work who can test it for you on a 
>>> large corporate sybase database.
>>>
>>> Thanks.
>>>
>>> On Wednesday, May 16, 2012 10:42:05 AM UTC-5, Massimo Di Pierro wrote:

 web2py includes an adapter but nobody has tested it. If you can help us 
 test it we can help you debug any problem that may arise. Compatibility 
 with sybase and other SQL DB engines is a priority.



 On Wednesday, 16 May 2012 07:47:59 UTC-5, dlypka wrote:
>
> I see this posting which has some sybase adapter code:
>
> https://groups.google.com/forum/?fromgroups#!searchin/web2py/sybase/web2py/LXdEdc1th3M/8ZIOxE8tJQgJ
>  
>
> Is there anything else?
>
> I have a need to use web2y + sybase at work.
>
> Thanks.
>


Re: [web2py] Re: External lib import issue ( opencv )

2012-05-16 Thread Massimo Di Pierro
Can you try set PYTHONPATH?

http://www.stereoplex.com/blog/understanding-imports-and-pythonpath

On Wednesday, 16 May 2012 12:46:34 UTC-5, web2py_tn wrote:
>
> Actually I think the installation path is  
>
> /usr/local/lib/
>
> But where do I have to manually set it, in web2py?
>
> On Wed, May 16, 2012 at 10:42 AM, Bassem Bouguerra wrote:
>
>> Also, I installed opencv using homebew and I can find OpenCV folder 
>> in /usr/local/share/ where there is OpenCVConfig-version.cmake 
>>  haarcascades OpenCVConfig.cmake lbpcascades doc
>> That means OpenCV's installation path is /usr/local/share/, right?
>>
>>
>> On Wed, May 16, 2012 at 10:33 AM, Bassem Bouguerra 
>> wrote:
>>
>>> Thanks Willis
>>>
>>>
>>> Do I add that into the web2py.py ?
>>>
>>>
>>> On Wed, May 16, 2012 at 8:17 AM, Wikus van de Merwe <
>>> dupakrop...@googlemail.com> wrote:
>>>
 Where is the opencv installed in your system? When you check python 
 interpreters in PyDev options is that path on the list?

 If you still struggling with it, a workaround could be to add the 
 installation folder to the system path by hand:
 import sys
 sys.path.append("opencv")


>>>
>>>
>>> -- 
>>> http://bouguerra.org
>>>
>>>
>>>  
>>
>>
>> -- 
>> http://bouguerra.org
>>
>>
>>  
>
>
> -- 
> http://bouguerra.org
>
>
>

[web2py] KeyError: 'float' when selecting records

2012-05-16 Thread wuelfhis asuaje
It only happens in version 1.99.7

in 1.99.1 works perfect

Only happens when the table or (i don't know if model) has a float or 
decimal field

That's what i ran:

In [66]: rows = db().select(db.fc_pago.ALL)
---
KeyError  Traceback (most recent call last)
/home/wasuaje/Documentos/desarrollo/web2py2/applications/flota/models/plugin_jqgrid.py
 
in ()
> 1 rows = db().select(db.fc_pago.ALL)

/home/wasuaje/Documentos/desarrollo/web2py2/gluon/dal.pyc in select(self, 
*fields, **attributes)
   7576 adapter = self.db._adapter
   7577 fields = adapter.expand_all(fields, 
adapter.tables(self.query))
-> 7578 return adapter.select(self.query,fields,attributes)
   7579 
   7580 def delete(self):

/home/wasuaje/Documentos/desarrollo/web2py2/gluon/dal.pyc in select(self, 
query, fields, attributes)
   1318 limitby = attributes.get('limitby', None) or (0,)
   1319 rows = self.rowslice(rows,limitby[0],None)
-> 1320 return self.parse(rows,fields,self._colnames)
   1321 
   1322 def _count(self, query, distinct=None):

/home/wasuaje/Documentos/desarrollo/web2py2/gluon/dal.pyc in parse(self, 
rows, fields, colnames, blob_decode)
   1615 colset = new_row[tablename]
   1616 colset[fieldname] = value = \
-> 1617 
self.parse_value(value,field.type,blob_decode)
   1618 
   1619 if field.type == 'id':

/home/wasuaje/Documentos/desarrollo/web2py2/gluon/dal.pyc in 
parse_value(self, value, field_type, blob_decode)
   1494 else:
   1495 key = regex_type.match(field_type).group(0)
-> 1496 return self.parsemap[key](value,field_type)
   1497 
   1498 def parse_reference(self, value, field_type):

KeyError: 'float'


my model
#
db.define_table('fc_pago',
Field('id','integer'),
Field('fecha','date'),
Field('total','double'), #tryed with decimal or float here in mysql is 
float
Field('descripcion','string'),
Field('mt_persona_id','integer'),
migrate=False)

db.fc_pago.mt_persona_id.requires = 
IS_IN_DB(db,db.mt_persona.id,'%(nombres)s %(apellidos)s' )
db.fc_pago.mt_persona_id.represent=lambda val: db.mt_persona[val].nombres



Database Mysql 

mysql  Ver 14.14 Distrib 5.5.22, for debian-linux-gnu (i686) using readline 
6.2

What's going on here?


[web2py] Re: KeyError: 'float' when selecting records

2012-05-16 Thread Massimo Di Pierro
Hello wuelfhis,

Do you have 1.99.7 stable? I believe this has been fixed in trunk and in 
the nightly build. Can you try it?

Massimo

On Wednesday, May 16, 2012 4:42:55 PM UTC-5, wuelfhis asuaje wrote:
>
> It only happens in version 1.99.7
>
> in 1.99.1 works perfect
>
> Only happens when the table or (i don't know if model) has a float or 
> decimal field
>
> That's what i ran:
>
> In [66]: rows = db().select(db.fc_pago.ALL)
> ---
> KeyError  Traceback (most recent call last)
> /home/wasuaje/Documentos/desarrollo/web2py2/applications/flota/models/plugin_jqgrid.py
>  
> in ()
> > 1 rows = db().select(db.fc_pago.ALL)
>
> /home/wasuaje/Documentos/desarrollo/web2py2/gluon/dal.pyc in select(self, 
> *fields, **attributes)
>7576 adapter = self.db._adapter
>7577 fields = adapter.expand_all(fields, 
> adapter.tables(self.query))
> -> 7578 return adapter.select(self.query,fields,attributes)
>7579 
>7580 def delete(self):
>
> /home/wasuaje/Documentos/desarrollo/web2py2/gluon/dal.pyc in select(self, 
> query, fields, attributes)
>1318 limitby = attributes.get('limitby', None) or (0,)
>1319 rows = self.rowslice(rows,limitby[0],None)
> -> 1320 return self.parse(rows,fields,self._colnames)
>1321 
>1322 def _count(self, query, distinct=None):
>
> /home/wasuaje/Documentos/desarrollo/web2py2/gluon/dal.pyc in parse(self, 
> rows, fields, colnames, blob_decode)
>1615 colset = new_row[tablename]
>1616 colset[fieldname] = value = \
> -> 1617 
> self.parse_value(value,field.type,blob_decode)
>1618 
>1619 if field.type == 'id':
>
> /home/wasuaje/Documentos/desarrollo/web2py2/gluon/dal.pyc in 
> parse_value(self, value, field_type, blob_decode)
>1494 else:
>1495 key = regex_type.match(field_type).group(0)
> -> 1496 return self.parsemap[key](value,field_type)
>1497 
>1498 def parse_reference(self, value, field_type):
>
> KeyError: 'float'
>
>
> my model
> #
> db.define_table('fc_pago',
> Field('id','integer'),
> Field('fecha','date'),
> Field('total','double'), #tryed with decimal or float here in mysql is 
> float
> Field('descripcion','string'),
> Field('mt_persona_id','integer'),
> migrate=False)
>
> db.fc_pago.mt_persona_id.requires = IS_IN_DB(db,db.mt_persona.id,'%(nombres)s 
> %(apellidos)s' )
> db.fc_pago.mt_persona_id.represent=lambda val: db.mt_persona[val].nombres
>
>
>
> Database Mysql 
>
> mysql  Ver 14.14 Distrib 5.5.22, for debian-linux-gnu (i686) using 
> readline 6.2
>
> What's going on here?
>


[web2py] Re: KeyError: 'float' when selecting records

2012-05-16 Thread wuelfhis asuaje
Ok let me try !


[web2py] Re: KeyError: 'float' when selecting records

2012-05-16 Thread wuelfhis asuaje
Ok Massimo y tested with nightly build 1.99.7 and it's working know.

Now,, what should i do? work with this version, wait to be corrected in 
stable, or what?


Thanks


[web2py] Re: KeyError: 'float' when selecting records

2012-05-16 Thread wuelfhis asuaje
Ok Massimo y tested with nightly build 1.99.7 and it's working now.

Now,, what should i do? work with this version, wait to be corrected in 
stable, or what?


Thanks

[web2py] Updated slice: nginx and SCGI | Recipe | Web2py Slices - Recipes, Tutorials, Code, Questions

2012-05-16 Thread Michele Comitini
Changes:
- keep-alive support from nginx.
- secure https channel detection.
- process management tip.

http://www.web2pyslices.com/slice/show/1466/nginx-and-scgi

tnx

--
mic


[web2py] Re: How to use web2py DAL with sybase? Please point me to the sybase adapter

2012-05-16 Thread dlypka
OK I will download the trunk and try it tomorrow.

Thanks.

On Wednesday, May 16, 2012 4:48:39 PM UTC-5, Massimo Di Pierro wrote:
>
> I just committed a SybaseAdapter using this driver:
>
> http://python-sybase.sourceforge.net/
>
> It extends the MSSQLAdapter but uses the other driver and Sybase types.
> It needs testing.
>
> You can use it with
>
> DAL('sybase://dsnstring')
>
> or
>
> DAL('sybase://username:password@hostname:port/dbname')
>
> It uses this line to built the dsn string:
>
>dsn = 'sybase:host=%s:%s;dbname=%s' % (host,port,db)
>
> This is one line I am not sure about because the docs for the adapter do 
> not explain it and I cannot try it.
>
> Massimo
>
>
>
>
>
> On Wednesday, 16 May 2012 16:24:02 UTC-5, dlypka wrote:
>>
>> No preference on which python driver for sybase.
>> So whatever you select is fine with us.
>> Thanks.
>> - Dave Lypka.
>>
>> On Wednesday, May 16, 2012 4:10:28 PM UTC-5, Massimo Di Pierro wrote:
>>>
>>> Will send it tonight. Basically Sybase is almost the same as MSSQL. Do 
>>> you a preference for one of the pyhton drivers for sybase?
>>>
>>> On Wednesday, 16 May 2012 10:51:39 UTC-5, dlypka wrote:


 I do not see any reference to "sybase" in 1.99.7 dal.py.

 Please point me to the sybase adapter.

 There are 2 of us developers here at work who can test it for you on a 
 large corporate sybase database.

 Thanks.

 On Wednesday, May 16, 2012 10:42:05 AM UTC-5, Massimo Di Pierro wrote:
>
> web2py includes an adapter but nobody has tested it. If you can help 
> us test it we can help you debug any problem that may arise. 
> Compatibility 
> with sybase and other SQL DB engines is a priority.
>
>
>
> On Wednesday, 16 May 2012 07:47:59 UTC-5, dlypka wrote:
>>
>> I see this posting which has some sybase adapter code:
>>
>> https://groups.google.com/forum/?fromgroups#!searchin/web2py/sybase/web2py/LXdEdc1th3M/8ZIOxE8tJQgJ
>>  
>>
>> Is there anything else?
>>
>> I have a need to use web2y + sybase at work.
>>
>> Thanks.
>>
>

[web2py] How do I specify the migration rules?

2012-05-16 Thread csantos
Hi,
Suppose that in my db table I have a text field that stores data in an XML 
format. One day, I decide to change it to a text field with the same name 
but convert the data to json. In other words, I'd like to specify a 
migration rule (maybe a callback?) that would convert every single entry in 
my db from xml to json. Is there support for such a thing in web2py?

Another example: My field stores double data that represents amounts of 
money. Then I decide to change it to int, so the migration rule would be:
new_field = int(old_field*100.0)
return new_field


  1   2   >