Re: [web2py] web2py recipe book

2012-03-17 Thread Bruce Wade
A lot of the code in the book looks to be from older recipes. I think most
should work with the new code. (However have not got through all the code
yet and have had a few problems with the ones I have tried)

On Fri, Mar 16, 2012 at 10:56 PM, Tim Alexander dragonfyr...@gmail.comwrote:

 Bought one for me, and one for a friend (kindle edition). Now to find the
 time to read it...




-- 
-- 
Regards,
Bruce Wade
http://ca.linkedin.com/in/brucelwade
http://www.wadecybertech.com
http://www.warplydesigned.com
http://www.fitnessfriendsfinder.com


[web2py] [ANNOUNCE] uWSGI 1.1

2012-03-17 Thread Roberto De Ioris

I am pleased to announce the 1.1 release of the uWSGI project.

This release focuses on a new option parser subsystem, improved perl/psgi
and ruby/rack support and a new (stable) php plugin. A lot of
optimizations have been introduced for the fastrouter and the various
threading modes. This is the first release officially deprecating some
old-style configuration (see notes).

Changelog [20120317]

- new options parser subsystem

- improved php support

http://projects.unbit.it/uwsgi/wiki/PHP

- multiple spooler with multiprocessing

simply add multiple --spooler options (on different directories) to have
multiple spooler. Add --spooler-processes to fork() them

- segmentation fault and floating point exceptions manager

you will get a handy backtrace whenever SIGSEGV and SIGFPE are triggered

- never-swap option

enabling this option will force uWSGI to lock all memory areas on physical
memory to avoid on-disk swapping.

- zergpool plugin

another step towards down-free reloads
http://projects.unbit.it/uwsgi/wiki/ZergMode

- perl/psgi multiple interpreters support

you can now mount multiple perl-apps in the same process

- deadlock detector

on some specific conditions, uwsgi locking subsystem can be damaged, the
master process got a new feature, allowing it to detect such conditions

- pluggable cheaper algos

by default the old-fashioned apache-style spare algorithm is used for
adaptive process spawning. A new one, based on socket listen queue can be
used, or you can implement a completely new approach:

http://projects.unbit.it/uwsgi/browser/plugins/cheaper_backlog2/cheaper_backlog2.c

- new internal routing susbsystem

http://projects.unbit.it/uwsgi/wiki/InternalRouting

- preliminary support for config logic

http://projects.unbit.it/uwsgi/wiki/ConfigLogic

- log rotation infrastructure

you can now trigger log-rotation simply touching files

- support for paste loggers

- threading improvements

- plugins can now mapped to specific modifiers

- app tag is deprecated (use mount option)

- report startup time for apps

- reintroduced expat support

by default libxml2 is searched, if it is not available libexpat will be
used. If both are not available, xml support will not be compiled in.

- reintroduced remote spooler plugin

- various fastrouter optimizations

- added ruby rvm support

add --gemset name option to set a specific rvm gemset

- a lot of fixes all over the place

Notes:

- app tag has been deprecated, some simple old-style-config still works,
but you should move to the new mount option. In uWSGI 1.2 the app tag
will map 1:1 to the mount one.

- xml support is now automatically detected (and eventually not compiled in)

Special thanks for this release go to

Anthon van der Neut (mongrel2 fixes and setuptools packaging)
Łukasz Mierzwa (bug-hunter in-chief)
Raffaele Colace (for the upython contrib script)
Cal Leeming
Ultrabug (ultrabug.fr, sorry i do not know your real name)
Riccardo Magliocchetti
C Anthony Risinger
Evgeny Turnaev
Marcin Deranek
Mike Kuznetsov

(sorry if i have missed someone)

You can download uWSGI 1.1 from

http://projects.unbit.it/downloads/uwsgi-1.1.tar.gz


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


[web2py] Re: Nginx and Web2py

2012-03-17 Thread pbreit
What script did you use? What server are you on? What did it do when it 
didn't work?

[web2py] Re: Setup Script: Ubuntu + Nginx + uWSGI

2012-03-17 Thread pbreit
Hard to say. Here's another script you could try:
https://bitbucket.org/pbreit/web2py-automation/src/bc2ac095b592/setup-ubuntu-nginx.sh

You could either run it as-is, update the versions and run or step through 
each command manually.


[web2py] Installing pyMantis in web2py

2012-03-17 Thread praveen krishna
Hii,
   Where can I get the URL or package of pyMantis app to instal in web2py.I 
have tried in  http://pymantis.org/ but I am unable to find .


Re: [web2py] Re: PIL software for win 64bit and python 2.7 64 bit

2012-03-17 Thread praveen krishna
Thank you Alan its working :)

On Fri, Mar 16, 2012 at 3:48 PM, Alan Etkin spame...@gmail.com wrote:

 This will probably let you install the package, although there's need
 for tweaking the windows registry (not the best solution, but you will
 be able to install the library)


 http://stackoverflow.com/questions/3652625/installing-setuptools-on-64-bit-windows
 http://selfsolved.com/problems/setuptools-06c11-fails-to-instal/s/63

 On Mar 16, 8:12 am, praveen krishna praveenchitne...@gmail.com
 wrote:
  Dear Alan,
 I tried to installhttp://
 effbot.org/downloads/PIL-1.1.7.win32-py2.7.exe but it is not
  getting installed it is giving following errors attched to this mail.
  Regards,
  Praveen.
 
 
 
 
 
 
 
  On Fri, Mar 16, 2012 at 11:54 AM, Alan Etkin spame...@gmail.com wrote:
   Not sure if that is the newest resource for the project, but seems
   that for 64 bits you'll have to download the source and build it in
   your system:
  http://effbot.org/downloads/Imaging-1.1.7.tar.gz
 
   Have you tried to install this package?
  http://effbot.org/downloads/PIL-1.1.7.win32-py2.7.exe
 
   On 16 mar, 06:50, praveen krishna praveenchitne...@gmail.com wrote:
Hii,
   Where can I fine the software PIL for win64bit .I am unable to get
   inhttp://www.pythonware.com/products/pil/whichcan be comatible with
   python
2.7 64bit.
 
 
 
   error generated for installing pil 01.jpg
  101KViewDownload
 
   error generated for installing pil.jpg
  138KViewDownload


[web2py] Gedit as IDE

2012-03-17 Thread Bruno Rocha
I really want to have somethink like this[1] for web2py

http://www.micahcarrick.com/gedit-as-a-django-ide-for-linux.html

I am trying to enroll my own plugin with gtk, does anybody worked on
something like this?

http://zerp.ly/rochacbruno


[web2py] Re: No DB queries in web2py shell?

2012-03-17 Thread Stefan Scholl
Stefan Scholl ste...@no-spoon.de wrote:
 Stefan Scholl ste...@no-spoon.de wrote:
 Person and dog inserted via database admin. After that the shell
 from the admin interface was used. The variable dogs was
 undefined after that. And no output with just
 db().select(db.dog.ALL).
 
 Tested the same on a Mac, web2py 1.99.7, the Mac app. Failed,
 too. But this time with an exception:
 
 
 web2py Shell (1, 99, 7, datetime.datetime(2012, 3, 4, 22, 12, 8), 'stable')In 
 [1] : dogs = db().select(db.dog.ALL)
 Traceback (most recent call last):
  File gluon/contrib/shell.py, line 233, in run
  File string, line 1, in module
  File gluon/dal.py, line 6343, in __getattr__
  File gluon/dal.py, line 6337, in __getitem__
 KeyError: 'dog'
 
 
 The tables are there and have content.


What is going on there??


Maybe this was a bad app to test the shell problem. There's a
database_examples/db.py that defines the tables I see in the
database administration interface (person, dog, ...) and then
there's the db.py which defines (persons, dogs, ...) and is seen
in the shell.


I'll make a cleaner testcase later.





[web2py] Re: Authenticating with Facebook using OAuth 2.0

2012-03-17 Thread Hassan Alnatour
Michele,

I have No Code in the Controller or in the View , i followed the book
instructions ..


Alan ,

The domain that i used for my website is a sub domain and when i
created an application in facebook i gave it the same domain .. and
its just the code that i showed you above i followed the instructions
in the book


[web2py] _extra Error when changing header column names for export_to_csv_file

2012-03-17 Thread Rey
Hi there,

I've spent hours and tried everything under the sun, I'm new to web2py
but loving the framework.

I want to be able to set the exported csv header row titles to not be 
table.id, table.name etc.
but rather a proper label ID, Name etc.

This is part of the code I'm using:

*from gluon.contenttype import contenttype
 ** response.headers['Content-Type'] = contenttype('.csv')
 ** response.headers['Content-disposition'] = 'attachment; 
 filename=%s_database.csv' % (
 **request.now
 ** )
 ** import csv, cStringIO
 ** s = cStringIO.StringIO()* 

 

*colnames=['id','name']* 

*records.export_to_csv_file(s, delimiter=',', quotechar='', 
 quoting=csv.QUOTE_NONNUMERIC, colnames=colnames)* 

*return s.getvalue()*

 

*
*
The error I keep getting is something to do with an _extra :

*Traceback (most recent call last):
 **  File /Users/Rey/Dropbox/web2py/gluon/restricted.py, line 204, in 
 restricted
 **exec ccode in environment
 **  File 
 /Users/Rey/Dropbox/web2py/applications/example/controllers/account.py, 
 line 187, in module
 **  File /Users/Rey/Dropbox/web2py/gluon/globals.py, line 172, in 
 lambda
 **self._caller = lambda f: f()
 **  File 
 /Users/Rey/Dropbox/web2py/applications/example/controllers/account.py, 
 line 183, in export
 **records.export_to_csv_file(s, delimiter=',', quotechar='', 
 quoting=csv.QUOTE_NONNUMERIC, colnames=colnames)
 **  File /Users/Rey/Dropbox/web2py/gluon/dal.py, line 6669, in 
 export_to_csv_file
 **row.append(record._extra[col])
 **  File /Users/Rey/Dropbox/web2py/gluon/dal.py, line 4440, in 
 __getattr__
 **return self[key]
 **  File /Users/Rey/Dropbox/web2py/gluon/dal.py, line 4431, in 
 __getitem__
 **return dict.__getitem__(self, key)
 **KeyError: '_extra'*


Version of Web2py I'm using is Version 1.99.4 (2011-12-14 14:46:14) stable

Any help would be much appreciated!


[web2py] Re: _extra Error when changing header column names for export_to_csv_file

2012-03-17 Thread Alan Etkin
The default value for colnames in .export_to_csv is rows.colnames.
Make sure the values you are customizing have the same format as this
attribute. Sometimes the fieldname arguments must specify the table
with dot syntax as following:

tablename.fieldname

The api documentation does not specify an option to customize the csv
output headers. I belive the headers use that format in order to have
a unified syntax when converting csv files to database records.

An alternative would be to change the csv output with the standard
python csv tools.

On Mar 17, 5:42 am, Rey azndest...@gmail.com wrote:
 Hi there,

 I've spent hours and tried everything under the sun, I'm new to web2py
 but loving the framework.

 I want to be able to set the exported csv header row titles to not be
 table.id, table.name etc.
 but rather a proper label ID, Name etc.

 This is part of the code I'm using:

 *from gluon.contenttype import contenttype

  ** response.headers['Content-Type'] = contenttype('.csv')
  ** response.headers['Content-disposition'] = 'attachment;
  filename=%s_database.csv' % (
  **    request.now
  ** )
  ** import csv, cStringIO
  ** s = cStringIO.StringIO()*

 *colnames=['id','name']*

 *records.export_to_csv_file(s, delimiter=',', quotechar='',

  quoting=csv.QUOTE_NONNUMERIC, colnames=colnames)*

 *return s.getvalue()*

 *
 *
 The error I keep getting is something to do with an _extra :

 *Traceback (most recent call last):









  **  File /Users/Rey/Dropbox/web2py/gluon/restricted.py, line 204, in
  restricted
  **    exec ccode in environment
  **  File
  /Users/Rey/Dropbox/web2py/applications/example/controllers/account.py,
  line 187, in module
  **  File /Users/Rey/Dropbox/web2py/gluon/globals.py, line 172, in
  lambda
  **    self._caller = lambda f: f()
  **  File
  /Users/Rey/Dropbox/web2py/applications/example/controllers/account.py,
  line 183, in export
  **    records.export_to_csv_file(s, delimiter=',', quotechar='',
  quoting=csv.QUOTE_NONNUMERIC, colnames=colnames)
  **  File /Users/Rey/Dropbox/web2py/gluon/dal.py, line 6669, in
  export_to_csv_file
  **    row.append(record._extra[col])
  **  File /Users/Rey/Dropbox/web2py/gluon/dal.py, line 4440, in
  __getattr__
  **    return self[key]
  **  File /Users/Rey/Dropbox/web2py/gluon/dal.py, line 4431, in
  __getitem__
  **    return dict.__getitem__(self, key)
  **KeyError: '_extra'*

 Version of Web2py I'm using is Version 1.99.4 (2011-12-14 14:46:14) stable

 Any help would be much appreciated!


[web2py] Re: Authenticating with Facebook using OAuth 2.0

2012-03-17 Thread Alan Etkin
I know this is odd, but I'd try using the this url in the facebook
application site url parameter:

http://www.test.i3zif.com:80/

As the book example asks to specify the tcp port of the address. If
you need to use https, then replace 80 with 443

On 17 mar, 07:35, Hassan Alnatour halna...@gardeniatelco.com wrote:
 Michele,

 I have No Code in the Controller or in the View , i followed the book
 instructions ..

 Alan ,

 The domain that i used for my website is a sub domain and when i
 created an application in facebook i gave it the same domain .. and
 its just the code that i showed you above i followed the instructions
 in the book


[web2py] Re: Authenticating with Facebook using OAuth 2.0

2012-03-17 Thread Hassan Alnatour
so you want me to make the application domain in facebook like this
http://www.test.i3zif.com:443 ??


[web2py] Creating a cms with restricted video streaming access

2012-03-17 Thread Alan Etkin
Hi. I have been asked to buiild a web site with these features and
requirements:

-Content managment for universitary students and teachers
Teachers will upload and edit course documents.
-Students must pay a fee to access the site's content.
-Students evaluation system with QA
-Online video classes
The site must allow (only authenticated) students to watch classes
live or from a site's class video archive.

Is there something already developed that I can use for this
requirements? I know there are lot of separated solutions (Martin's
Instant Press and I could mix them with more or less success, but I'd
like to know if someone found a starting project that covers this
requirements, so the development tasks can be decreased and there is
no need to reinvent the wheel.

For accessing video streams I am thinking of using a third-party brand
like vimeo or other similar, have anybody tested those services?

Could I use Instant Press for this project? Does it have this video
streaming features or should I develop something like an Instant Press
plugin for this case?.

Thank you.


[web2py] Re: Working locally on a snapshot of a GAE database

2012-03-17 Thread fabien
I did this: a bash script to download_data everything from the appengine's 
datastore, then upload_data it back to localhost:8080/XXX/_ah/remote_api.

But I still have a problem with ids: they're registered under the Key 
name column, whereas my application expects them to be under the id 
column. There is an ID (uppercase) column in the local datastore viewer, 
but it's empty.

So I'm a bit lost with the way the primary keys move around in each 
representation:

   - In the appengine's datastore, they are under column ID/Name under 
   the form id=;
   - once uploaded in my local datastore, they are under column Key name, 
   as numbers; there is a column ID, but it's empty;
   - In the csv files downloaded from appengine, they're in a column key;
   - my web2py application expects to access/filter them as field id.

Is there a document explaining how GAE primary keys work, at least in the 
context of W2P applications?


On Friday, March 16, 2012 11:40:02 PM UTC+1, howesc wrote:

 in my bulkloader.yaml i convert keys to strings and then use the 
 datastore.Key method on import to preserve IDs.  as a matter of example, my 
 yaml for auth_group:

 - kind: auth_group
   connector: csv
   connector_options:
   property_map:
 - property: __key__
   external_name: key
   export_transform: str
   import_transform: datastore.Key



[web2py] Key error that i don't understand based on the cookbook.

2012-03-17 Thread bussiere adrien
here is my db.py :

db.define_table('ImageFilmPreview',
   Field('Nom'),
   Field('date_Creation','date'),
   Field('Tag','list:reference Tag'),
   Field('FamilleTag','list:reference FamilleTag'),
   Field('Type','list:reference Type'),
   Field('Valeur_Ticket','double'),
   Field('Description_Courte'),
   Field('Description_Longue'),
   Field('Image'),#a revoir 
   Field('Texte_contenu','list:reference Texte_contenu'),
   Field('Link','list:reference Link'),
   Field('Note_divers','list:reference Note_divers'),
   format = '%(Nom)s')


db.define_table('Film',
   Field('Nom'),
   Field('UrlPreview'),
   Field('date_Creation','date'),
   Field('date_Publication','date'),
   Field('Tag','list:reference Tag'),
   Field('FamilleTag','list:reference FamilleTag'),
   Field('Type','list:reference Type'),
   Field('Valeur_Ticket','double'),
   Field('Description_Courte'),
   Field('Description_Longue'),
   Field('ImageFilm','list:reference ImageFilm'),
   Field('ImageFilmPreview','list:reference ImagePreview'),
   Field('Texte_contenu','list:reference Texte_contenu'),
   Field('Acteur','list:reference Acteur'),
   Field('Avis','list:reference Avis'),
   Field('Link','list:reference Link'),
   Field('Note_divers','list:reference Note_divers'),
   format = '%(Nom)s')


here is my default.py :

def admindanakFilm():
Line 88:form1 = crud.create(db.Film, next='admindanakFilm')
films = db(db.Film).select(orderby=db.Film.id)
film = db.company(request.args(0)) or redirect(URL('admindanak'))
form2 = crud.update(db.Film, film, next='Film')
return locals()


and here is my template :
h2Companies/h2
table
h2New Film/h2
{{=form1}}
br
h2Film edit/h2
{{=form2}}
br

{{for Film in films:}}
tr
td{{=A(Film.Nom)}}/td
td{{=A('edit', _href=URL('admindanakFilm',
args=Film.id))}}/td
/tr
{{pass}}
tr
td/td
/tr
/table


and it gave to me :

127.0.0.1.2012-03-17.14-33-40.9b6207b2-aaf8-4dec-8c10-a4321f3616aa
type 'exceptions.KeyError' 'Nom'VERSIONweb2py™(1, 99, 7, 
datetime.datetime(2012, 3, 4, 22, 12, 8), 'stable')PythonPython 2.5.4: 
C:\Users\Bussiere\Dropbox\Projets\danak\web2py\web2py.exeTRACEBACK

1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.

Traceback (most recent call last):
  File gluon/restricted.py, line 205, in restricted
  File 
C:/Users/Bussiere/Dropbox/Projets/danak/web2py/applications/init/controllers/default.py
 http://127.0.0.1:8000/admin/default/edit/init/controllers/default.py, line 
96, in module
  File gluon/globals.py, line 173, in lambda
  File 
C:/Users/Bussiere/Dropbox/Projets/danak/web2py/applications/init/controllers/default.py
 http://127.0.0.1:8000/admin/default/edit/init/controllers/default.py, line 
88, in admindanakFilm
  File gluon/tools.py, line 3172, in create
  File gluon/tools.py, line 3089, in update
  File gluon/sqlhtml.py, line 870, in __init__
  File gluon/sqlhtml.py, line 283, in widget
  File gluon/sqlhtml.py, line 216, in widget
  File gluon/validators.py, line 465, in options
  File gluon/validators.py, line 447, in build_set
  File gluon/dal.py, line 6714, in __getitem__



[web2py] Re: Key error that i don't understand based on the cookbook.

2012-03-17 Thread bussiere adrien
Found it the error was not so explicit all my name film and actors was name.

Bussiere

Le samedi 17 mars 2012 14:35:30 UTC+1, bussiere adrien a écrit :

 here is my db.py :

 db.define_table('ImageFilmPreview',
Field('Nom'),
Field('date_Creation','date'),
Field('Tag','list:reference Tag'),
Field('FamilleTag','list:reference FamilleTag'),
Field('Type','list:reference Type'),
Field('Valeur_Ticket','double'),
Field('Description_Courte'),
Field('Description_Longue'),
Field('Image'),#a revoir 
Field('Texte_contenu','list:reference Texte_contenu'),
Field('Link','list:reference Link'),
Field('Note_divers','list:reference Note_divers'),
format = '%(Nom)s')


 db.define_table('Film',
Field('Nom'),
Field('UrlPreview'),
Field('date_Creation','date'),
Field('date_Publication','date'),
Field('Tag','list:reference Tag'),
Field('FamilleTag','list:reference FamilleTag'),
Field('Type','list:reference Type'),
Field('Valeur_Ticket','double'),
Field('Description_Courte'),
Field('Description_Longue'),
Field('ImageFilm','list:reference ImageFilm'),
Field('ImageFilmPreview','list:reference ImagePreview'),
Field('Texte_contenu','list:reference Texte_contenu'),
Field('Acteur','list:reference Acteur'),
Field('Avis','list:reference Avis'),
Field('Link','list:reference Link'),
Field('Note_divers','list:reference Note_divers'),
format = '%(Nom)s')


 here is my default.py :

 def admindanakFilm():
 Line 88:form1 = crud.create(db.Film, next='admindanakFilm')
 films = db(db.Film).select(orderby=db.Film.id)
 film = db.company(request.args(0)) or redirect(URL('admindanak'))
 form2 = crud.update(db.Film, film, next='Film')
 return locals()


 and here is my template :
 h2Companies/h2
 table
 h2New Film/h2
 {{=form1}}
 br
 h2Film edit/h2
 {{=form2}}
 br

 {{for Film in films:}}
 tr
 td{{=A(Film.Nom)}}/td
 td{{=A('edit', _href=URL('admindanakFilm',
 args=Film.id))}}/td
 /tr
 {{pass}}
 tr
 td/td
 /tr
 /table


 and it gave to me :

 127.0.0.1.2012-03-17.14-33-40.9b6207b2-aaf8-4dec-8c10-a4321f3616aa
 type 'exceptions.KeyError' 'Nom'VERSIONweb2py™(1, 99, 7, 
 datetime.datetime(2012, 3, 4, 22, 12, 8), 'stable')PythonPython 2.5.4: 
 C:\Users\Bussiere\Dropbox\Projets\danak\web2py\web2py.exeTRACEBACK

 1.
 2.
 3.
 4.
 5.
 6.
 7.
 8.
 9.
 10.
 11.
 12.
 13.
 14.
 15.

 Traceback (most recent call last):
   File gluon/restricted.py, line 205, in restricted
   File 
 C:/Users/Bussiere/Dropbox/Projets/danak/web2py/applications/init/controllers/default.py
  http://127.0.0.1:8000/admin/default/edit/init/controllers/default.py, line 
 96, in module
   File gluon/globals.py, line 173, in lambda
   File 
 C:/Users/Bussiere/Dropbox/Projets/danak/web2py/applications/init/controllers/default.py
  http://127.0.0.1:8000/admin/default/edit/init/controllers/default.py, line 
 88, in admindanakFilm
   File gluon/tools.py, line 3172, in create
   File gluon/tools.py, line 3089, in update
   File gluon/sqlhtml.py, line 870, in __init__
   File gluon/sqlhtml.py, line 283, in widget
   File gluon/sqlhtml.py, line 216, in widget
   File gluon/validators.py, line 465, in options
   File gluon/validators.py, line 447, in build_set
   File gluon/dal.py, line 6714, in __getitem__



[web2py] Re: Key error that i don't understand based on the cookbook.

2012-03-17 Thread bussiere adrien
Found it all my db have name and one had a mystake.

Regards
Bussiere

Le samedi 17 mars 2012 14:35:30 UTC+1, bussiere adrien a écrit :

 here is my db.py :

 db.define_table('ImageFilmPreview',
Field('Nom'),
Field('date_Creation','date'),
Field('Tag','list:reference Tag'),
Field('FamilleTag','list:reference FamilleTag'),
Field('Type','list:reference Type'),
Field('Valeur_Ticket','double'),
Field('Description_Courte'),
Field('Description_Longue'),
Field('Image'),#a revoir 
Field('Texte_contenu','list:reference Texte_contenu'),
Field('Link','list:reference Link'),
Field('Note_divers','list:reference Note_divers'),
format = '%(Nom)s')


 db.define_table('Film',
Field('Nom'),
Field('UrlPreview'),
Field('date_Creation','date'),
Field('date_Publication','date'),
Field('Tag','list:reference Tag'),
Field('FamilleTag','list:reference FamilleTag'),
Field('Type','list:reference Type'),
Field('Valeur_Ticket','double'),
Field('Description_Courte'),
Field('Description_Longue'),
Field('ImageFilm','list:reference ImageFilm'),
Field('ImageFilmPreview','list:reference ImagePreview'),
Field('Texte_contenu','list:reference Texte_contenu'),
Field('Acteur','list:reference Acteur'),
Field('Avis','list:reference Avis'),
Field('Link','list:reference Link'),
Field('Note_divers','list:reference Note_divers'),
format = '%(Nom)s')


 here is my default.py :

 def admindanakFilm():
 Line 88:form1 = crud.create(db.Film, next='admindanakFilm')
 films = db(db.Film).select(orderby=db.Film.id)
 film = db.company(request.args(0)) or redirect(URL('admindanak'))
 form2 = crud.update(db.Film, film, next='Film')
 return locals()


 and here is my template :
 h2Companies/h2
 table
 h2New Film/h2
 {{=form1}}
 br
 h2Film edit/h2
 {{=form2}}
 br

 {{for Film in films:}}
 tr
 td{{=A(Film.Nom)}}/td
 td{{=A('edit', _href=URL('admindanakFilm',
 args=Film.id))}}/td
 /tr
 {{pass}}
 tr
 td/td
 /tr
 /table


 and it gave to me :

 127.0.0.1.2012-03-17.14-33-40.9b6207b2-aaf8-4dec-8c10-a4321f3616aa
 type 'exceptions.KeyError' 'Nom'VERSIONweb2py™(1, 99, 7, 
 datetime.datetime(2012, 3, 4, 22, 12, 8), 'stable')PythonPython 2.5.4: 
 C:\Users\Bussiere\Dropbox\Projets\danak\web2py\web2py.exeTRACEBACK

 1.
 2.
 3.
 4.
 5.
 6.
 7.
 8.
 9.
 10.
 11.
 12.
 13.
 14.
 15.

 Traceback (most recent call last):
   File gluon/restricted.py, line 205, in restricted
   File 
 C:/Users/Bussiere/Dropbox/Projets/danak/web2py/applications/init/controllers/default.py
  http://127.0.0.1:8000/admin/default/edit/init/controllers/default.py, line 
 96, in module
   File gluon/globals.py, line 173, in lambda
   File 
 C:/Users/Bussiere/Dropbox/Projets/danak/web2py/applications/init/controllers/default.py
  http://127.0.0.1:8000/admin/default/edit/init/controllers/default.py, line 
 88, in admindanakFilm
   File gluon/tools.py, line 3172, in create
   File gluon/tools.py, line 3089, in update
   File gluon/sqlhtml.py, line 870, in __init__
   File gluon/sqlhtml.py, line 283, in widget
   File gluon/sqlhtml.py, line 216, in widget
   File gluon/validators.py, line 465, in options
   File gluon/validators.py, line 447, in build_set
   File gluon/dal.py, line 6714, in __getitem__



[web2py] list:reference and crud.create a form in a form or a popup (django style) recipe ?

2012-03-17 Thread bussiere adrien
Is there a recipe anywhere to show how to do when a i have a external 
reference in my db table as liste:reference
to make it simple to add existing references or make a popup to create a 
new reference ?

exemple :
db.define_table('Film',
   Field('nom'),
   Field('Acteur','list:reference Acteur'),

When i make a form1 = crud.create(db.Film)
it sho me just a field and not menu as django or a field list or create a 
new one.

Is there a recipe anywhere to do that ?

Regards
Bussiere


[web2py] Re: Cookbook - No indentation ??

2012-03-17 Thread Marcello
Hello,

I contacted Packt about this problem.
They admitted a problem with Kindle format (MOBI).

They were very nice and gave me access to ePub and PDF format.

But I noticed that ePub has the same formatting problem as MOBI.

The only format that is OK is PDF
So.. if you want this book, know that the only one that is OK is PDF


Thanks,

Marcello



On Thursday, March 15, 2012 8:11:34 PM UTC-3, Monte Milanuk wrote:

 On Thu, 15 Mar 2012 12:32:14 -0700, Marcello wrote:

  I bought mine from Amazon... don't know if I have access to that
  
  But my interest in the moment is not run code. I want to read the
  book
  
  And read the code without indentation is almost impossible...
  
  If my book is correct, it is almost useless.



[web2py] Re: Working locally on a snapshot of a GAE database

2012-03-17 Thread fabien
Answering myself, I found the answer there: 
https://groups.google.com/forum/?fromgroups#!topic/google-appengine/PyEdQs9UTBo

Supposing that the primary keys are in field id, the __key__ 
import/export snippets in bulkloader.yaml should read:

- property: __key__
  external_name: id
  export_transform: transform.key_id_or_name_as_string
  import_transform: transform.create_foreign_key('id', key_is_id=True)



Re: [web2py] Re: Cookbook - No indentation ??

2012-03-17 Thread Bruce Wade
The PDF is not perfect, but is OK. Somethings are indented that shouldn't
be so you really have to understand the code to be able to figure it out.
The best option is to download the source code to learn from.

On Sat, Mar 17, 2012 at 7:24 AM, Marcello parro...@gmail.com wrote:

 Hello,

 I contacted Packt about this problem.
 They admitted a problem with Kindle format (MOBI).

 They were very nice and gave me access to ePub and PDF format.

 But I noticed that ePub has the same formatting problem as MOBI.

 The only format that is OK is PDF
 So.. if you want this book, know that the only one that is OK is PDF


 Thanks,

 Marcello



 On Thursday, March 15, 2012 8:11:34 PM UTC-3, Monte Milanuk wrote:

 On Thu, 15 Mar 2012 12:32:14 -0700, Marcello wrote:

  I bought mine from Amazon... don't know if I have access to that
 
  But my interest in the moment is not run code. I want to read the
  book
 
  And read the code without indentation is almost impossible...
 
  If my book is correct, it is almost useless.




-- 
-- 
Regards,
Bruce Wade
http://ca.linkedin.com/in/brucelwade
http://www.wadecybertech.com
http://www.warplydesigned.com
http://www.fitnessfriendsfinder.com


[web2py] Re: _extra Error when changing header column names for export_to_csv_file

2012-03-17 Thread Anthony
I think the colnames argument to export_to_csv_file is just to specify 
which particular columns to include in the export, not to rename the 
columns in the output. When it gets to a column name that isn't one of the 
fields, it checks in the record's _extra attribute (which is used to 
store aggregates like sum and count), and not finding an _extra attribute 
in this case raises a KeyError exception.

I'm not sure you can easily change the column names. You might set 
write_columns=False (so the column names don't get written at all), and 
then add your own row of column names at the top of the file.

Anthony

On Saturday, March 17, 2012 4:42:58 AM UTC-4, Rey wrote:

 Hi there,

 I've spent hours and tried everything under the sun, I'm new to web2py
 but loving the framework.

 I want to be able to set the exported csv header row titles to not be 
 table.id, table.name etc.
 but rather a proper label ID, Name etc.

 This is part of the code I'm using:

 *from gluon.contenttype import contenttype
 ** response.headers['Content-Type'] = contenttype('.csv')
 ** response.headers['Content-disposition'] = 'attachment; 
 filename=%s_database.csv' % (
 **request.now
 ** )
 ** import csv, cStringIO
 ** s = cStringIO.StringIO()* 

  

 *colnames=['id','name']* 

 *records.export_to_csv_file(s, delimiter=',', quotechar='', 
 quoting=csv.QUOTE_NONNUMERIC, colnames=colnames)* 

 *return s.getvalue()*

  

 *
 *
 The error I keep getting is something to do with an _extra :

 *Traceback (most recent call last):
 **  File /Users/Rey/Dropbox/web2py/gluon/restricted.py, line 204, in 
 restricted
 **exec ccode in environment
 **  File 
 /Users/Rey/Dropbox/web2py/applications/example/controllers/account.py, 
 line 187, in module
 **  File /Users/Rey/Dropbox/web2py/gluon/globals.py, line 172, in 
 lambda
 **self._caller = lambda f: f()
 **  File 
 /Users/Rey/Dropbox/web2py/applications/example/controllers/account.py, 
 line 183, in export
 **records.export_to_csv_file(s, delimiter=',', quotechar='', 
 quoting=csv.QUOTE_NONNUMERIC, colnames=colnames)
 **  File /Users/Rey/Dropbox/web2py/gluon/dal.py, line 6669, in 
 export_to_csv_file
 **row.append(record._extra[col])
 **  File /Users/Rey/Dropbox/web2py/gluon/dal.py, line 4440, in 
 __getattr__
 **return self[key]
 **  File /Users/Rey/Dropbox/web2py/gluon/dal.py, line 4431, in 
 __getitem__
 **return dict.__getitem__(self, key)
 **KeyError: '_extra'*


 Version of Web2py I'm using is Version 1.99.4 (2011-12-14 14:46:14) stable

 Any help would be much appreciated!



Re: [web2py] Re: Nginx and Web2py

2012-03-17 Thread Bruce Wade
Ubuntu 11.10, setup-web2py-nginx-uwsgi-ubuntu.sh. When it didn't work I
changed the file and submitted it back to the community.

The install for uwsgi-python doesn't work instead you need to change to:
apt-get -y install uwsgi uwsgi-plugin-python

Then update the path you save the configuration file from:
/etc/uwsgi-python/apps-available.
to
/etc/*uwsgi*/apps-available..

I also changed the user/group from www-data to a custom one to make
deployment much smother

Finally had to update the command that starts uwsgi from
/etc/init.d/uwsgi-python restart
to
/etc/init.d/*uwsgi* restart

On Sat, Mar 17, 2012 at 1:26 AM, pbreit pbreitenb...@gmail.com wrote:

 What script did you use? What server are you on? What did it do when it
 didn't work?




-- 
-- 
Regards,
Bruce Wade
http://ca.linkedin.com/in/brucelwade
http://www.wadecybertech.com
http://www.warplydesigned.com
http://www.fitnessfriendsfinder.com


[web2py] Re: Authenticating with Facebook using OAuth 2.0

2012-03-17 Thread Alan Etkin
I meant the other parameter (site URL or something of the like)

On 17 mar, 09:48, Hassan Alnatour halna...@gardeniatelco.com wrote:
 so you want me to make the application domain in facebook like 
 thishttp://www.test.i3zif.com:443??


[web2py] Re: Authenticating with Facebook using OAuth 2.0

2012-03-17 Thread Alan Etkin
https://www.test.i3zif.com:443
or
http://www.test.i3zif.com:80

On 17 mar, 09:48, Hassan Alnatour halna...@gardeniatelco.com wrote:
 so you want me to make the application domain in facebook like 
 thishttp://www.test.i3zif.com:443??


[web2py] Re: Authenticating with Facebook using OAuth 2.0

2012-03-17 Thread Alan Etkin
Hassan, I clicked more than the necessary in my browser, and marked
one of your messages as spam (unintentionally, of course)

On 17 mar, 13:22, Alan Etkin spame...@gmail.com wrote:
 https://www.test.i3zif.com:443
 orhttp://www.test.i3zif.com:80

 On 17 mar, 09:48, Hassan Alnatour halna...@gardeniatelco.com wrote:







  so you want me to make the application domain in facebook like 
  thishttp://www.test.i3zif.com:443??


[web2py] Interesting Stop Writing Classes talk from PyCon

2012-03-17 Thread Anthony
http://pyvideo.org/video/880/stop-writing-classes



[web2py] Odd auth problem

2012-03-17 Thread Keith Edmunds
I have a function whose definition starts as follows:

@auth.requires_login()
def rbb_time(category_id, from_date, to_date, user_id=auth.user.id):

It works fine. I'll leave the development of this application for a few
days, come back, run it, and get:

Traceback (most recent call last):
  File /home/kae/hg/kae/web2py.1.99.4.pytrack2/gluon/restricted.py, line
  204, in restricted exec ccode in environment
File [...]/controllers/default.py, line 100, in module 
  def rbb_time(category_id, from_date, to_date, user_id=auth.user.id): 
AttributeError: 'NoneType' object has no attribute 'id'

The only way to fix it (and this isn't 100% reliable) is to comment out
all of the @auth.requires_login() lines, hard-code the above function
definition to end user_id=11 (the UID I was logged in as), and then
call /default/user/logout.

Can anyone offer any suggestions as to what is going on here?

Thanks,
Keith


[web2py] Re: No DB queries in web2py shell?

2012-03-17 Thread Stefan Scholl
Stefan Scholl ste...@no-spoon.de wrote:
 Maybe this was a bad app to test the shell problem. There's a
 
 I'll make a cleaner testcase later.

On MacOS X 10.7, with Mac version of Web2py:

OK, new and simple app, SQLite, web2py 1.99.7. In db.py I define
a table foo:  db.define_table('foo', Field('something'))

Filled it in the database administrator interface.

In the shell:

x = db().select(db.foo.ALL)

and nothing. No output.

Then I enter just x + return. Nothing.

Next: print x. Now I get something. And when I now just enter
x I get an output, too.


Transcript:

-
web2py Shell (1, 99, 7, datetime.datetime(2012, 3, 4, 22, 12, 8), 'stable')In 
[1] : print x
[Row {'id': 1, 'something': 'hello'}, Row {'id': 2, 'something': 'world'}]

In [2] : x
[Row {'id': 1, 'something': 'hello'}, Row {'id': 2, 'something': 'world'}]
-


Conclusion: Not a serious bug. It just doesn't output anything
for the query and the variable, unless it has printed something
with print before.


Next test: Start the shell again, print something and then make
the query again:
-
web2py Shell (1, 99, 7, datetime.datetime(2012, 3, 4, 22, 12, 8), 'stable')In 
[1] : print some test
some test

In [2] : x
[Row {'id': 1, 'something': 'hello'}, Row {'id': 2, 'something': 'world'}]
-

No output for the query, but I get at least x.


Overall conclusion: Queries in the web2py web shell work on Mac,
with some minor glitch. But different symptoms than the ones on
Windows. Have to check again on Windows.





Re: [web2py] Re: Cookbook - No indentation ??

2012-03-17 Thread Angelo Compagnucci
Kindle and other ebook readers that doesn't support pdf are useless for
viewing technical documents because text is reflowable, always. So blanks
are removed and text is full aligned.

Please don't screw with packtpub, amazon or others, is a common problem
with all reflowable mobile formats.

I have an ebook reader that supports all mobile formats (BeBook One) and
pdf (non digital editions) is the only readable format for tech documents.
I read always on my bebook one!

Publishers never says that, because they will not sell technical ebooks
anymore!

2012/3/17 Bruce Wade bruce.w...@gmail.com

 The PDF is not perfect, but is OK. Somethings are indented that shouldn't
 be so you really have to understand the code to be able to figure it out.
 The best option is to download the source code to learn from.


 On Sat, Mar 17, 2012 at 7:24 AM, Marcello parro...@gmail.com wrote:

 Hello,

 I contacted Packt about this problem.
 They admitted a problem with Kindle format (MOBI).

 They were very nice and gave me access to ePub and PDF format.

 But I noticed that ePub has the same formatting problem as MOBI.

 The only format that is OK is PDF
 So.. if you want this book, know that the only one that is OK is PDF


 Thanks,

 Marcello



 On Thursday, March 15, 2012 8:11:34 PM UTC-3, Monte Milanuk wrote:

 On Thu, 15 Mar 2012 12:32:14 -0700, Marcello wrote:

  I bought mine from Amazon... don't know if I have access to that
 
  But my interest in the moment is not run code. I want to read the
  book
 
  And read the code without indentation is almost impossible...
 
  If my book is correct, it is almost useless.




 --
 --
 Regards,
 Bruce Wade
 http://ca.linkedin.com/in/brucelwade
 http://www.wadecybertech.com
 http://www.warplydesigned.com
 http://www.fitnessfriendsfinder.com




-- 
Profile: http://it.linkedin.com/in/compagnucciangelo


Re: [web2py] Re: Cookbook - No indentation ??

2012-03-17 Thread Marcello
I screwed with nobody.
I just pointed a fact.

I have many Python eBooks(ePub) and ALL of them have NO formatting 
or indentation problem.
Even Kindle has no indentation problem in all of my Python books.


Marcello



On Saturday, March 17, 2012 3:04:58 PM UTC-3, AngeloC wrote:

 Kindle and other ebook readers that doesn't support pdf are useless for 
 viewing technical documents because text is reflowable, always. So blanks 
 are removed and text is full aligned.

 Please don't screw with packtpub, amazon or others, is a common problem 
 with all reflowable mobile formats.

 I have an ebook reader that supports all mobile formats (BeBook One) and 
 pdf (non digital editions) is the only readable format for tech documents. 
 I read always on my bebook one!

 Publishers never says that, because they will not sell technical ebooks 
 anymore!




Re: [web2py] Re: Cookbook - No indentation ??

2012-03-17 Thread Jonathan Lundell
On Mar 17, 2012, at 11:22 AM, Marcello wrote:
 I screwed with nobody.
 I just pointed a fact.
 
 I have many Python eBooks(ePub) and ALL of them have NO formatting or 
 indentation problem.
 Even Kindle has no indentation problem in all of my Python books.

True; I've got plenty of tech books, both ePub and mobi, that handle 
indentation just fine.

 
 
 Marcello
 
 
 
 On Saturday, March 17, 2012 3:04:58 PM UTC-3, AngeloC wrote:
 Kindle and other ebook readers that doesn't support pdf are useless for 
 viewing technical documents because text is reflowable, always. So blanks are 
 removed and text is full aligned.
 
 Please don't screw with packtpub, amazon or others, is a common problem with 
 all reflowable mobile formats.
 
 I have an ebook reader that supports all mobile formats (BeBook One) and pdf 
 (non digital editions) is the only readable format for tech documents. I read 
 always on my bebook one!
 
 Publishers never says that, because they will not sell technical ebooks 
 anymore!




Re: [web2py] Re: Authenticating with Facebook using OAuth 2.0

2012-03-17 Thread Michele Comitini
Hassan,

Ok.  As Alan points out check for the port in the URL.
Try to see if facebook authentication server is redirecting to your
application correctly.  You can check using firebug or chrome
developer tools.
Sometimes changing options in the facebook application control panel
is not enough, if that is the case you have to delete and recreate the
facebook application.

mic

Il 17 marzo 2012 11:35, Hassan Alnatour halna...@gardeniatelco.com ha scritto:
 Michele,

 I have No Code in the Controller or in the View , i followed the book
 instructions ..


 Alan ,

 The domain that i used for my website is a sub domain and when i
 created an application in facebook i gave it the same domain .. and
 its just the code that i showed you above i followed the instructions
 in the book


[web2py] Re: Odd auth problem

2012-03-17 Thread howesc
i suspect it's an order of operations issue.  i'm no expert, but i bet the 
parser parses the function definition when the file is loaded and tries to 
make use of an auth parameter that is not yet initialized.  (the decorator 
is not run until the code is executedwhich is sometime after parsing)

perhaps the reason you see this after a few days is because the user got 
logged out due to timeout/session expiration.

given that controller methods can't take parameters.can't you decorate 
the controller and then not call this method unless you are logged in?  and 
in the method itself make the default for user_id=None and set user_id to 
auth.user.id if user_id is None?

cfh

On Saturday, March 17, 2012 9:54:54 AM UTC-7, backseat wrote:

 I have a function whose definition starts as follows:

 @auth.requires_login()
 def rbb_time(category_id, from_date, to_date, user_id=auth.user.id):

 It works fine. I'll leave the development of this application for a few
 days, come back, run it, and get:

 Traceback (most recent call last):
   File /home/kae/hg/kae/web2py.1.99.4.pytrack2/gluon/restricted.py, line
   204, in restricted exec ccode in environment
 File [...]/controllers/default.py, line 100, in module 
   def rbb_time(category_id, from_date, to_date, user_id=auth.user.id): 
 AttributeError: 'NoneType' object has no attribute 'id'

 The only way to fix it (and this isn't 100% reliable) is to comment out
 all of the @auth.requires_login() lines, hard-code the above function
 definition to end user_id=11 (the UID I was logged in as), and then
 call /default/user/logout.

 Can anyone offer any suggestions as to what is going on here?

 Thanks,
 Keith



[web2py] Re: Working locally on a snapshot of a GAE database

2012-03-17 Thread howesc
looks like a cleaner solution than mine!

On Saturday, March 17, 2012 7:39:02 AM UTC-7, fabien wrote:

 Answering myself, I found the answer there: 
 https://groups.google.com/forum/?fromgroups#!topic/google-appengine/PyEdQs9UTBo

 Supposing that the primary keys are in field id, the __key__ 
 import/export snippets in bulkloader.yaml should read:

 - property: __key__
   external_name: id
   export_transform: transform.key_id_or_name_as_string
   import_transform: transform.create_foreign_key('id', key_is_id=True)



[web2py] I like this one...

2012-03-17 Thread Anthony
https://twitter.com/#!/zenfyre/statuses/181042479515176960


[web2py] Re: No DB queries in web2py shell?

2012-03-17 Thread Stefan Scholl
Stefan Scholl ste...@no-spoon.de wrote:
 Overall conclusion: Queries in the web2py web shell work on Mac,
 with some minor glitch. But different symptoms than the ones on
 Windows. Have to check again on Windows.

I can't test it this weekend. Windows is for work days. But ...


... ACTUALLY: I think when I tried a query in the shell because
of a problem with my app at work, I gave up early.  A few days
later I tried to give a clean test case with a fresh install and
the example app.

Then this happened: The database administration only knows of the
db.py in the subdirectory. But the shell only of the main db.py.
And now we have two things that aren't related: not knowing the
table and not giving any output.

*sigh*




[web2py] Re: No DB queries in web2py shell?

2012-03-17 Thread Anthony
I highly recommend just doing this:

python web2py.py -S myapp -M -N

in a regular shell, and skip the web-based shell. You can even do 
myapp/mycontroller to have a specific controller executed in the context of 
the shell so you can access all of its functions.

Anthony

On Saturday, March 17, 2012 5:47:31 PM UTC-4, Stefan Scholl wrote:

 Stefan Scholl ste...@no-spoon.de wrote:
  Overall conclusion: Queries in the web2py web shell work on Mac,
  with some minor glitch. But different symptoms than the ones on
  Windows. Have to check again on Windows.

 I can't test it this weekend. Windows is for work days. But ...


 ... ACTUALLY: I think when I tried a query in the shell because
 of a problem with my app at work, I gave up early.  A few days
 later I tried to give a clean test case with a fresh install and
 the example app.

 Then this happened: The database administration only knows of the
 db.py in the subdirectory. But the shell only of the main db.py.
 And now we have two things that aren't related: not knowing the
 table and not giving any output.

 *sigh*




[web2py] Re: I like this one...

2012-03-17 Thread Alan Etkin
Agree

On 17 mar, 18:45, Anthony abasta...@gmail.com wrote:
 https://twitter.com/#!/zenfyre/statuses/181042479515176960


[web2py] Re: Odd auth problem

2012-03-17 Thread Anthony
When the user is not logged in, auth.user is None, so you get an error when 
trying to access auth.user.id. Instead, you can use auth.user_id, which 
will simply return None when the user isn't logged in rather than an error. 
See the callout at the end of this section in the 
book: http://web2py.com/books/default/chapter/29/9#Authentication.

Anthony

On Saturday, March 17, 2012 12:54:54 PM UTC-4, backseat wrote:

 I have a function whose definition starts as follows:

 @auth.requires_login()
 def rbb_time(category_id, from_date, to_date, user_id=auth.user.id):

 It works fine. I'll leave the development of this application for a few
 days, come back, run it, and get:

 Traceback (most recent call last):
   File /home/kae/hg/kae/web2py.1.99.4.pytrack2/gluon/restricted.py, line
   204, in restricted exec ccode in environment
 File [...]/controllers/default.py, line 100, in module 
   def rbb_time(category_id, from_date, to_date, user_id=auth.user.id): 
 AttributeError: 'NoneType' object has no attribute 'id'

 The only way to fix it (and this isn't 100% reliable) is to comment out
 all of the @auth.requires_login() lines, hard-code the above function
 definition to end user_id=11 (the UID I was logged in as), and then
 call /default/user/logout.

 Can anyone offer any suggestions as to what is going on here?

 Thanks,
 Keith



[web2py] Checkboxes for Many to Many Relations

2012-03-17 Thread asklucas

Hello!

I can't work out how to handle many to many relations in web2py!

Assuming the following model:

db.define_table( 'person',
 Field( 'name', type = 'string'), 
 )

 db.define_table( 'food',
 Field( 'name', type = 'string'), 
 )

 db.define_table( 'person_food',
 Field( 'id_person', type = 'reference person'),
 Field( 'id_food', type = 'reference food'),
 )


How can I create a view for adding a person which displays available foods 
with checkboxes and updates the person_food-table accordingly?

Since I'm connecting to legacy databases I can't use the tags-like 
approach for many to many relations.

Thank you very much!

L.




[web2py] Re: No DB queries in web2py shell?

2012-03-17 Thread Stefan Scholl
Anthony abasta...@gmail.com wrote:
 I highly recommend just doing this:
 
 python web2py.py -S myapp -M -N
 
 in a regular shell, and skip the web-based shell. You can even do 

There is no python executable in the Windows version of web2py.





[web2py] config file - configuration per environment

2012-03-17 Thread Alex
Hi,

what is the best way to have settings depending on the environment? I
know this question has been asked a couple of times before but I could
not find any useful answers.

I want to run multiple instances of my application for multiple
customers, which also means a different db connection for each
instance. I did not see an (elegant) solution in web2py for this
problem. I do not want to create a new package for each instance which
would be really annoying to do for each deployment. Currently I'm
passing the db settings as environment variables. For me this feels
more like a hack but at least it worked - so far. Now I want to run
cron jobs with external cron. This is a problem because I can't pass
the environment settings (which I would have to hard code a second
time anyway), so I can't access the db in the cron job tasks.

It would really be great if web2py had some config settings like in
most other frameworks.


[web2py] Re: No DB queries in web2py shell?

2012-03-17 Thread Anthony
On Saturday, March 17, 2012 8:06:38 PM UTC-4, Stefan Scholl wrote:

 Anthony abasta...@gmail.com wrote:
  I highly recommend just doing this:
  
  python web2py.py -S myapp -M -N
  
  in a regular shell, and skip the web-based shell. You can even do 

 There is no python executable in the Windows version of web2py.


In that case:

web2py.exe -S myapp -M -N

Though if you're going to do any serious work with web2py, you're probably 
best off installing your own version of Python (preferably 2.7) and running 
web2py from source. Once you've got Python installed, it's just as easy to 
run web2py from source as it is to use the binary version (download, unzip, 
click).

Anthony 


Re: [web2py] config file - configuration per environment

2012-03-17 Thread Bruno Rocha
Mult tenance, in web2py you have request.tenant

I use SQLite for configs

http://zerp.ly/rochacbruno
Em 17/03/2012 21:26, Alex mrauc...@gmail.com escreveu:

 Hi,

 what is the best way to have settings depending on the environment? I
 know this question has been asked a couple of times before but I could
 not find any useful answers.

 I want to run multiple instances of my application for multiple
 customers, which also means a different db connection for each
 instance. I did not see an (elegant) solution in web2py for this
 problem. I do not want to create a new package for each instance which
 would be really annoying to do for each deployment. Currently I'm
 passing the db settings as environment variables. For me this feels
 more like a hack but at least it worked - so far. Now I want to run
 cron jobs with external cron. This is a problem because I can't pass
 the environment settings (which I would have to hard code a second
 time anyway), so I can't access the db in the cron job tasks.

 It would really be great if web2py had some config settings like in
 most other frameworks.


[web2py] Re: [ANNOUNCE] uWSGI 1.1

2012-03-17 Thread Vasile Ermicioi
hi,
great news, thanks

is it possible now to use uwsgi with pypy? 
how stable is that?
any steps to do that if it is possible?

thank you



[web2py] Re: Installing pyMantis in web2py

2012-03-17 Thread guruyaya
Think you can clone it via mercurial here:
http://sourceforge.net/scm/?type=hggroup_id=304012

On 17 מרץ, 11:00, praveen krishna praveenchitne...@gmail.com wrote:
 Hii,
    Where can I get the URL or package of pyMantis app to instal in web2py.I
 have tried in  http://pymantis.org/but I am unable to find .


[web2py] Re: [ANNOUNCE] uWSGI 1.1

2012-03-17 Thread Roberto De Ioris

 hi,
 great news, thanks

 is it possible now to use uwsgi with pypy?
 how stable is that?
 any steps to do that if it is possible?

 thank you



It requires a couple of modifications in pypy (when compiled as a shared
library), i will send them a real patch soon or later. Currently it is
only a (slow) work in progress, as (at least for me) having full knowledge
of pypy implementation is not easy as the cpython one

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