[web2py] REST API no matching pattern

2012-12-30 Thread Jeff Kusi
I followed the example for the REST API (multiple times actually). However I keep getting *"**no matching pattern"* every time. In fact it looks like the auto pattern is not generating because when I navigate to api/patterns.json, I see {"content": "auto"} instead of the beautiful rendering

Re: [web2py] Added Conditional Validation in the Model...

2012-12-30 Thread Bruno Rocha
Ok, SQLITE does not allow it, so you can try a different approach. Remove the unique and the notnull *Field('unikey'', compute=lambda row: "%(user)d_%(location)s" % row) add a validator. db.site.unikey.requires = [IS_NOT_EMPTY(), IS_NOT_IN_DB(db, ' site.unikey')] * --

[web2py] Re: YUI3 IO POST

2012-12-30 Thread b00m_chef
The solution was that I needed to get rid of the following in my YUI 3 code: headers: { 'Content-Type': 'application/json' } Woohoo!! I can now send and receive JSON data :-D On Sunday, December 30, 2012 8:55:34 PM UTC-8, b00m_chef wrote: > > This might be a web2py b

Re: [web2py] Added Conditional Validation in the Model...

2012-12-30 Thread Jason Brower
However.  I just tried it and was told it can't be done. OperationalError: Cannot add a UNIQUE column Error snapshot help (Cannot add a UNIQUE column) Bummer. BR, Jason Brower On Sun, Dec 30, 2012 at 8:16 AM, Bruno Rocha wrote:  can see two options. 1. Use form validation: def check_user(fo

Re: [web2py] Added Conditional Validation in the Model...

2012-12-30 Thread Jason Brower
I'll take number 2. :) Looks much cleaner to me!  I new about number 1 but was hoping to see something that sat in the model.  Thanks. BR, Jason Brower On Sun, Dec 30, 2012 at 8:16 AM, Bruno Rocha wrote:  can see two options. 1. Use form validation: def check_user(form):     query = db.site.

[web2py] Re: web2py and redis queue

2012-12-30 Thread Bruno Rocha
The monitor tool runs on Flask I am sure it will be easy to write a web2py version of this. Maybe as a plugin. Em 31/12/2012 00:09, "Bruno Rocha" escreveu: > > Running delayed jobs with web2py and Redis Queue: > > http://rochacbruno.com.br/web2py-and-redis-queue/ > > Bruno. > --

Re: [web2py] Where to host web2py

2012-12-30 Thread Andrew
Hm ok, I think that threading error is just a red-herring. If you feel comfortable enough, I could try and import your setup into a spare gear on my account and triage it that way. You can take an exact export with the rhc snapshot command and I can import it and see if I can pin down what's up

Re: [web2py] Re: Python Redis Queue

2012-12-30 Thread Alec Taylor
On Mon, Dec 31, 2012 at 11:37 AM, Bruno Rocha wrote: > DONE!!! > > 1. create a file called web2py-rq.py > > #!/usr/bin/env python > import sys > from rq import Queue, Connection, Worker > > # Preload libraries > #import library_that_you_want_preloaded > > # Provide queue names to listen to as argu

[web2py] Serve different files based on JavaScript capability?

2012-12-30 Thread Alec Taylor
I have static versions of my pages generated by automatically headlessly snapshotting my AngularJS rendered pages. When JavaScript is disabled or a scraper views the site; I want the static versions to be served. Otherwise I want to server the JavaScript-heavy files. How do I do this in web2py; a

[web2py] YUI3 IO POST

2012-12-30 Thread b00m_chef
I have been trying to get web2py to read a post request sent from javascript, but without any success. I hope you guys can help figure out what is going on. Here is the code: View: YUI().use("json-stringify", "io", "dump", "json-parse", function(Y) { Y.io('data', { method: 'POST',

Re: [web2py] Re: Python Redis Queue

2012-12-30 Thread Bruno Rocha
DONE!!! 1. create a file called web2py-rq.py #!/usr/bin/env python import sys from rq import Queue, Connection, Worker # Preload libraries #import library_that_you_want_preloaded # Provide queue names to listen to as arguments to this script, # similar to rqworker with Connection(): qs = ma

Re: [web2py] `@service.json` works locally but not on Heroku?

2012-12-30 Thread Anthony
Keep in mind that you should be careful about when and where you enable generic views. The reason they are not always enabled by default is that they can allow private data to be leaked -- you may pass extra data to an HTML view that does not get rendered by the view (e.g., data used only to ev

Re: [web2py] Re: Python Redis Queue

2012-12-30 Thread Bruno Rocha
Just like this: https://github.com/ui/django-rq We shoukd have a web2py-rq --

Re: [web2py] Re: Python Redis Queue

2012-12-30 Thread Bruno Rocha
Would be better to find a way to start the rqworker inside the web2py environment python web2py.py -S myapp -M -R rqworker how to do it? --

Re: [web2py] Re: Python Redis Queue

2012-12-30 Thread Bruno Rocha
1. Instal Redis apt-get install redis-server 2. Install rq sudo pip install rq 3. Create a file in modules called queued_functions.py #!/usr/bin/env python #-*- coding:utf-8 -*- # need to put this for mail to work import sys sys.path.append("/path/to/web2py") from gluon.tools import Mail

[web2py] Re: Webfaction & web2py - upgraded to 2.3.2 and now nothing works remotely

2012-12-30 Thread wdtnh
If this helps. I noticed two things happen after I install the web2py script. - standard installation script - the welcome application works fine - edit the db.py file to switch from SQLITE to MYSQL db = DAL('mysql://myusername:mypwd@localhost/databasename',pool_size=1,check_reserved=['al

[web2py] Webfaction & web2py - upgraded to 2.3.2 and now nothing works remotely

2012-12-30 Thread wdtnh
Upgraded my web2py application on webfaction to latest version 2.3.2. - actually did a clean installation of web2py both locally and remotely. Created a new version of the mysql database instance as well - both local and remotely. Clean installation locally as well including database. Every

[web2py] Has anyone made a simple chat system with websocket_messaging.py? General questions about chat.

2012-12-30 Thread HittingSmoke
I was randomly tinkering around and discovered websocket_messaging.py I've got that running and it appears to be receiving messages from the sample functions but I can't seem to get them to actually display in the browser. I was wondering if there was some sort of nice, canned websocket javascr

[web2py] Re: Upload field with clear text filename

2012-12-30 Thread Alan Etkin
My bad: Assigning to a form.vars item before calling to .process() works The issue is that the first code posted by Joe tests for the boolean value of form.vars.upload (an instance of the file storage object) and that object always evaluates to False, so: if request.vars.update: is omitt

[web2py] Re: Python Redis Queue

2012-12-30 Thread Massimo Di Pierro
Could you show an example? On Sunday, 30 December 2012 15:11:12 UTC-6, rochacbruno wrote: > > Hi, I recently discovered a nice tool called Python RQ > > It is the same as Celery or web2py scheduller, but I find it easy to > install and manage. > > http://python-rq.org/ > > I just configured this

[web2py] Re: SQLFORM widget support for wider range of input types

2012-12-30 Thread Massimo Di Pierro
Seems like a good idea. What do other think? If the difference is only in the type, could we simply override the value of type using a class variable and use the widget method of the base class? Massimo On Sunday, 30 December 2012 12:01:06 UTC-6, Calvin wrote: > > Hi Massimo > > Here is a patch

[web2py] Re: Upload field with clear text filename

2012-12-30 Thread Massimo Di Pierro
This form=SQLFORM(db.fileobject) if request.vars.upload: form.vars.filename = request.vars.upload.filename if form.process().accepted: ... should work. Please open a ticket. On Friday, 28 December 2012 03:15:52 UTC-6, Joe Barnhart wrote: > > I'm not sure why this is difficul

[web2py] Python Redis Queue

2012-12-30 Thread Bruno Rocha
Hi, I recently discovered a nice tool called Python RQ It is the same as Celery or web2py scheduller, but I find it easy to install and manage. http://python-rq.org/ I just configured this as my mail sender on web2py app, works very well. --

[web2py] Re: upload from Edit page

2012-12-30 Thread Alan Etkin
I suspect you're trying to give a multi-file upload in-the-same-page solution as Google and other brands do: AFAIK the standard upload widget cannot handle multiple submissions in one form, but you could implement your own widget with the help of this thread: https://groups.google.com/d/topic/w

[web2py] Re: Streaming for large video files

2012-12-30 Thread Massimo Di Pierro
There are different issues with streaming. web2py supportes https streaming, if modified since, and range requests. This means that if the client is smart enough it will cache previously downloaded data and will request data in chunks (range requests) which will then be streamed by the server.

[web2py] Re: Streaming for large video files

2012-12-30 Thread Alan Etkin
> El domingo, 30 de diciembre de 2012 17:32:44 UTC-3, Magnitus escribió:I am currently in the process of writing a > netflix/youtube-like app that allows you stream movies on your local LAN (eventually, perhaps over the internet even, but that is > not an immediate priority, especially given my

Re: [web2py] Redmine beside web2py with Nginx deployment script

2012-12-30 Thread Arnon Marcus
10x for the info. Is there any benefit for using the server vs. the desktop flavor? About pgAdmin, I don't really understand what you mean. We have been using posgreSQL with web2py in production for almost 3 years now. Using phpPgAdmin on our production was never an option - always a necessity. Ma

[web2py] Re: Upload field with clear text filename

2012-12-30 Thread Alan Etkin
El viernes, 28 de diciembre de 2012 06:15:52 UTC-3, Joe Barnhart escribió: > > I'm not sure why this is difficult, but I see many posts about this when I > search, yet none exactly work for me. This seems like it should be easy > but is surprisingly difficult in web2py. A possible workaround (

Re: [web2py] how to create profiles

2012-12-30 Thread sasogeek
Worked! :) thanks On Sunday, 30 December 2012 19:59:28 UTC, Massimo Di Pierro wrote: > > How about > > #model > auth.settings.extra_fields['auth_user'] = [Field('personal_info','text')] > > #controller > def profile(): return dict(user=db.auth_user(request.args(0,cast=int))) > > #view profile.html

[web2py] Streaming for large video files

2012-12-30 Thread Magnitus
I am currently in the process of writing a netflix/youtube-like app that allows you stream movies on your local LAN (eventually, perhaps over the internet even, but that is not an immediate priority, especially given my limited data transfer allowance by my ISP) using a web interface. I am writ

Re: [web2py] Update and Delete row issue

2012-12-30 Thread Wonton
I will try to do it, but, since I have confidential data I don't know if I will be able do it. Meanwhile I will try to make a fresh app and go step by step. El domingo, 30 de diciembre de 2012 18:19:42 UTC+1, Niphlod escribió: > > > > On Sunday, December 30, 2012 2:33:42 PM UTC+1, Wonton wrote:

Re: [web2py] how to create profiles

2012-12-30 Thread Massimo Di Pierro
How about #model auth.settings.extra_fields['auth_user'] = [Field('personal_info','text')] #controller def profile(): return dict(user=db.auth_user(request.args(0,cast=int))) #view profile.html {{extend 'layout.html'}}{{=user.first_name}}{{=user.personal_info}} Mind that profile() should only

Re: [web2py] Redmine beside web2py with Nginx deployment script

2012-12-30 Thread Richard Vézina
Arnon, I test it with 12.04 server 64 bit under VirtualBox with windows 7 64 bit as guest and it works fine. It surely work under ubuntu desktop, but not tested. The purpose of the script is to deploy rapidly a new prod/stage server with basic configuration that you can tweaks for your needs later

Re: [web2py] Redmine beside web2py with Nginx deployment script

2012-12-30 Thread Richard Vézina
I will be glad, if you want to... :) Richard On Fri, Dec 28, 2012 at 11:12 PM, Massimo Di Pierro < massimo.dipie...@gmail.com> wrote: > Would you suggest we include it in web2py/scripts/? > > > On Friday, 28 December 2012 14:17:12 UTC-6, Richard wrote: >> >> Hello, >> >> This is a new year gif

[web2py] Re: SQLFORM widget support for wider range of input types

2012-12-30 Thread Calvin
Hi Massimo Here is a patch which updates the date, time and datetime widget. If this approach is acceptable, I am happy to provide a patch for the other types as well. Calvin On Sunday, 30 December 2012 00:50:59 UTC+8, Massimo Di Pierro wrote: > > I think this would be a good idea but somebody

Re: [web2py] how to create profiles

2012-12-30 Thread sasogeek
On Sunday, 30 December 2012 17:46:57 UTC, sasogeek wrote: > > can i create a new view so that i can have something like > http://...[app]/[controller]/[view]/profile/[user_id] and based on the user > id, the view displays a particular profile? like the show controller/view > in the example ima

Re: [web2py] how to create profiles

2012-12-30 Thread sasogeek
can i create a new view so that i can have something like http://...[app]/[controller]/[view]/[user_id] and based on the user id, the view displays a particular profile? like the show controller/view in the example images app in the documentation...? and even if so, can i have some code guidanc

Re: [web2py] how to create profiles

2012-12-30 Thread sasogeek
well in my application, i allow users to register and login using the auth, but auth only exposes http://...[app]/[controller]/[view]/profile which is the profile of the currently logged in user. i want to create a link so that other users can click on it to see other people's profiles. On Sunda

Re: [web2py] Redmine beside web2py with Nginx deployment script

2012-12-30 Thread Arnon Marcus
How do I manage the database with PGAdminII ? Which database should I choose? What would be the user-name? How can one install phpPGadmin on this configuration? On Sun, Dec 30, 2012 at 2:47 PM, Arnon Marcus wrote: > Is this for the server or desktop flavor ? > > > On Sun, Dec 30, 2012 at 2:16 P

Re: [web2py] Update and Delete row issue

2012-12-30 Thread Niphlod
On Sunday, December 30, 2012 2:33:42 PM UTC+1, Wonton wrote: > > But it's strange. I have all this code inside my default.py controller, > inside web2py. > Indeen, these 2 lines: > query = db(db.table.field1=='What I am looking for') > query.update(field2='hello') > work perfectly even witho

[web2py] Re: Update and Delete row issue

2012-12-30 Thread Anthony
> > 1) Regarding to the update: As far as I know, to update a row I should do something like this: >query = db(db.table.field1=='What I am looking for') >query.update(field2='hello') >rows = query.select() > >row = rows[0] >row.update_record() > > Note, you could also have

Re: [web2py] Update and Delete row issue

2012-12-30 Thread Wonton
But it's strange. I have all this code inside my default.py controller, inside web2py. Indeen, these 2 lines: query = db(db.table.field1=='What I am looking for') query.update(field2='hello') work perfectly even without the db.commit(). But, this code: query = db(db.table.field1=='What I am l

Re: [web2py] Update and Delete row issue

2012-12-30 Thread Niphlod
for future references: issuing db.commit() is necessary only if you're using DAL outside web2py. As soon as the function in the controller is executed, a db.commit() is issued automatically as long as no exceptions are thrown. query = db(db.table.field1=='What I am looking for') query.update(f

Re: [web2py] Redmine beside web2py with Nginx deployment script

2012-12-30 Thread Arnon Marcus
Is this for the server or desktop flavor ? On Sun, Dec 30, 2012 at 2:16 PM, Arnon Marcus wrote: > Will this work with ubuntu 12.10 ? > > > On Sat, Dec 29, 2012 at 6:12 AM, Massimo Di Pierro < > massimo.dipie...@gmail.com> wrote: > >> Would you suggest we include it in web2py/scripts/? >> >> >>

Re: [web2py] Redmine beside web2py with Nginx deployment script

2012-12-30 Thread Arnon Marcus
Will this work with ubuntu 12.10 ? On Sat, Dec 29, 2012 at 6:12 AM, Massimo Di Pierro < massimo.dipie...@gmail.com> wrote: > Would you suggest we include it in web2py/scripts/? > > > On Friday, 28 December 2012 14:17:12 UTC-6, Richard wrote: >> >> Hello, >> >> This is a new year gift for the one

Re: [web2py] Update and Delete row issue

2012-12-30 Thread Wonton
Hello viniciusban! The line "db.commit()" solved these 2 problems, thank you very much! Regarding to why I used "update_record()" without parameters, I took it from an example I saw on Internet, maybe the example was wrong or maybe (probably) I missunderstood the example. Thank you very much a