[web2py:20707] modules directory in sys.path

2009-04-28 Thread desfrenes
Hello ! Because I needed mutagen in a project, I added this to the __init__.py of my application: import sys, os # add modules dir to sys.path sys.path.append( os.path.abspath(request.folder + 'modules/')) It works like a charm but why isn't modules already in sys.path since its purpose is to

[web2py:20708] Re: modules directory in sys.path

2009-04-28 Thread Iceberg
I just guess, perhaps that would pollute the sys.path. Imagine this case, app_one and app_two both have a homebred module named modules/ mylib.py, you can not know which one is actually called when using just import mylib. Searching from this maillist, I found some post relevant to this topic

[web2py:20709] Re: debuggers for ajax in web2py

2009-04-28 Thread Nithin Kumar M
10x for your kind replies...By using firebug debugger, I was able to solve the problem. When I used {{=URL(r=request,f='getcities')}}, the URL function was not working in the controller. And hence I had to give the absolute path to solve the problem. regards, Nithin Kumar M. On Sat, Apr 25,

[web2py:20710] Re: forms in web2py

2009-04-28 Thread Nithin Kumar M
Hi, Thanks for your replies. I actually messed with some paths in my code. So it was accessing some old code and hence the new code wasnt working. Anyhow, thank you very much for your reply mdipierro. I'm able to solve my problem. :) regards, Nithin Kumar M. On Tue, Apr 28, 2009 at

[web2py:20712] Re: gzip apps by default

2009-04-28 Thread AchipA
Yes, this conclusion is mostly in line with mine, but it's very synthetic - in real life you'll see a larger boost (as you're not downloading a single file). Also, the encoding is I think most easily done through the mimetypes module - it will recognize the extension and the compression so you

[web2py:20713] Re: yet another feature in trunk

2009-04-28 Thread Jason Brower
Good god.. I love you! I just requested this! Where you listening to me!? I am touch. ;_; Regards, Jason On Mon, 2009-04-27 at 22:23 -0700, mdipierro wrote: SQLField('fieldname','upload',length='256',rememberfilename=True) Do I need to say more? Just try with appadmin (requires

[web2py:20714] Django - web2py

2009-04-28 Thread Jose
Since I adapt the following code from Django to Web2py: from reportlab.pdfgen import canvas from django.http import HttpResponse def some_view(request): # Create the HttpResponse object with the appropriate PDF headers. response = HttpResponse(mimetype='application/pdf')

[web2py:20711] Re: modules directory in sys.path

2009-04-28 Thread desfrenes
I see... but I don't think the helper would be that useful because imported modules may themselves import other modules, with the usual import keyword, not the helper. Perhaps applications could have the privilege to install libraries in contrib when they install ? Some post-install script could

[web2py:20715] static files

2009-04-28 Thread carlo
I need to create some links to pdf files saved in a static/pdf folder. I found an example in the book for images using : URL(r=request,c='static',f='myimage.png') is that ok adding the folder name to the f parameter like: URL(r=request,c='static',f='pdf/mypdffile.pdf') ? carlo

[web2py:20716] Re: modules directory in sys.path

2009-04-28 Thread Iceberg
I don't have much to say about the helper. But when talking about the __init__.py proposal, I still think it is dangerous. The pollution is not just about elegance or so, it could be about totally unusable. Should namespace collision happen, the first app being visited overwhelms the latter, the

[web2py:20717] Re: static files

2009-04-28 Thread Iceberg
Not sure, but why not just try and come back to tell us the conclusion? :-) On Apr28, 9:12pm, carlo syseng...@gmail.com wrote: I need to create some links to pdf files saved in a static/pdf folder. I found an example in the book for images using : URL(r=request,c='static',f='myimage.png')

[web2py:20718] Re: new T in trunk

2009-04-28 Thread mdipierro
It does already if you define SQLField(...label=T('fieldname')) On Apr 28, 12:50 am, Francisco Gama francisco@gmail.com wrote: what about db fields? It's funny I was working atm the moment to make SQLForm() and SQLTable () generate internationazable fields. Example: SQLFORM(db.table,

[web2py:20719] Re: yet another feature in trunk

2009-04-28 Thread mdipierro
This is tentative. There may be a better way. On Apr 28, 7:48 am, Jason Brower encomp...@gmail.com wrote: Good god.. I love you!  I just requested this!  Where you listening to me!?  I am touch. ;_; Regards, Jason On Mon, 2009-04-27 at 22:23 -0700, mdipierro wrote:

[web2py:20721] Re: static files

2009-04-28 Thread mdipierro
yes On Apr 28, 8:12 am, carlo syseng...@gmail.com wrote: I need to create some links to pdf files saved in a static/pdf folder. I found an example in the book for images using : URL(r=request,c='static',f='myimage.png') is that ok adding the  folder name to the f parameter like:

[web2py:20722] Re: Django - web2py

2009-04-28 Thread Jose
On 28 abr, 12:52, Jose jjac...@gmail.com wrote: Since I adapt the following code from Django to Web2py: from reportlab.pdfgen import canvas from django.http import HttpResponse def some_view(request):     # Create the HttpResponse object with the appropriate PDF headers.     response =

[web2py:20723] Re: modules directory in sys.path

2009-04-28 Thread desfrenes
di you mean that all __init__.py files are executed, no matter what application is being used ? On Apr 28, 3:14 pm, Iceberg iceb...@21cn.com wrote: I don't have much to say about the helper. But when talking about the __init__.py proposal, I still think it is dangerous. The pollution is not

[web2py:20724] Re: yet another feature in trunk

2009-04-28 Thread bsnipes
WooHoo! Now I can ditch my workaround... Brian On Apr 28, 12:23 am, mdipierro mdipie...@cs.depaul.edu wrote: SQLField('fieldname','upload',length='256',rememberfilename=True) Do I need to say more? Just try with appadmin (requires appadmin from trunk)

[web2py:20725] Re: static files

2009-04-28 Thread carlo
As Iceberg suggested I tried and it is working indeed! carlo On 28 Apr, 15:17, Iceberg iceb...@21cn.com wrote: Not sure, but why not just try and come back to tell us the conclusion? :-) On Apr28, 9:12pm, carlo syseng...@gmail.com wrote: I need to create some links to pdf files saved in

[web2py:20726] Re: do you consult? do you have a company?

2009-04-28 Thread weheh
Definitely, a CMS with profiles and contact info is the way to go. I consult on various projects (2 going on right now based on web2py) and have 2 of my own websites, which I plan on converting to web2py as soon as I have the time. But I don't have a formal website advertising myself, so a

[web2py:20727] Css framework

2009-04-28 Thread Angelo Compagnucci
Hi Massimo and Hi list, I've a question about css frameworks. Is there planned support for framework like YAML or Blueprint? Or is there a way to simple integrate a css framework into web2py? Thank you! --~--~-~--~~~---~--~~ You received this message because you

[web2py:20728] Re: Css framework

2009-04-28 Thread desfrenes
So far I'm using blueprint for my layouts. It's as easy as dropping blueprint files in application/static and then call the css: link href={{=URL(r=request,c='static',f='grid.css')}} media=screen rel=stylesheet type=text/css On Apr 28, 4:17 pm, Angelo Compagnucci angelo.compagnu...@gmail.com

[web2py:20729] possible T bug

2009-04-28 Thread desfrenes
Hi, I'm running trunk version and I get this trace when adding accentued (é) caracters in a translation string: Traceback (most recent call last): File C:\Documents and Settings\m_desfresnes\Mes documents\web2py-svn \gluon\restricted.py, line 102, in restricted exec ccode in environment

[web2py:20730] odd error: bug or limitation or ?

2009-04-28 Thread Hans
I'm experiencing a strange behavior within the code below. I tried to split the problem in the smallest pieces which I'm able to debug. My interpretation of the findings is that most likely I run into a web2py internal variable length issue/limitation. Let me tell you why I think that: The

[web2py:20732] Re: possible T bug

2009-04-28 Thread mdipierro
How are you editing the translation strings? Ra eyou doing it via the interface? If not mind that translations must be UTF8. On Apr 28, 9:32 am, desfrenes desfre...@gmail.com wrote: Hi, I'm running trunk version and I get this trace when adding accentued (é) caracters in a translation

[web2py:20743] Re: possible T bug

2009-04-28 Thread desfrenes
Using this alternative works: response.flash = str(T('Song uploaded: %s - %s [%s]')) % (str(audio [artist][0]),str(audio[title][0]),str(audio[album][0])) but T([...], dict([...])) doesn't. On Apr 28, 5:28 pm, desfrenes desfre...@gmail.com wrote: Googling for 'ascii' codec can't decode byte

[web2py:20744] Re: Django - web2py

2009-04-28 Thread Timmie
I would suggest: 1) add RST parsing functionality to web2py just like markdown is already in. http://bazaar.launchpad.net/~mdipierro/web2py-wiki/trunk/annotate/head%3A/models/rest.py 2) use rst2pdf for creation of your PDF files http://code.google.com/p/rst2pdf/ It will to all kind of things

[web2py:20745] Re: CSS Template Layouts

2009-04-28 Thread Timmie
Is there an example for creating submenus in web2py? I could only create a main menu with the response.menu function. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups web2py Web Framework group. To post to this

[web2py:20746] Re: CSS Template Layouts

2009-04-28 Thread mdipierro
The T3 app has code in it that does it. On Apr 28, 11:29 am, Timmie timmichel...@gmx-topmail.de wrote: Is there an example for creating submenus in web2py? I could only create a main menu with the response.menu function. --~--~-~--~~~---~--~~ You received this

[web2py:20747] jsonpickle module

2009-04-28 Thread hcvst
Hi, I would like to use the jsonpickle module - http://code.google.com/p/jsonpickle/ - with web2py. I thought to just place it in the modules dir of my app and to import it into a controller via import applications.myapp.modules.jsonpickle , however it complains with 'ImportError: No module

[web2py:20748] Memcache / Bug report and patch

2009-04-28 Thread NicolasB
Hi all, I think I found an issue into gluon\contrib\memcache\__init__.py The 'key' parameter is missing for 'set' function And I had to add import time to make it work Hope this help here as I don't know where to post a patch. Regards, Nicolas Here is the modified code: ---

[web2py:20750] Re: Memcache / Bug report and patch

2009-04-28 Thread mdipierro
Thank you. I will post it to trunk asap. On Apr 28, 11:46 am, NicolasB nicolas.bn...@gmail.com wrote: Hi all, I think I found an issue into gluon\contrib\memcache\__init__.py The 'key' parameter is missing for 'set' function And I had to add import time to make it work Hope this help

[web2py:20749] Re: jsonpickle module

2009-04-28 Thread mdipierro
Yes it is a patch issue. three solutions 1) if you want jsonpicker in your app you need to edit the import statements, including import simplejson 2) if you run from source, simply install jsonpickler in site-packages and use it normally 3) you can install it under gluon/contrib and it will be

[web2py:20751] Re: yet another feature in trunk

2009-04-28 Thread Álvaro Justen [Turicas]
On Tue, Apr 28, 2009 at 12:00 PM, mdipierro mdipie...@cs.depaul.edu wrote: There is one issue with my solution. If you upload a file filename.abc, it is internally renamed as lots-of- junk--filename.abc and you can download it with http:///download/lots-of-junk--filename.abc It works

[web2py:20752] Re: debuggers for ajax in web2py

2009-04-28 Thread Yarko Tymciurak
say more about this URL function was not working in the controller What was going on? On Tue, Apr 28, 2009 at 4:10 AM, Nithin Kumar M mara.ku...@gmail.comwrote: 10x for your kind replies...By using firebug debugger, I was able to solve the problem. When I used

[web2py:20753] Re: jsonpickle module

2009-04-28 Thread hcvst
Thanks so much for your response. I'll give option 3 a try. Regards, HC On Apr 28, 7:38 pm, mdipierro mdipie...@cs.depaul.edu wrote: Yes it is a patch issue. three solutions 1) if you want jsonpicker in your app you need to edit the import statements, including import simplejson 2) if you

[web2py:20754] Re: yet another feature in trunk

2009-04-28 Thread mdipierro
it would give more flexibility but would not solve the original problem. On Apr 28, 12:41 pm, Álvaro Justen [Turicas] alvarojus...@gmail.com wrote: On Tue, Apr 28, 2009 at 12:00 PM, mdipierro mdipie...@cs.depaul.edu wrote: There is one issue with my solution. If you upload a file

[web2py:20755] Re: yet another feature in trunk

2009-04-28 Thread Álvaro Justen [Turicas]
On Tue, Apr 28, 2009 at 2:55 PM, mdipierro mdipie...@cs.depaul.edu wrote: it would give more flexibility but would not solve the original problem. So I didn't understand the original problem. :-) Anyway...we can add that feature? On Apr 28, 12:41 pm, Álvaro Justen [Turicas]

[web2py:20756] web2py appliance

2009-04-28 Thread Boris Manojlovic
Hello, I have created appliance that can be used for testing of web2py. Currently available images are based on Version 1.61.4 (2009-04-21 10:02:50) of web2py It will start web2py automatically on boot of virtual machine. You can download images for writing on USB stick from URL bellow.

[web2py:20757] Re: yet another feature in trunk

2009-04-28 Thread Yarko Tymciurak
have you considered filename.abc -- uuid.abc ?if you _always_ store the original filename this should be ok. Another alternative is to hexify the filename, then the character encoding would be irrelevant, and this is simpler than uuid (and decodable), e.g. ABC.abc == 414243.616263 ...there

[web2py:20759] internationalization of the admin, and RTL

2009-04-28 Thread guruyaya
I have several issues concerning internationalization, that I'd like to present. 1. There are several strings on the administrator panel, that don't use the T function, and therefor cannot be translated. Is that on purpose? If not, I am willing to take the time, locate those strings, and make

[web2py:20760] Re: yet another feature in trunk

2009-04-28 Thread mdipierro
On Apr 28, 1:40 pm, Yarko Tymciurak yark...@gmail.com wrote: have you considered filename.abc -- uuid.abc ?if you _always_ store the original filename this should be ok. uuids is how web2y always worked and still does by default. Another alternative is to hexify the filename, then the

[web2py:20761] Re: internationalization of the admin, and RTL

2009-04-28 Thread mdipierro
On Apr 28, 1:43 pm, guruyaya guruy...@gmail.com wrote: I have several issues concerning internationalization, that I'd like to present. 1. There are several strings on the administrator panel, that don't use the T function, and therefor cannot be translated. Is that on purpose? If not, I am

[web2py:20762] Re: yet another feature in trunk

2009-04-28 Thread Yarko Tymciurak
This solves the problem of storing it but not the problem of downloading a file with a fancy name. We would lose the ability to search the uploaded files by filename. Not if you ALWAYS store by uploaded filename, and have the stored name as a field for retrieval only... Maybe I don't see

[web2py:20763] Re: yet another feature in trunk

2009-04-28 Thread mdipierro
Let's say I upload a file called 漢.dat from a windows machine, how do I download it from a Unix machine? I just do not know different browsers and OSs will handle it and it may cause vulnerabilities. Anyway, I like the idea of hexing and it probably better than the current solution. I will try it

[web2py:20766] Re: web2py appliance

2009-04-28 Thread dlypka
Wow. Virtual machine running what OS? linux? On Apr 28, 2:34 pm, Boris Manojlovic boris.manojlo...@gmail.com wrote: Hello, I have created appliance that can be used for testing of web2py. Currently available images are based on  Version 1.61.4 (2009-04-21 10:02:50) of web2py It will start

[web2py:20768] Re: Memcache / Bug report and patch

2009-04-28 Thread mdipierro
fixed in trunk. Can you please email me your last name so I can add your name to the list of contributors. Massimo On Apr 28, 11:46 am, NicolasB nicolas.bn...@gmail.com wrote: Hi all, I think I found an issue into gluon\contrib\memcache\__init__.py The 'key' parameter is missing for 'set'

[web2py:20771] Re: web2py appliance

2009-04-28 Thread mdipierro
This is fantastic and I have been looking for this in long time. I have some questions: - what's the default username and password? I cannot login ;-( - could you redo it with ubuntu instead of suse? - does it use mod_wsgi? if not can that be added? - could we have a web2py themed background? -

[web2py:20772] Re: web2py project group created on Launchpad

2009-04-28 Thread mdipierro
Considering that we are moving to google mercurial soon. Can this be done there too? Massimo On Apr 28, 4:42 pm, Tim Michelsen timmichel...@gmx-topmail.de wrote: Hello, please see here:https://edge.launchpad.net/web2py-project You may now register your projects (applicances) hosted at LP

[web2py:20775] Re: yet another feature in trunk

2009-04-28 Thread Yarko Tymciurak
good link - thanks! 2009/4/28 mdipierro mdipie...@cs.depaul.edu I found this which answers some of my questions http://stackoverflow.com/questions/93551/how-to-encode-the-filename-parameter-of-content-disposition-header-in-http On 28 Apr, 14:30, Yarko Tymciurak yark...@gmail.com wrote:

[web2py:20776] Re: help on GAE

2009-04-28 Thread Robin B
To add the email/password, try these switches with appcfg.py: --email=... --passin http://code.google.com/appengine/docs/python/tools/uploadinganapp.html#Command_Line_Arguments Robin On Apr 28, 5:03 pm, mdipierro mdipie...@cs.depaul.edu wrote: would somebody be able to send a piece of Python

[web2py:20777] Re: web2py appliance

2009-04-28 Thread Boris Manojlovic
aaah my stupidity to not give all details... user root pass web2py user web2py pass web2py (or linux :) ) this is done with help of susestudio.com and as such behind is always opensuse 11.1 (except if i'm bored enough and use KIWI imaging system by myself and create new image from scratch)

[web2py:20778] Re: help on GAE

2009-04-28 Thread mdipierro
Hi Robin, I am trying to do this programmatically and I cannot use os.system because a shell my may not be available. Massimo On 28 Apr, 18:54, Robin B robi...@gmail.com wrote: To add the email/password, try these switches with appcfg.py: --email=... --passin

[web2py:20779] Re: Need help with query on datetime field

2009-04-28 Thread weheh
Yarko, thanks for your useful reply. Yes, you are correct, this is essentially a python question, not a web2py question. What's so wonderful about web2py is how seamlessly and transparently integrated it can *appear* to be with python and the web. However, the correct syntax can be nuanced, like

[web2py:20780] Re: help on GAE

2009-04-28 Thread mdipierro
I think I figured it out. On mac the code is import sys path='/Applications/GoogleAppEngineLauncher.app/Contents/Resources/ GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/ google/appengine/tools/appcfg.py' sys.path.append(path)

[web2py:20781] Re: yet another feature in trunk

2009-04-28 Thread mdipierro
fixed in trunk. I tried with chinese filename and works great! Massimo On 28 Apr, 18:36, Yarko Tymciurak yark...@gmail.com wrote: good link - thanks! 2009/4/28 mdipierro mdipie...@cs.depaul.edu I found this which answers some of my questions

[web2py:20782] Re: yet another feature in trunk

2009-04-28 Thread Iceberg
Maybe we can store the uploaded file on disk as: lots-of-junk__encoded-filename.abc where: lots-of-junk is a unique hash string as web2py currently does. encoded-filename.abc can be the original filename encoded by base64 to make it appears as ascii-char only on disk. Then when

[web2py:20783] Re: yet another feature in trunk

2009-04-28 Thread mdipierro
I have changed this again. Here is how it works NO MORE SQLField('file','update',rememberfilename=True) NO MORE rememberfilename=True at all NOW SQLField('test','upload') always remembers the filename (話.dat) and encodes it in the stored filename.

[web2py:20784] internationalization of the admin, and RTL

2009-04-28 Thread guruyaya
Seem like my last post was not published for some reason, so I'll issue the same issues again. 1. There are several strings in the admin panel, that don't use the T function to make them available for translate. Is there a reason? If not, I'm willing to put the effort and locate these strings, so

[web2py:20785] Re: internationalization of the admin, and RTL

2009-04-28 Thread guruyaya
OK, Oddly I didn't see the quistion I asked, and the aswer until I posted the 2nd. God help google groups. Anyway, thanks for your answers. I imagine I'll find the time to handle 1 and 2 this weekend. On Apr 29, 6:47 am, guruyaya guruy...@gmail.com wrote: Seem like my last post was not

[web2py:20786] Re: Need help with query on datetime field

2009-04-28 Thread Yarko Tymciurak
You're welcome, Weheh - I'm glad you found it helpful. On Tue, Apr 28, 2009 at 8:05 PM, weheh richard_gor...@verizon.net wrote: Yarko, thanks for your useful reply. Yes, you are correct, this is essentially a python question, not a web2py question. What's so wonderful about web2py is how

[web2py:20787] experimental version control of web2py apps

2009-04-28 Thread mdipierro
there is a new experimental feature in trunk. run from source easy_install mercurial go to web2py admin and design an app you will notice a new menu item [mercurial] if you click on it it creates new mercurial repo associated to the app. if you write a comment and commit the current app gets

[web2py:20788] Re: experimental version control of web2py apps

2009-04-28 Thread Yarko Tymciurak
Oh, Man, Massimo - this is great I'll look in a few mintues... I'm thinking this is just the tip of a workflow thing - we should talk a bit... First: local repo is good (localhost); Second: deploy to remote server Third: commit to project or public place (e.g. bitbucket or google source,