Re: [web2py] Forcing SSL on certain requests;

2011-01-29 Thread Philip Kilner
Hi David, On 30/01/2011 01:02, David J. wrote: Is there a utility available to force requests to SSL? (ex: Login, Register, etc..) Are you behind a web server? That may be a better place to manage that than on the web2py side, depending on you needs of course. You can do this with an Apach

[web2py] tip of the day with a challenge

2011-01-29 Thread Massimo Di Pierro
Immagine you have the following (suggested by user Nik): db.define_table('person',Field('name'),format='%(name)s') db.define_table('company', Field('name'),format='%(name)s') db.define_table('member',Field('person',db.Person), Field('company',db.company)) and a new table db.define_table('manager

[web2py] postfix on Ubuntu?

2011-01-29 Thread pbreit
Has anyone had any luck installing and using postfix on Ubuntu or other? I've been trying to follow the Ubuntu instructions without much luck: https://help.ubuntu.com/community/Postfix One question: do I use MECHANISMS="pam" or MECHANISMS="shadow" in /etc/default/saslauthd ? What do I set these

[web2py] Re: postfix on Ubuntu?

2011-01-29 Thread pbreit
Got it. Set the server to localhost. I think I had also made some changes to 'saslauthd' that might have helped. mail.settings.server = 'l ocalhost' mail.settings.sender = 'ro...@myserver.com' mail.settings.login = 'root:mypassword'

[web2py] Re: Need assistance to build dynamic queries

2011-01-29 Thread Massimo Di Pierro
I strongly suggest that you take a look at the jquery callback in the plugin_wiki controller. On Jan 29, 6:45 pm, AbortedF wrote: > Hi, > I have the following model definitions: > db.define_table('bl_nationality', >   Field('nationality', 'string') > ) > db.define_table('bl_names', >   Field('sur

[web2py] Re: CSV import broken?

2011-01-29 Thread Massimo Di Pierro
When you import a single table db.tableimport_from_csv_file the Ids get reassigned. If you export/import an entire database with db.export_to_csv_file(...)/db.import_from_csv_file(...) Ids are still re-assigned bit references are fixed. On Jan 29, 4:17 pm, Emceha wrote: > Hi, > > I have app

[web2py] Re: Bugfix for Checkbox

2011-01-29 Thread Massimo Di Pierro
thanks. In trunk. On Jan 29, 6:28 pm, Bernd Rothert wrote: > There is a small bug in web2py's HTML checkbox helper: > > >>> from gluon.html import * > >>> print INPUT(_type='radio', _value=2, value='2']) > > > > >>> print INPUT(_type='checkbox', _value=2, value=['1', '2', '3']) > > > > >>> prin

Re: [web2py] Re: The first code example of the CRUD Methods section of the online web2py book

2011-01-29 Thread Richard Vézina
On Sat, Jan 29, 2011 at 10:31 PM, Richard Vézina < ml.richard.vez...@gmail.com> wrote: > > > On Tue, Jan 18, 2011 at 1:06 AM, AW wrote: > >> Hi, Massimo. Thanks for your reply. >> >> My code: >> >> In the model: >> db = DAL('sqlite://storage.sqlite') >> db.define_table('person', Field('name', req

Re: [web2py] Re: The first code example of the CRUD Methods section of the online web2py book

2011-01-29 Thread Richard Vézina
On Tue, Jan 18, 2011 at 1:06 AM, AW wrote: > Hi, Massimo. Thanks for your reply. > > My code: > > In the model: > db = DAL('sqlite://storage.sqlite') > db.define_table('person', Field('name', requires=IS_NOT_EMPTY())) > > > In the controller: > def people(): >form = crud.create(db.person, nex

[web2py] Re: create table as select.

2011-01-29 Thread DenesL
To answer your first question I will illustrate it with an example: #models db.define_table('person', Field('name'), Field('age','integer'), format='%(name)s' ) db.define_table('dog', Field('name'), Field('owner','reference person'), format='%(name)s' ) #controller def build_new_tab

[web2py] Forcing SSL on certain requests;

2011-01-29 Thread David J.
Is there a utility available to force requests to SSL? (ex: Login, Register, etc..) I see one option in reCaptcha section; use_ssl=True But I looked in the FORM docs and don't see that as an option;

Re: [web2py] Deployment Confusion

2011-01-29 Thread Bruno Rocha
I suggest you webfaction.comthe easiest web2py hosting provider, you can easily setup many applications, manage its version, you have access to shell via ssh, ftp. webfaction has a very nice way to manage your applications separate

[web2py] Need assistance to build dynamic queries

2011-01-29 Thread AbortedF
Hi, I have the following model definitions: db.define_table('bl_nationality', Field('nationality', 'string') ) db.define_table('bl_names', Field('surname', 'string'), Field('forename', 'string'), Field('dob', 'date', requires=IS_DATE(format=T(''%Y-%m-%d'))), Field('nationality', db.bl_n

[web2py] Deployment Confusion

2011-01-29 Thread g...@rtplanb.com
I have been happily designing my business website for a while now. Web2Py is very easy to use and has been a brilliant way to learn html, css and a bit of java. I am getting close to wanting to deploy the first version of m site but honestly, after reading the deployment section of the web2py book

[web2py] Re: A simple question about avoiding race condition

2011-01-29 Thread Anthony
On Saturday, January 29, 2011 6:59:39 PM UTC-5, AW wrote: > The following two lines of code are often used in the web2py book: > > 1. db.define_table('person', Field('name', unique=True)) > 2. db.person.name.requires = IS_NOT_IN_DB(db, 'person.name') > > Well, given that line 1 already avoids r

[web2py] Bugfix for Checkbox

2011-01-29 Thread Bernd Rothert
There is a small bug in web2py's HTML checkbox helper: >>> from gluon.html import * >>> print INPUT(_type='radio', _value=2, value='2']) >>> print INPUT(_type='checkbox', _value=2, value=['1', '2', '3']) >>> print INPUT(_type='checkbox', _value='2', value=['1', '2', '3']) It's just a missin

[web2py] Bugfix for Checkbox

2011-01-29 Thread Bernd Rothert
There is a small bug in web2py's HTML checkbox helper: from gluon.html import * print INPUT(_type='radio', _value=2, value='2']) >>> print INPUT(_type='checkbox', _value=2, value=['1', '2', '3']) >>> print INPUT(_type='checkbox', _value='2', value=['1', '2', '3']) >>> It's just a missing st

[web2py] Re: The first code example of the CRUD Methods section of the online web2py book

2011-01-29 Thread AW
No one has tried that code example? On Jan 18, 1:06 am, AW wrote: > Hi, Massimo. Thanks for your reply. > > My code: > > In the model: > db = DAL('sqlite://storage.sqlite') > db.define_table('person', Field('name', requires=IS_NOT_EMPTY())) > > In the controller: > def people(): >     form = c

[web2py] A simple question about avoiding race condition

2011-01-29 Thread AW
The following two lines of code are often used in the web2py book: 1. db.define_table('person', Field('name', unique=True)) 2. db.person.name.requires = IS_NOT_IN_DB(db, 'person.name') Well, given that line 1 already avoids race condition at the database level, isn't line 2 more or less redundant

Re: [web2py] Re: PDF Reports with Pisa

2011-01-29 Thread Lucas D'Avila
Not need to install additional packages, the dependencies of Pisa already comes built in plugin. But if you want you can remove these packages that comes by default and install the dependencies. -- Lucas D'Avila http://flavors.me/lucasdavila Em 29/01/2011 20:07, "Ovidio Marinho" escreveu: > Bom,

Re: [web2py] Re: T-Shirts web2py

2011-01-29 Thread Albert Abril
Even, I like the concept of gnome love: *GnomeLove is an initiative that aims to help people who want to get started > contributing to GNOME.* *This page offers a collection of links to useful resources for aspiring > developers, testers, documenters or simply GNOME enthusiasts.* http://live.g

[web2py] Re: web2py and gae : Delete everything in the datastore

2011-01-29 Thread devGS
Great than. From my experience with that future, it takes time to delete in bulk and the process is is splitted into hours in order to save your CPU time. You can track the process through your datastore panels, task queue, etc. That's all I can comment about. Hopping to hear about your experience.

[web2py] Re: T-Shirts web2py

2011-01-29 Thread mart
well, except for the part of serving this on a web2py app, I wasn't being serious. Sorry for the confusion. Mart On Jan 29, 9:37 am, Massimo Di Pierro wrote: > I would avoid any reference to other python frameworks because 1) > people seem very touchy and, 2) we should go after PHP, ASP, JSP, n

[web2py] Re: django admin like app/plugin in web2py

2011-01-29 Thread mart
i meant to say a copy of admin (controller and view with a different name) is all that it takes to open up admin and make available (which is what I meant as "maybe a bug"). I'm just mentioning because that's what I did when I wanted to get my hands dirty and take admin apart to see how it works an

[web2py] CSV import broken?

2011-01-29 Thread Emceha
Hi, I have app at GAE and I decided to export all the data and import on my devel machine. So let's say user table line looks like this (there is just one user): auth_user.id,auth_user.first_name,auth_user.last_name,auth_user.email,auth_user.password,auth_user.registration_key,auth_user.reset_pas

Re: [web2py] Re: PDF Reports with Pisa

2011-01-29 Thread Ovidio Marinho
Bom, lucas , tudo ate agora foi testado em desenvolvimento , nada ate agora em produção, vou fazer um teste em produçao, precisa instalar pisa na produção, acho que nao vc ja embutiu o pisa no plugin, pelo que vi. 2011/1/29 Lucas D'Avila > What's your S.O ? I only tested it on ubuntu..., please

[web2py] Re: T-Shirts web2py

2011-01-29 Thread jeff
How about : Build th web! (AND GET A LIFE) On Jan 26, 3:24 pm, Massimo Di Pierro wrote: > How about > > "get it done!" or "build the web!" > > "get the things done" seems too long. I would buy some T-shirts. :-) > > On Jan 26, 2011, at 7:28 AM, Bruno Rocha wrote: > > > I dont like too much the

[web2py] Re: Modify calendar.js

2011-01-29 Thread Niphlod
datetime format is tied to datetime representation and that's bind to T() operator this snippet comes from web2py_ajax.html and it's responsible of calendar.js way to display time try {jQuery("input.date").live('focus',function() {Calendar.setup({ inputField:this, ifFormat:"{{=T('%

[web2py] Re: Fwd: web2py basic auth

2011-01-29 Thread Niphlod
sorry, my mistake! On Jan 29, 4:01 pm, Miguel Lopes wrote: > gluons/tools.py > > Txs, > Miguel > > On Sat, Jan 29, 2011 at 12:29 AM, Niphlod wrote: > > call_or_redirect() is the real "addition" here you can use both a > > URL or a function to manage on_failed_authentication and > > on_faile

[web2py] Re: Learning materials for newbie

2011-01-29 Thread Robert
What?!? No web2py tree on the cover!!! :-D -- Robert On 2011-01-28 16:46:25 -0500, Richard Vézina said: Web2py book : http://www.web2py.com/book Richard On Fri, Jan 28, 2011 at 4:38 PM, noob.py wrote: Hello, I'm totally new to programming, but very motivated to learn it. I'm especiall

Re: [web2py] Re: Is there an alternative to Django's Pinax in the world of Web2py? Options

2011-01-29 Thread Anthony
On Saturday, January 29, 2011 12:48:28 PM UTC-5, pbreit wrote: > Attachments don't seem to come through at the new Google Groups web site. Yeah, if you send an attachment to the group via email, it won't show up in the new Google Groups interface ( https://groups.google.com/d/msg/web2py/qeXXtr

Re: [web2py] Re: Is there an alternative to Django's Pinax in the world of Web2py? Options

2011-01-29 Thread Jonathan Lundell
On Jan 29, 2011, at 9:48 AM, pbreit wrote: > Attachments don't seem to come through at the new Google Groups web site. There are several attachments to messages in the group archive.

Re: [web2py] Re: Is there an alternative to Django's Pinax in the world of Web2py? Options

2011-01-29 Thread pbreit
Attachments don't seem to come through at the new Google Groups web site.

Re: [web2py] Re: Learning materials for newbie

2011-01-29 Thread Miguel Lopes
On Fri, Jan 28, 2011 at 11:01 PM, mikech wrote: > I've also found it pretty useful recently to run the web2py app from source > in a good ide, in my case WingIDE which I have a 10 day trial on, and step > thru the program using the debugger. Eclipse or Aptana with PyDev is also a good and free so

Re: [web2py] Re: web2py and gae : Delete everything in the datastore

2011-01-29 Thread Nathan VanHoudnos
Yes, I am doing something wrong. I needed to navigate to 'Datastore Admin' instead of 'Datastore Viewer'. The admin pages allows you to delete everything quickly. The viewer page only allows you to delete in chunks of 20. From: http://code.google.com/appengine/docs/python/datastore/entities.html

Re: [web2py] Re: query in DAL

2011-01-29 Thread beto (R3)
Hey Vasile: Cause I have more clauses based on the stock table that I haven't included in the original query. For example: SELECT date, count(items) FROM ( SELECT logs.date, logs.items FROM logs WHERE extract(year from logs.date) = 2010) GROUP BY date, items ) AS foo,

Re: [web2py] Re: query in DAL

2011-01-29 Thread Vasile Ermicioi
why do you need 'stock' table ? >> WHERE >> stock.items = foo.items

Re: [web2py] Re: query in DAL

2011-01-29 Thread beto (R3)
Hey Massimo: Let me try to explain it: End goal: Display the total amount of non-duplicated items inserted every date. I have the logs table that has many items that are inserted at a given date (item a, b, c, d, etc) . The problem is that the same item might get inserted several times at the sa

[web2py] Re: create table as select.

2011-01-29 Thread vortex
Because I have a controller that presents data for a table. So to present data which is a join of several tables, I would build a table and then use that same controller. Where can I find more information on how to make more complex queries and presenting data with web2py? On Jan 28, 6:27 pm, Den

Re: [web2py] Re: Fwd: web2py basic auth

2011-01-29 Thread Miguel Lopes
gluons/tools.py Txs, Miguel On Sat, Jan 29, 2011 at 12:29 AM, Niphlod wrote: > call_or_redirect() is the real "addition" here you can use both a > URL or a function to manage on_failed_authentication and > on_failed_authorization ... take a look in gluon/utils.py > > On Jan 28, 1:48 am, mi

[web2py] Re: How to do a count distinct with DAL?

2011-01-29 Thread Massimo Di Pierro
OK. Now in trunk: >>> db=DAL() >>> db.define_table('a',Field('b'),Field('c')) >>> db(db.a.b>0)._count() "SELECT count(*) FROM a WHERE (a.b > '0')" >>> db(db.a.b>0)._count(distinct=db.a.b) "SELECT count(DISTINCT a.b) FROM a WHERE (a.b > '0')" >>> db(db.a.b>0)._count(distinct=db.a.b|db.a.c) "SELECT

[web2py] Re: query in DAL

2011-01-29 Thread Massimo Di Pierro
Before we try write is? Can you explain it? There is a condition on stcok that seems a inner join but nothing is selected from the stock table. On Jan 28, 2:16 pm, "beto (R3)" wrote: > Hey guys: > > Is there a way to do this query in DAL? > > SELECT >     date, count(foo.items) > FROM > ( >  

[web2py] Re: Bugfix for full CRUD internal read links

2011-01-29 Thread Massimo Di Pierro
fixed in trunk now. On Jan 28, 12:33 pm, Bernd Rothert wrote: > The book's example for "full CRUD" > > def data(): return (form=crud()) > > doesn't set the proper links from > > .../data/select/         to > .../data/read// > > they instead go to > .../read// > > This patch fixes the issue: > > -

[web2py] Re: 2 quickies about cache

2011-01-29 Thread Massimo Di Pierro
I agree. As long as you know what you are doing, and you do, it is fine. On Jan 29, 1:12 am, Magnitus wrote: > > web2py uses the query "db.log.id==X" as the key for the cache (where X > > will be replaced by the actual value). > > Clever. Very simple, yet powerful. > > Thanks for the clarificatio

[web2py] Re: T-Shirts web2py

2011-01-29 Thread Massimo Di Pierro
I would avoid any reference to other python frameworks because 1) people seem very touchy and, 2) we should go after PHP, ASP, JSP, not Django. On Jan 29, 12:40 am, mart wrote: > just a thought... wouldn't an app, 'powered by web2py', where we go to > buy stuff (like t-shirts) take the cause furt

[web2py] Re: django admin like app/plugin in web2py

2011-01-29 Thread Massimo Di Pierro
Making appadmin available to all users is very dangerous because appadmin allows you to write ANY python in the search string. It is a major vulnerability if you give other users access to it. Instead of db.table.id>0 one can type for example [os.unlink[f] for f in os.listdir('./')]. Massimo O

Re: [web2py] Re: web2py and gae : Delete everything in the datastore

2011-01-29 Thread Nathan VanHoudnos
I tried that again this morning, but it only lets me delete 20 at a time. Am I doing something wrong? (I have hundreds of entries to delete.) Cheers, Nathan On Fri, Jan 28, 2011 at 5:35 PM, howesc wrote: > if i remember correctly the bulk delete was google's christmas present to > us - in the

[web2py] Re: empty list:reference seems like a bug

2011-01-29 Thread LightOfMooN
I add this rolic using "database administration -> add rolic" On 29 янв, 03:07, DenesL wrote: > On Jan 28, 4:47 pm, LightOfMooN wrote: > > > Running 1.91.6 too. > > > db.define_table('tag', > >     Field('name', 'string'), format='%(name)s') > > > db.define_table('rolic', > >     Field('name', '

Re: [web2py] Re: How to do a count distinct with DAL?

2011-01-29 Thread beto (R3)
Postgres too! On Fri, Jan 28, 2011 at 1:41 PM, villas wrote: >> It seems to work in SQLite and MS-SQL though. > > Firebird seems OK too. > >

Re: [web2py] query in DAL

2011-01-29 Thread beto (R3)
Hey Vasile: The end select would give an error.. belongs() translates to a: " db.logs.item IN ( SELECT db.logs.date, db.logs.item [..] )" "ERROR: subquery has too many columns" If the tables had id fields this technique could actually work tho... thanks! beto On Sat, Jan 29, 2011 at 4:13 AM

[web2py] Re: URL formation in CRUD

2011-01-29 Thread Running Clam
See: http://groups.google.com/group/web2py/browse_thread/thread/8aab803ada993cd3#

[web2py] Re: Bugfix for full CRUD internal read links

2011-01-29 Thread Running Clam
Hi Bernd, Thank you - I think that solves a problem I've been wrestling with. -- Clam

Re: [web2py] Re: web2pythonic way

2011-01-29 Thread rochacbruno
The WEP 8 says that it depends on the size of your application. In a small app keep everything in models. A bigger app put it in modules. That is my view. Em 29/01/2011, às 07:15, walter escreveu: > Is there something like PEP for web2py?

[web2py] Re: web2pythonic way

2011-01-29 Thread walter
Is there something like PEP for web2py?

[web2py] web2pythonic way

2011-01-29 Thread walter
I have to create several decorators for controllers. They needs only for particular application. Where should I place them? In the modules or in the models or in the site-packages? What way is more web2pythonic?

Re: [web2py] Re: PDF Reports with Pisa

2011-01-29 Thread Lucas D'Avila
What's your S.O ? I only tested it on ubuntu..., please send the traceback of the error. -- Lucas D'Avila http://flavors.me/lucasdavila Em 29/01/2011 04:21, "mart" escreveu:

Re: [web2py] Re: Is there an alternative to Django's Pinax in the world of Web2py? Options

2011-01-29 Thread Marin Pranjic
attachment On Sat, Jan 29, 2011 at 6:51 AM, Anthony wrote: > Where is it?