[web2py:30695] yet another wiki with versioning and auth

2009-09-10 Thread mdipierro
http://web2py.com/examples/static/web2py.app.wiki2.w2p this one has 49 lines of models and controllers code (including 13 lines of scaffolding code) and 20 lines of views html code. I am going to use this one to rewrite T3. I think it can be done with very little work. Time for you to reque

[web2py:30694] Re: new in trunk

2009-09-10 Thread mdipierro
On Sep 11, 1:19 am, Richard wrote: > > on delete cascade in SQLite > > Fantastic! My feature request for this can be > closed:http://code.google.com/p/web2py/issues/detail?id=50 Can you do it or should I do it? > Did the solution involve sqlite triggers? No. The solution is quite dumb. recu

[web2py:30693] Re: new in trunk

2009-09-10 Thread Richard
> on delete cascade in SQLite Fantastic! My feature request for this can be closed: http://code.google.com/p/web2py/issues/detail?id=50 Did the solution involve sqlite triggers? > row = db(db.mytable.id>0).select().first() very convenient Richard On Sep 11, 3:12 pm, mdipierro wrote: > I have

[web2py:30692] Re: cron error for no cron

2009-09-10 Thread Richard
hi, In my above example I used "--no-cron" but still got a cron error. Is there another option? Richard On Sep 11, 2:56 pm, Yarko Tymciurak wrote: > see output of: > > python web2py.py -h > > for the option to disable cron > > On Thu, Sep 10, 2009 at 7:14 PM, Richard wrote: > > > hi, > > > I

[web2py:30691] Re: autocomplete

2009-09-10 Thread suiato
Hi Iceberg 2009/9/11 Iceberg : ... > Actually, Limodou, the author of uliweb and ulipad is one of the early > contributors of web2py, and is still recognized in web2py's > contributor list. For some design philosophy reason he decided to > start his own uliweb project which is not as popular as w

[web2py:30690] Re: how to let end user (not developer) define table on fly

2009-09-10 Thread mdipierro
The db.define_table(...) does two things: 1) the first time it is executed it creates the table 2) the other times it is executed it informs web2py that you expect to have that table (if not it is recreated or migrated accordingly). This means it has to be executed at every request. Not just in o

[web2py:30689] how to let end user (not developer) define table on fly

2009-09-10 Thread wf321
I try let end user create their table on fly , for example, in default.py I have 2 function def somepage() if not db.has_key('sometable'): db.define_table('sometable', redurect(r-request, f='nextpage') def nextpage() if not db.has_key('sometable'): showerror()

[web2py:30688] Re: file descriptors leak

2009-09-10 Thread mdipierro
please check if it is fixed. I had to change your fix because it was not python 2.4 compliant. On Sep 10, 11:52 am, zahariash wrote: > Hello, > > I've found some weird behavior of web2py script. After few hours from > script start it throw error: > OSError: [Errno 24] Too many open files > > Ind

[web2py:30687] new in trunk

2009-09-10 Thread mdipierro
I have made some changes to the code in trunk: 1) Since tonight I attended a presentation about how SQLAlchemy can do on delete cascade in SQLite even if SQLite does not support it, I implemented this feature in web2py too. There is nothing you have to do it now there by default. For example: db

[web2py:30686] Re: autocomplete

2009-09-10 Thread Iceberg
On Sep11, 11:16am, suiato wrote: > i still think of this topic of autocompletion/snippets/collaboration > features when editing... > > found a good editor called Ulipad with nice features like > autocompletion, snippets, etc. python-based with wxPython.  easy to > install and use. > > found that

[web2py:30685] Re: SQLite for Production?

2009-09-10 Thread mdipierro
1) actually migrations work better in posgresql because all types of alter tables are supported (http://www.sqlite.org/faq.html#q11). For example if you change the type of a column with postgresql web2py will create a new column, try to convert the data, drop the old column, rename the old column

[web2py:30684] Re: web2py newbee: INPUT looping

2009-09-10 Thread mdipierro
Not sure if you are asking this: INPUT(_id='id_x',_name='id_x',_class='id_x',_type='string') you can also do: form=SQLFORM.factory(*[Field(name,label=label) for name,label in myElem]) it will create the 'id' and 'class' following web2py convention so that you do not have to make up your own.

[web2py:30683] Re: SQLite for Production?

2009-09-10 Thread Yarko Tymciurak
what makes you say that? I've had good luck w/ postgres migrations. Have you had problems? On Thu, Sep 10, 2009 at 7:36 PM, Richard wrote: > > One advantage of sqlite is that migrations work much better than > postgres, so it is great to use while developing your app. > > > On Sep 11, 4:14 am,

[web2py:30682] help with static files in webfaction

2009-09-10 Thread drayco
Good night, I ask for your support with this situation I have a subdomain on WebFaction. At this time, I can see and work with the admin, welcome and a mysql database in my application in WebFaction. However, when I request my subdomain, the initial application (init) loads blank pages. I think,

[web2py:30681] Re: cron error for no cron

2009-09-10 Thread Yarko Tymciurak
see output of: python web2py.py -h for the option to disable cron On Thu, Sep 10, 2009 at 7:14 PM, Richard wrote: > > hi, > > I have a backend job that I run periodically with: > > python -u web2py.py --import_models --no-cron --shell=test > --run=applications/test/modules/backend.py > > > As

[web2py:30680] Re: web2vy

2009-09-10 Thread Yarko Tymciurak
what would be the compelling reason to commit to that work regardless? On Thu, Sep 10, 2009 at 7:14 PM, Thadeus Burgess wrote: > Why would anyone bother porting a system that is still in heavy > development? > > > On Thu, Sep 10, 2009 at 4:48 PM, David Hofmann wrote: > >> Hi all here, have someb

[web2py:30679] Re: Separation of Concerns

2009-09-10 Thread mdipierro
Yes. The fact that you can do it, does not man you should do it. Sometime need to build HTML programmatically, for this reason web2py provides a OOP server side representation of the DOM so that you never have to manipulate strings in the controllers. You can use this to build forms but you do n

[web2py:30678] web2py newbee: INPUT looping

2009-09-10 Thread Denis
Hello, I am well versed in Python but a newbie in web2py. I have a list of elements and I'd like to generate INPUTs for it using a for loop if possible Specifically myElem = [ ['id_x', 'One'], ['id_y', 'Two'], ['anotherId', 'SomeValue']] should become One Two SomeValue I'

[web2py:30677] Separation of Concerns

2009-09-10 Thread Ryan Montgomery
I am new to web2py and I have some questions. The first one being: Does the ability to creating Forms with html tables in the controller violate the principal of "Separation of Concerns"? Shouldn't this "view logic" be handled in the view and not in the controller? Please reference example #28

[web2py:30676] Re: win32com and web2py

2009-09-10 Thread mdipierro
tell your friends. ;-) On Sep 10, 9:58 pm, tvw wrote: > Thank you so much :) > > Been trying for ages to figure that out on my own - works like a dream > now. > > Recent convert to python from perl. web2py automates a LOT of things I > used to do very manually. > > I think this is going to be a

[web2py:30675] Re: Fixing Autocomplete for Web2Py With Pydev IDE

2009-09-10 Thread Bottiger
For anyone curious, I found out that pasting this at the top of your web2py files seems to be the only way to fix pydev. Its a somewhat updated version of Guido Kollerie's method all in one. Its too bad there isn't a better fix. if 0: from gluon.sql import * from gluon.sql import DAL

[web2py:30674] Re: Enable line numbering in the admin interface editor???

2009-09-10 Thread suiato
On 9月11日, 午前10:00, cesmiga wrote: > All: > > Is there a way to enable line numbering in the admin interface editor? i see line numbers on the web2py editor when editing models/ controllers/views. what is 'admin interface editor'? > > Thank you, > Christopher --~--~-~--~~

[web2py:30673] Re: Ajax

2009-09-10 Thread Jason Brower
If you looking for that it is in the manual. And the examples. I think you can create a page like generic.xml like in a new application if you deleted one, just make it. Then you just ask for the page with .xml at the end. A new application has the framework for what I think your wanting to do. A

[web2py:30672] Re: autocomplete

2009-09-10 Thread suiato
i still think of this topic of autocompletion/snippets/collaboration features when editing... found a good editor called Ulipad with nice features like autocompletion, snippets, etc. python-based with wxPython. easy to install and use. found that its author wrote a web framework Uliweb(http://

[web2py:30671] Re: Fixing Autocomplete for Web2Py With Pydev IDE

2009-09-10 Thread Bottiger
Ah never mind. I forgot to enable the source analyzer, so you still have to import the data. On Sep 10, 7:55 pm, Bottiger wrote: > I starting to use PyDev now that the extensions are now free. I > remembered some of you had problems with the autocomplete because of > the Web2Py globals. Here is

[web2py:30670] Re: Enable line numbering in the admin interface editor???

2009-09-10 Thread Wes James
On Thu, Sep 10, 2009 at 7:00 PM, cesmiga wrote: > > All: > > Is there a way to enable line numbering in the admin interface editor? > You may want to consider using the free version of Wing IDE: http://www.wingware.com/downloads/wingide-101 -wes --~--~-~--~~~---~--

[web2py:30669] Re: win32com and web2py

2009-09-10 Thread tvw
Thank you so much :) Been trying for ages to figure that out on my own - works like a dream now. Recent convert to python from perl. web2py automates a LOT of things I used to do very manually. I think this is going to be a big hit. On Sep 10, 9:08 am, mdipierro wrote: > I would put the cod

[web2py:30668] Fixing Autocomplete for Web2Py With Pydev IDE

2009-09-10 Thread Bottiger
I starting to use PyDev now that the extensions are now free. I remembered some of you had problems with the autocomplete because of the Web2Py globals. Here is a solution. When you add a Python Interpreter, go into forced globals. Click new. Copy and paste the following: request,response,sessio

[web2py:30667] Re: Ajax

2009-09-10 Thread eddwinston
Hi Massimo, I tried the above method but the return value is still a full page markup. Don't know what I am doing wrong On Sep 10, 11:32 pm, mdipierro wrote: > make a view like "user.json" that contains > {{if user.is_logged_in():}}1{{else:}}0{{pass}} > > then call the use action with > > URL(r

[web2py:30666] Re: Any comments on Tornado Server?

2009-09-10 Thread Joe Barnhart
Looks kinda like Twisted to me, but without the generality of other protocols. But it supports epoll on Linux (and Mac?). It *can* support WSGI but you lose the cool asynchronous stuff so why do it? In short, it sounds like an excellent solution for someone else's problem! -- Joe B. On Thu,

[web2py:30665] Enable line numbering in the admin interface editor???

2009-09-10 Thread cesmiga
All: Is there a way to enable line numbering in the admin interface editor? Thank you, Christopher --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2py-users" group. To post to this group, send email to web2py@go

[web2py:30664] Any comments on Tornado Server?

2009-09-10 Thread Anand Vaidya
Facebook has released Tornado Server http://www.tornadoweb.org/ Any comments? Regards Anand Tornado is an open source version of the scalable, non-blocking web server and tools that power FriendFeed. The FriendFeed application is written using a web framework that looks a bit like web.py or Goo

[web2py:30663] Re: SQLite for Production?

2009-09-10 Thread Richard
One advantage of sqlite is that migrations work much better than postgres, so it is great to use while developing your app. On Sep 11, 4:14 am, Joe Barnhart wrote: > Good point.  Another factor is handling threads.  IIRC Sqlite won't handle > more than 1 thread while the others will. > > On Thu

[web2py:30661] Re: web2vy

2009-09-10 Thread Thadeus Burgess
Why would anyone bother porting a system that is still in heavy development? On Thu, Sep 10, 2009 at 4:48 PM, David Hofmann wrote: > Hi all here, have somebody though on porting web2py framework in groovy ?( > Is somebody doing it already ? ) > > I am asking this because groovy has the same poten

[web2py:30662] cron error for no cron

2009-09-10 Thread Richard
hi, I have a backend job that I run periodically with: > python -u web2py.py --import_models --no-cron --shell=test > --run=applications/test/modules/backend.py As you can see I am specifying no cron, but every so often I get this error: WARNING:root:alreadyrunning WARNING:root:WEB2PY CRON: St

[web2py:30660] Re: Using db field labels for column headers

2009-09-10 Thread villas
Wow, thanks! Don't forget to include in the book. BTW have you seen the Cakephp book? It's a great collaborative effort. It would be great if everyone could proposed edits, fix typos etc and take some of the strain off the core development team. Just a thought. Thanks again for the labels!

[web2py:30659] web2vy

2009-09-10 Thread David Hofmann
Hi all here, have somebody though on porting web2py framework in groovy ?( Is somebody doing it already ? ) I am asking this because groovy has the same potencial as python, just with a liiitle more complexity than straigth python. I have made ( http://code.google.com/p/swebj/ ) a similar web2py

[web2py:30658] Views with "\" instead of "/"

2009-09-10 Thread Chris S
I've been paying with some of the example apps and run across an oddity in the 'Views'. When I create a view, for example: default/index.html It shows up in the list as: default\index.html When I try to view or edit this file with the links on the Edit page I get an 404 Error: The requested URL

[web2py:30657] Re: headers for crud.select()

2009-09-10 Thread mdipierro
http://groups.google.com/group/web2py/browse_thread/thread/9016f07f57605698# On Sep 10, 4:00 pm, Oleg wrote: > Is something wrong with the idea, that labels, defined for the fields, > will be also default headers for the crud.select() table. Just found > myself continuously filling up and updat

[web2py:30656] headers for crud.select()

2009-09-10 Thread Oleg
Is something wrong with the idea, that labels, defined for the fields, will be also default headers for the crud.select() table. Just found myself continuously filling up and updating headers parameters every time when I add new field in DB ;) but it is the same with label, I defined for the fiel

[web2py:30655] Re: T3

2009-09-10 Thread mdipierro
Fran, I would take a different approach. Instead of making a t3 brank I would rewrite it. I would only keep (the function that executed pages), the function that creates menus recursively. Instead of things like t2.create expose crud.create and instead of t2.login expose auth.login, etc. The re

[web2py:30654] Re: T3

2009-09-10 Thread Fran
On Sep 10, 2:10 pm, mdipierro wrote: > T3 is harder to explain. There is a video on vimeo. It is a handy app, > it's only problem is that it still use T2 stuff. It should be > rewritten. It will not take long so perhaps it is one of the first > things I would do. I just started developing a very

[web2py:30653] Re: web2py containers

2009-09-10 Thread mdipierro
There are dedicated web hosts that provide web2py pre-installed. On Sep 10, 2:48 pm, Thadeus Burgess wrote: > This is a shame there is no one click support for web2py aside from google > engine. I think web2py will suffice to a prototyping framework, and then use > django for the real thing, con

[web2py:30652] Re: Database administration - db upload field

2009-09-10 Thread mdipierro
def upload(): import cStringIO data=request.body.read() f=cStringIO.StringIO(data) current_filename='bla.bla' # how to you know the file extension if you do not pass the name? new_filename=db.mytable.picture.store(f,current_filename) # do something with new_filename and dat

[web2py:30651] Re: Ajax

2009-09-10 Thread mdipierro
make a view like "user.json" that contains {{if user.is_logged_in():}}1{{else:}}0{{pass}} then call the use action with URL(r=request,c='default', f='user', args='login',extension='json') On Sep 10, 2:31 pm, eddwinston wrote: > Hi guys, > > The login now works, the session is saved but the va

[web2py:30650] Re: web2py containers

2009-09-10 Thread Thadeus Burgess
This is a shame there is no one click support for web2py aside from google engine. I think web2py will suffice to a prototyping framework, and then use django for the real thing, considering that many web hosts have one click django support. (not that adminstering an apache server is difficult, it

[web2py:30649] Re: Database administration - db upload field

2009-09-10 Thread ab
I don't know uploaded file name. There is only stream of bytes to save in blob field. On Sep 10, 9:27 pm, mdipierro wrote: > It depends on how you send the file. Can you send me an example? > > On Sep 10, 2:19 pm, ab wrote: > > > Thanks. Working fine. > > > I have one more question. > > > When

[web2py:30648] Re: Ajax

2009-09-10 Thread eddwinston
Hi guys, The login now works, the session is saved but the value returned from the server is still a full page html markup. How can I get either xml or json as a return value? Thanks Winston On Sep 10, 10:42 am, eddwinston wrote: > Thanks a lot guys. I will try it when I get hands on my app ag

[web2py:30647] Re: Database administration - db upload field

2009-09-10 Thread mdipierro
It depends on how you send the file. Can you send me an example? On Sep 10, 2:19 pm, ab wrote: > Thanks. Working fine. > > I have one more question. > > When I upload file by database administration, field file contains for > example following entry - > picture.file.975598ae58526cda. > 466972656

[web2py:30646] Re: Database administration - db upload field

2009-09-10 Thread ab
Thanks. Working fine. I have one more question. When I upload file by database administration, field file contains for example following entry - picture.file.975598ae58526cda. 46697265666f785f77616c6c70617065722a706a67.png I want to upload files by REST. Is there function which I can use to cal

[web2py:30645] Re: web2py containers

2009-09-10 Thread mdipierro
I assume those are virtual machines. Some users have posted virtual machines containing web2py. I think there is still room for improvement. Ideally I would like a ubuntu server virtual machine with 1) apache preconfigured to run web2py via mod_wsgi 2) postgresql preconfigured and perhaps a web2

[web2py:30644] Re: file descriptors leak

2009-09-10 Thread zahariash
> What OS do you use? Debian 5.0.3 > > Can you email me your full name, to log the patch? Zahariash is ok ;) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2py-users" group. To post to this group, send email

[web2py:30643] Re: get random record efficiently

2009-09-10 Thread Robin B
Also if you already have many existing rows w/o a random float field, you will need to add a random field to those rows. You could use the remote datastore API [ ru.ly/g6 ] to add a random field to each row in the table. It basically connects you to the production datastore from your local machi

[web2py:30642] Re: who made this? I really like it

2009-09-10 Thread Wes James
Massimo, use your mac. run terminal type in: whois icoexist.org might give a hint... :) -wes On Wed, Sep 9, 2009 at 4:23 PM, mdipierro wrote: > > http://www.icoexist.org/ > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to

[web2py:30641] web2py containers

2009-09-10 Thread Thadeus Burgess
mediatemple.net has "Django Containers", basically a VPS designed specifically to run Django, is there anything out there like this for web2py? I can imagine the having the dedicated django container is faster than what could be set up with web2py? Could the django container be used to host web2p

[web2py:30640] Re: SQLite for Production?

2009-09-10 Thread Joe Barnhart
Good point. Another factor is handling threads. IIRC Sqlite won't handle more than 1 thread while the others will. On Thu, Sep 10, 2009 at 8:01 AM, ctalley wrote: > > FYI, something to consider is that SQLite doesn't natively support > foreign key constraints. For example, ON DELETE CASCADE d

[web2py:30639] Re: Using db field labels for column headers

2009-09-10 Thread mdipierro
You can just do {{=SQLTABLE(rows, headers=dict([('mytable.'+f,db.mytable[f].label) for f in db.mytable.fields]))}} On Sep 10, 1:07 pm, villas wrote: > I see it may not be straightforward, but if I may still make a non- > urgent suggestion for future consideration: > > 1. Check whether it's a no

[web2py:30638] Re: Using db field labels for column headers

2009-09-10 Thread villas
I see it may not be straightforward, but if I may still make a non- urgent suggestion for future consideration: 1. Check whether it's a normal looking, unambiguous fieldname. 2. If true, and a label exists, then use the label. After all, if there are any problems with column headers, we could s

[web2py:30637] Re: Django "polls" tutorial in web2py

2009-09-10 Thread mikech
Yes, I agree - good video. On Sep 9, 7:05 pm, mdipierro wrote: > Conversion worked this time: > > http://vimeo.com/6507384 --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2py-users" group. To post to this group,

[web2py:30636] Re: Importing XML code

2009-09-10 Thread Jason Brower
Cool! Thanks! Regards, JAson Brower On Thu, 2009-09-10 at 08:09 -0700, mdipierro wrote: > Try > > def xml_uploader(): > import xml.etree.ElementTree > mytree=xml.etree.ElementTree.parse(request.body.read()) > # do something with mytree. look into python docs about it > > On Sep 10,

[web2py:30635] Re: file descriptors leak

2009-09-10 Thread mdipierro
Thank you. What OS do you use? Can you email me your full name, to log the patch? Massimo On Sep 10, 11:52 am, zahariash wrote: > Hello, > > I've found some weird behavior of web2py script. After few hours from > script start it throw error: > OSError: [Errno 24] Too many open files > > Indee

[web2py:30634] Re: Using db field labels for column headers

2009-09-10 Thread mdipierro
This comes up once in a while and the answer is no. The problem is that SQLTABLE may need to display the result of a join where the same field appears has two columns and some columns may be computed from expressions. They do not have a label and even if they do, using label would be confusing. T

[web2py:30633] Re: Database administration - db upload field

2009-09-10 Thread mdipierro
Please try Field('file_data','blob',default='')) On Sep 10, 10:57 am, ab wrote: > Hi > > I found issue in database administration module and blob field for > files storage > > When model is defined as below > > db.define_table('picture', Field('file','upload')) > > there is no problem

[web2py:30632] file descriptors leak

2009-09-10 Thread zahariash
Hello, I've found some weird behavior of web2py script. After few hours from script start it throw error: OSError: [Errno 24] Too many open files Indeed, there is many attached files: lsof -p 13149 python2.5 13149 www-data 24u REG 202,0 02702 /tmp/ tmpkvWcld (deleted) python2.5

[web2py:30631] Re: Django "polls" tutorial in web2py

2009-09-10 Thread mengu
massimo, this was an excellent screencast that made me understand how powerful web2py is and how easy and fast to develop with web2py. i have been examining many frameworks including ruby on rails, django and some php frameworks, if i watch some of these more, i will definitely go with web2py for

[web2py:30630] Using db field labels for column headers

2009-09-10 Thread villas
It seems strange that the db.field 'label' is not used as the column header by default in SQLTABLE. After all, if someone has gone to the trouble of specifying a 'label', surely they would wish to use it everywhere. I eventually found this excellent tip from Massimo. Controller: headers=dict(

[web2py:30629] Re: where is isoformat described?

2009-09-10 Thread Yarko Tymciurak
see date.isoformat() here: http://docs.python.org/library/datetime.html On Thu, Sep 10, 2009 at 11:36 AM, jayvandal wrote: > > Hi, > I have looked at the web2py 2nd edition and I see no description of > isoformat. > Jm > > > --~--~-~--~~~---~--~~ You received thi

[web2py:30628] where is isoformat described?

2009-09-10 Thread jayvandal
Hi, I have looked at the web2py 2nd edition and I see no description of isoformat. Jm --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2py-users" group. To post to this group, send email to web2py@googlegroups.com

[web2py:30627] Dzone posting Coding Django "polls" tutorial in web2py

2009-09-10 Thread mikech
http://www.dzone.com/links/coding_django_polls_tutorial_in_web2py.html --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2py-users" group. To post to this group, send email to web2py@googlegroups.com To unsubscribe

[web2py:30626] Database administration - db upload field

2009-09-10 Thread ab
Hi I found issue in database administration module and blob field for files storage When model is defined as below db.define_table('picture', Field('file','upload')) there is no problem with inserting new records using 'database administration' but when model is defined to store files

[web2py:30625] Re: Building queries from strings

2009-09-10 Thread Don
Ahh.. Thanks I will try it out. On Sep 10, 11:12 am, mdipierro wrote: > This is dangerous because vulnerable to SQL Injections. Anyway > > a query can be a valid SQL WHERE clause: > > x = "table.id == %i" % value > query = x > set = db(query) > row = set.select() > > in this case x is valid

[web2py:30624] Re: Building queries from strings

2009-09-10 Thread mdipierro
This is dangerous because vulnerable to SQL Injections. Anyway a query can be a valid SQL WHERE clause: x = "table.id == %i" % value query = x set = db(query) row = set.select() in this case x is valid SQL. Notice it is not 'db.table.id' but 'table.id' because db is a web2py animal not a SQ

[web2py:30623] Re: Importing XML code

2009-09-10 Thread mdipierro
Try def xml_uploader(): import xml.etree.ElementTree mytree=xml.etree.ElementTree.parse(request.body.read()) # do something with mytree. look into python docs about it On Sep 10, 9:22 am, encompass wrote: > I know how to work with xml code. I just wanted to make sure I do it > with

[web2py:30622] Re: SQLite for Production?

2009-09-10 Thread ctalley
FYI, something to consider is that SQLite doesn't natively support foreign key constraints. For example, ON DELETE CASCADE doesn't work. It is possible to write triggers to handle referential integrity, but a dbms like postgresql just does it. So, depending on your requirements, postgresql migh

[web2py:30621] Writing test codes

2009-09-10 Thread Maurice Ling
Hi everyone, I have a problem here seeking assistance. I am confused about how to start writing test codes in web2py. Say I want to test the following: def input_SS(): if session.username == None: redirect(URL(r=request, f='../account/log_in')) form = FORM( TABLE(

[web2py:30620] Re: error on rendering just a record!

2009-09-10 Thread Carlos Aboim
>From Clientes/index (a list of clients) I want to pick up a record and edit it. with the earlier configuration I get the record but I can't edit it. How I merge my confs with your suggestion? maybe would be better explain everything again but if you can understand.. thanks CA 2009/9/10 mdipier

[web2py:30619] Re: Building queries from strings

2009-09-10 Thread Don
Okay, that was a bad example and my fault. Let's try again x = 'db.table.id == value' query = x set = db(query) row = set.select() This will fail because the "query" variable is not a gluon.sql.Query object, it is just a string. How can I convert from a string to a query? On Sep 10, 10:32 am

[web2py:30618] Re: action based on received email

2009-09-10 Thread Julio
I think the OP wanted to "execute something" based on an email "trigger", i.e. when sending an email to a specific address with, say, the contents of a blog post, and have the system automatically add the post based on the contents of the email, something like that, this is somewhat away from web2

[web2py:30617] Re: Building queries from strings

2009-09-10 Thread Yarko Tymciurak
the "idiom" is db(WHERE_CLAUSE).select(FROM_CLAUSE) (a simplification, but you get the idea) so you want query_results = db(x).select() or (equivalently): query_results = db(x).select(db.table.ALL) On Thu, Sep 10, 2009 at 9:26 AM, Don wrote: > > Ex: > x = 'db.table.id == value' > query = db

[web2py:30616] Re: Building queries from strings

2009-09-10 Thread Jose
On 10 sep, 14:26, Don wrote: > Ex: > x = 'db.table.id == value' > query = db(x) > > * This fails.  Is it possible to convert a string into a query? Replace with: x = (db.table.id == value) query = db(x) Jose --~--~-~--~~~---~--~~ You received this message bec

[web2py:30615] Re: Uploading File for Statistical Operations

2009-09-10 Thread Anand Vaidya
Have a look at the Algorithms Animator, Cool! http://vimeo.com/1735226 Regards Anand On Sep 10, 4:11 pm, Timmie wrote: > > This does exactly what you want: > > >    http://vimeo.com/6401333 > > > the source code is in > > >    http://bazaar.launchpad.net/~mdipierro/qcdmc/development/files > >

[web2py:30614] Building queries from strings

2009-09-10 Thread Don
Ex: x = 'db.table.id == value' query = db(x) * This fails. Is it possible to convert a string into a query? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2py-users" group. To post to this group, send email

[web2py:30613] Importing XML code

2009-09-10 Thread encompass
I know how to work with xml code. I just wanted to make sure I do it with all the built in libraries that are possible. I have an existing tool that will be sending me an XML in a post request. What is the best way for me to take that data and use it in my Web2py Application? they are not Blogs

[web2py:30612] Re: ticket tracking

2009-09-10 Thread mdipierro
make app "error" with a controller default.py and an action def index(): from gluon.tools import Mail mail=Mail() mail.settings.server="smpt.example.com:port" mail.settings.sender="y...@example.com" mail.settings.login="you:password" ticket=request.vars.ticket subject=

[web2py:30611] Re: json errors

2009-09-10 Thread mdipierro
DAL Rows objects are not json serializable. It must be converted to a list of dict first as below: @service.json @service.jsonrpc def list_users(): return dict(users=db(db.auth_user.id>0).select().as_list()) On Sep 10, 8:28 am, Manoj wrote: > Hello, > I have following code in my controller

[web2py:30610] Re: error on rendering just a record!

2009-09-10 Thread mdipierro
That is all. When you visit the page there will be a create form in the page. Perhaps I misunderstand what you want to do. On Sep 10, 8:14 am, Carlos Aboim wrote: > I'm sorry I didn't get the point. > > What should I do with {{=crud.update(db.cliente, cliente)}} > I put it in the view and... > >

[web2py:30609] ticket tracking

2009-09-10 Thread David Zejda
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hello, for a productive site I wish to touch the default error handler, maybe using some kind of decorator. IMO it would be good to 1. retain the ticket generation 2. notify admin by e-mail 3. redirect client to a custom error page I would like to

[web2py:30608] Re: return and redirect

2009-09-10 Thread __Kyo__
Becouse the form created, is configured to download a pdf (return), but when I resume using the form, it needs to be updated (redirect). thanks On Sep 10, 12:50 am, Richard wrote: > why do you need to update the form? > > On Sep 10, 6:58 am, __Kyo__ wrote: > > > > > def reporte(): > >     form=

[web2py:30607] Re: Default application with virtualhost

2009-09-10 Thread Jose
On 10 sep, 07:17, Fran wrote: > To redirect to your application, I use mod_rewrite: > > RewriteEngine On > RewriteRule ^/$ /myapplication/ [R] > > F Thanks Fran. Works well Regards Jose --~--~-~--~~~---~--~~ You received this message because you are subscribe

[web2py:30606] json errors

2009-09-10 Thread Manoj
Hello, I have following code in my controller @service.json @service.jsonrpc def list_users(): return dict(users=db(db.auth_user.id>0).select()) when i go to http://127.0.0.1:8000/userapp/default/list_users.json it gives me "no json" http://127.0.0.1:8000/userapp/default/list_users.xml wor

[web2py:30605] Re: error on rendering just a record!

2009-09-10 Thread Carlos Aboim
I'm sorry I didn't get the point. What should I do with {{=crud.update(db.cliente, cliente)}} I put it in the view and... thank you CA 2009/9/9 mdipierro > > {{=crud.update(db.cliente,cliente)}} > > On Sep 9, 9:50 am, Carlos Aboim wrote: > > Hey Massimo, > > thanks for your reply, > > I've ch

[web2py:30604] Re: T3

2009-09-10 Thread mdipierro
Yes. Old ones. Proof of concepts for things to come. T2 was an example of a possible plugin structure but everything in T2 is now in web2py. T3 is harder to explain. There is a video on vimeo. It is a handy app, it's only problem is that it still use T2 stuff. It should be rewritten. It will not

[web2py:30603] Re: win32com and web2py

2009-09-10 Thread mdipierro
I would put the code below in a module in web2py/ and from the module import serv in your apps. On Sep 10, 7:16 am, tvw wrote: > Hi, >     I've been trying to use win32com with web2py to get data from an > external process. I have been using the following in a controller for > my app (default.py

[web2py:30602] Re: Uploading File for Statistical Operations

2009-09-10 Thread mdipierro
credits: That is paid for by the Department of Energy. I need to add the acknowledgment to the info page. Massimo On Sep 10, 3:11 am, Timmie wrote: > > This does exactly what you want: > > >    http://vimeo.com/6401333 > > > the source code is in > > >    http://bazaar.launchpad.net/~mdipierr

[web2py:30601] win32com and web2py

2009-09-10 Thread tvw
Hi, I've been trying to use win32com with web2py to get data from an external process. I have been using the following in a controller for my app (default.py) import win32com.client serv = win32com.client.Dispatch("MyService") Once I installed web2py source this worked fine, however sometim

[web2py:30600] T3

2009-09-10 Thread eddwinston
Hi, What exactly is T2 or T3? Are they applications built with web2py or are not. I don't actually get it --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2py-users" group. To post to this group, send email to web

[web2py:30599] Re: Pycon

2009-09-10 Thread desfrenes
Also Tips on using the DAL with a domain model would be nice... On 10 sep, 08:17, Richard wrote: > I would also be interested in understanding more about the DAL, > particularly the new one in development. > > On Sep 10, 2:02 am, "mr.freeze" wrote: > > > I would like to see a 'deep dive' into t

[web2py:30598] Re: T3 rocks!

2009-09-10 Thread Timmie
> This would be an excellent addition to the appliances web2py already > has. I was recently trying out GAE and set up a test site using T3. > The installation was dead simple and T3 worked really well. With > minimal effort I was able to set up -http://fightalzheimers.appspot.com Yes, T3 is good.

[web2py:30597] Re: Uploading File for Statistical Operations

2009-09-10 Thread Timmie
> This does exactly what you want: > >    http://vimeo.com/6401333 > > the source code is in > >    http://bazaar.launchpad.net/~mdipierro/qcdmc/development/files Wow, thanks for posting this here and letting us know. It's great and shows a good enterprise directed application. Use such good exam

[web2py:30596] Re: Ajax

2009-09-10 Thread eddwinston
Thanks a lot guys. I will try it when I get hands on my app again. Regards, Winston On Sep 10, 9:28 am, "mr.freeze" wrote: > Try this. u is the url, i is the form index (set to 0 for a single > form on the page), and t is the target for the response. > > function ajaxSubmit(u,i,t){ >     frm =

  1   2   >