[web2py] Re: Django urls to web2py

2011-11-20 Thread Constantine Vasil
Nothing works as expected with the trunk version after upload to GAE. Be careful for production environment.

Re: [web2py] Re: header detail transaction form in one page

2011-11-20 Thread steve van christie
thank you so much for your hint, is it possible to use the sqlform and crud to do header detail form in one page? right now i'm still learning to use it using standard form. On Mon, Nov 21, 2011 at 1:27 PM, pbreit wrote: > In web2py: > > redirect('http://www.web2py.com') > > But you're using

[web2py] Re: web2py on windows 7

2011-11-20 Thread Tom Campbell
I would avoid this by putting Python on the path, then web2py somewhere outside of Program Files, which I would claim is bad form anyway. Like a web2py directory off root, maybe? I can post a little tutorial for a manual Windows install of web2py illustrating this if you like.

[web2py] Re: header detail transaction form in one page

2011-11-20 Thread pbreit
In web2py: redirect('http://www.web2py.com') But you're using Web2py all wrong if you do this. Have you read up on how Web2py processes forms? http://web2py.com/book/default/chapter/03#Postbacks http://web2py.com/book/default/chapter/07

[web2py] Re: Using Python Imaging Library(PIL)

2011-11-20 Thread pbreit
You might also need to test: import PIL import _imaging

Re: [web2py] Can web2py do shared IP hosting

2011-11-20 Thread Phyo Arkar
Web2py is not a dedicated web server , web2py is a web framework and yest web2py runs on every popular server that supports shared hosting (Apache , Cherokee,etc,etc,etc) Its call vhost in server admins world. On Mon, Nov 21, 2011 at 12:19 PM, Robert Shaver wrote: > I'm completely new to web2py

[web2py] Re: Can web2py do shared IP hosting

2011-11-20 Thread Massimo Di Pierro
web2py is agnostic to it. The question is can you do is securely? That depends on what the share hosting provides offers you. what web server? mod_wsgi? are you allowed to run long processes under your account? For example if they allow you to start a long running process in your account, you can

[web2py] Can web2py do shared IP hosting

2011-11-20 Thread Robert Shaver
I'm completely new to web2py and so far have only been reading the documents to see if it has the features I'm looking for to implement my next project. Please let me know if I'm asking the wrong questions or if there's anything else I should be considering along with these questions. Many serv

[web2py] Re: web2py and FirePHP

2011-11-20 Thread Vineet
I can access that link. You may try to hit the link again. --- Vineet On Nov 20, 4:37 pm, Ed Greenberg wrote: > I happened upon this old thready from > 2009:https://groups.google.com/group/web2py/browse_thread/thread/cc13960a5... > > But unfortunately, the link to the code has become 404 and th

[web2py] Re: Django urls to web2py

2011-11-20 Thread Constantine Vasil
For My App added in routes.py: http://web2py.com/book/default/chapter/04 routes_in = ( ('/admin/$anything', '/admin/$anything'), ('/static/$anything', '/MyApp/static/$anything'), ('/appadmin/$anything', '/MyApp/appadmin/$anything'), ('/favicon.ico', '/MyApp/static/favicon.ico'), ('/robot

[web2py] Re: Django urls to web2py

2011-11-20 Thread Constantine Vasil
routes.example.py is working with also: http://web2py.com/book/default/chapter/04 Here is a more complex example that exposes a single app "myapp" without unnecessary prefixes but also exposes *admin*, *appadmin* and static: 1. 2. 3. 4. 5. 6. 7. 8. routes_in = ( ('/admin/$anything', '/admin

[web2py] Re: Django urls to web2py

2011-11-20 Thread Constantine Vasil
OK I did it, it found "appname" but could not render it right - cannot find the stylesheets. routers = dict( BASE = dict( default_application = 'appname', default_controller='default' ), )

[web2py] Re: Django urls to web2py

2011-11-20 Thread Constantine Vasil
I am just reporting you guys are awesome! Now will read it ;)

[web2py] Re: Doc Bug Report on the web2py book

2011-11-20 Thread Massimo Di Pierro
Thanks. There is a revised version of the book coming out soon. It is ok to post about the book here or email me. The new book will have its own issue tracker. On Nov 20, 5:53 pm, Robert Shaver wrote: > Didn't locate a bug reporting system so I thought I'd just post this here. > > On page:http://

[web2py] Re: Django urls to web2py

2011-11-20 Thread Massimo Di Pierro
You can also do keeping the same notation as Django: #in routes.py routes_in=[ (r'^faq/$', 'MyView/default/url_help_faq'), (r'^faq/(?P\S*)/(?P\S*)', '/MyView/default/url_help_faq/$a/ $b'), ] # in app MyView, in app controller default.py def url_help_faq(): if len(request.args) == 2:

[web2py] Re: Modernizr 2

2011-11-20 Thread Massimo Di Pierro
You can see the version inside the file. If there is a version number in the actual file, people will have to edit their layout on upgrades. I choose this for consistency with jquery.js moreover there is not one modernizer but many custom versions. On Nov 20, 12:19 pm, Constantine Vasil wrote: >

Re: [web2py] can web2py be used as a static website generator?

2011-11-20 Thread Robert Shaver
I'm just starting to read the web2py docs so I'm a complete noob ... however this may be the answer: "Requests for files in the static folder are handled directly and large files are automatically streamed to the client." I found this in the web2py book page at this link

[web2py] Doc Bug Report on the web2py book

2011-11-20 Thread Robert Shaver
Didn't locate a bug reporting system so I thought I'd just post this here. On page: http://web2py.com/book/default/chapter/04?search=server Search for "The view sees every variable". Right after this there is an unintentional line break causing this text: "defined in models and returned by the

Re: [web2py] can web2py be used as a static website generator?

2011-11-20 Thread Robert Shaver
But can I put an HTML file in a directory on the server and reach it from the web? That's what I think of as a static web page. For example: http://mydomain.com/index.html

[web2py] Re: Django urls to web2py

2011-11-20 Thread Anthony
In the default.py controller: def faq(): if len(request.args) > 1: #perform routine extracting topic0100 and faq0100 #topic0100 will be in request.args(0), and faq0100 will be in request.args(1) else: #perform default routine Note, by default, that will give you a

[web2py] partial date values in date fields

2011-11-20 Thread Nik Go
How is it possible to accept the following values in a date field: - -MM-DD - no problem - -MM (year and month only) - entered manually, accepted by IS_DATE(format=T('%Y-%m')) but the actual field contains -MM-*1. *Where "1" is added automatically by w2p. - (year on

[web2py] gevent helper script integration with web2py

2011-11-20 Thread Dave
I have a script that uses gevent which monkey patches the standard library to use green threads (cooperative coroutines). I'd like this to run as a background task using techniques described in "homemade task queues" or by using web2py's scheduler. Fundamentally my script only needs access to the D

[web2py] Django urls to web2py

2011-11-20 Thread Constantine Vasil
I have in Django urls these statements: (r'^faq/$', 'MyView.views.url_help_faq'), (r'^faq/(\S*)/(\S*)', 'MyView.views.url_help_faq'), Which is making possible *MyView.views.url_help_faq* to serve the following requests: http://www.MySite.com/faq http://www.MySite.com/faq/topic0100

Re: [web2py] Enforce roles in db

2011-11-20 Thread petrasadi
thanks, works like a charm

Re: [web2py] Re: Custom name for uploaded file

2011-11-20 Thread Miroslav Gojic
This is code for manual upload (it's work for me): def upload(): import os import shutil uploadfolder=os.path.join(request.folder, 'uploads') form = FORM( "Upload file:", INPUT(_type='file',_name='my_file', requires=IS_NOT_EMPTY()), 'Your name:', INP

[web2py] Re: Simplifying a SQL statement

2011-11-20 Thread Adrian Edwards
You're right it turned out that wasn't quit the solution I needed. After some testing I was able to get it working with the following command. entries = db(db.entries.user.belongs(db(db.event_users.event==event_id).select())).select(groupby=db.entries.user, orderby=~db.entries.value) I'm now

[web2py] Re: Simplifying a SQL statement

2011-11-20 Thread Cliff
If not working in the console, "print db._lastsql" will output the sql string to the terminal session where you started web2py, assuming you started it without the gui. Otherwise I think the gui has a little field to display outputs. On Nov 20, 3:42 pm, villas wrote: > Hi Adrian > Good that you

Re: [web2py] Enforce roles in db

2011-11-20 Thread Bruno Rocha
You need to fetch the ID of the desired group *group = db(db.auth_group.role == 'managers').select().first().id* define a DAL set using the group id to query membership table *dbset = db(db.auth_membership.group_id == group)* include IS_IN_DB validator filtering by the DAL set *db.Mytable.manager

[web2py] Re: Simplifying a SQL statement

2011-11-20 Thread villas
Hi Adrian Good that you are making progress, even though it doesn't look like the SQL would be equivalent to me. However, just in case you didn't already know this tip, I have so often found it useful to see what SQL statement is being generated by prefixing '_' in front of select, eg db(que

[web2py] Enforce roles in db

2011-11-20 Thread petrasadi
In my table a have a field like this: Field('manager', 'reference auth_user') Is there a way to enforce in my db for this 'manager' to be part of the "managers" group? I have tried db.myTable.manager.requires_membership('managers'), but of course this blew up. Any ideas would be highly appreciated

[web2py] OFF - Tropo Cloud API for Voice, SMS, and Instant Messaging Services

2011-11-20 Thread António Ramos
I´d like to see some app in web2py with Tropo http://www.youtube.com/watch?v=h6I0PwQQavg

[web2py] deploy on cherokee + uwsgi

2011-11-20 Thread Vincenzo Ampolo
Hi. I've just deplyed on cherokee + uwsgi using the uwsgihandler.py which comes in the web2py package. but when i try to connect i get: ERROR:web2py:Traceback (most recent call last): File "/var/www/argomenti.in/web2py/gluon/main.py", line 396, in wsgibase socket.gethostbyname(http_host)]

[web2py] web2py on windows 7

2011-11-20 Thread stas z
Hello, I'm working on a app that also runs on windows 7 and which uses web2py to display various dbase data in html views. The app is build with py2exe and packs the web2py "binary" for windows and starts the web2py_no_console.exe in a seperate thread. This works fine when one starts the app from t

[web2py] Re: SQLForm.grid - How do I use it properly?

2011-11-20 Thread villas
There is a shortage of documentation on the grid, but I've noticed that I often glean a lot from the code (even when I don't understand it all) -- I guess that's one of the beauties of opensource. So, in addition to any other resources you find, take a glance at this... http://code.google.c

[web2py] Re: help on rewrite

2011-11-20 Thread Anthony
Great. Thanks for checking. On Sunday, November 20, 2011 12:01:41 PM UTC-5, Niphlod wrote: > > yes, as far as I can tell the patch solved the infinite loop problem. > All other things are working correctly: it did not brake anything as > far as my tests gone. > > On 20 Nov, 17:14, Anthony wrote:

[web2py] Re: SQLForm.grid - How do I use it properly?

2011-11-20 Thread Rahul
Hi Johann, That is correct but I just wanted to know if I can change the existing functionality for SQLForm.grid View button. To be precise - here is an example of what I am trying to do. Example: The default builtin "View" button on SQLForm.grid has label "View", now how can I change its la

[web2py] Re: Modernizr 2

2011-11-20 Thread Constantine Vasil
I checked how you do it: It is better to have a version number: *modernizr-1.7.min.j* * * The browser load the .js file in its cache. If you use always the same name modernizr.*custom*.js, then there is no way for the browser to know there is a new version and there is no way you visitors to kno

[web2py] Re: I cant get example in the book to work,

2011-11-20 Thread chawk
Oh, thank you.There is a typo in the book, but that was retarded of me for not trying settings though. :)

Re: [web2py] I cant get example in the book to work,

2011-11-20 Thread Bruno Rocha
On Sun, Nov 20, 2011 at 3:13 PM, chawk wrote: > setting You trying to access auth.setting, it should be auth.*settings* -- Bruno Rocha [http://rochacbruno.com.br]

[web2py] Re: Using multi-field unique indexes

2011-11-20 Thread Niphlod
Unfortunately there is no simple way to achieve multi-column unique costraints in web2py. Aside from your implementation, you can use a third column that stores a composite key, say "%s_$$$_%s" % (key1, key2), that you can compute and set as unique. Something like (not tested): db.define_table('t

[web2py] I cant get example in the book to work,

2011-11-20 Thread chawk
((book)) There a number of ways to customize auth. The simplest way is to add extra fields: # after auth = Auth(db) auth.setting.extra_fields['auth_user']= [ Field('address'), Field('city'), Field('zip'), Field('phone')] # before auth.define_tables(username=True) ((my db.py file looks li

Re: [web2py] ImportError: No module named google.appengine.ext

2011-11-20 Thread Jonathan Lundell
On Nov 20, 2011, at 8:50 AM, Constantine Vasil wrote: > > Are you doing anything with sys.path? > > No - I do not. It seems to me it is a path issue > in the Eclipse+PyDev debugging environment. > > Still it is not clear to me how web2py finds it in > gaehandler.py but not in my db.py? Try log

[web2py] we2py + GAE - how to get the table key?

2011-11-20 Thread Constantine Vasil
>From the "book" if I use in web2py db.define_table('person', Field ('name'), Field ('image', 'upload')) it bets suited for "interactive" apps because it integrates well with the forms, templat

[web2py] Re: help on rewrite

2011-11-20 Thread Niphlod
yes, as far as I can tell the patch solved the infinite loop problem. All other things are working correctly: it did not brake anything as far as my tests gone. On 20 Nov, 17:14, Anthony wrote: > OK, so specifically regarding routes_onerror, has the recent patch > eliminated the infinite loop pro

[web2py] Re: Eclipse+Pydev+GAE+Debugging

2011-11-20 Thread Constantine Vasil
I spend a lot of time to figure out what is wrong. Part of the issue is Eclipse+Pydev cannot find the path to files. This happens because I have two separate web2y source projects under Eclipse - one with trunk, one with release. What I discovered: made a module, imported it from a controller, th

Re: [web2py] ImportError: No module named google.appengine.ext

2011-11-20 Thread Constantine Vasil
> Are you doing anything with sys.path? No - I do not. It seems to me it is a path issue in the Eclipse+PyDev debugging environment. Still it is not clear to me how web2py finds it in gaehandler.py but not in my db.py?

[web2py] Re: Rss Reader

2011-11-20 Thread Massimo Di Pierro
web2py comes with feedparser. Look at example 14: http://web2py.com/examples/default/examples On Nov 20, 3:58 am, Web2Py Freak wrote: > Dear All, > > How can i use an RSS reader in my website to get feeds from another > website ??

[web2py] Re: Custom name for uploaded file

2011-11-20 Thread Massimo Di Pierro
> what is difference between: > if form.process().accepted: > and > if form.accepts(request,session): no difference functionally, just different APIs. > If I have two variables (var1 and var2) > var1 = Object > var2 = cStringIO.StrindO 0x1234 > > Before your example I was stack with > file.write(

Re: [web2py] can web2py be used as a static website generator?

2011-11-20 Thread Bruno Rocha
You can create a web2py dynamic website, so when it were done you can convert it in to a static website. Take this action: def index(): form = FORM() return dict(form=form) This will create a and sends to the view, you can grab the rendered html and save it in an static html file de in

[web2py] Re: help on rewrite

2011-11-20 Thread Anthony
OK, so specifically regarding routes_onerror, has the recent patch eliminated the infinite loop problem (and not broken anything else), as far as you can tell? And yes, the pattern-based and parameter-based systems cannot be mixed -- you must use one or the other. routes_onerror, however, works

Re: [web2py] can web2py be used as a static website generator?

2011-11-20 Thread ~redShadow~
On Sun, 2011-11-20 at 07:37 -0800, moncho wrote: > i have been using many ruby-based generators. and i'm interested in > moving over into web2py. i know that hyde is python based and used > django, however web2py is the direction i'd like to head in. i havent > been able to find out whether it

[web2py] can web2py be used as a static website generator?

2011-11-20 Thread moncho
i have been using many ruby-based generators. and i'm interested in moving over into web2py. i know that hyde is python based and used django, however web2py is the direction i'd like to head in. i havent been able to find out whether it can deploy a completely stati c webstie though.

[web2py] Re: Create a simple drop down list

2011-11-20 Thread Anthony
You should be able to reference the t_ab_distribution table from multiple tables. Can you show the full models for these tables? What exactly broke (i.e., what do you see, and what do you expect)? Anthony On Sunday, November 20, 2011 7:32:31 AM UTC-5, EdgarAllenPoe wrote: > > Well I may have sp

[web2py] Re: Create a simple drop down list

2011-11-20 Thread Anthony
On Sunday, November 20, 2011 4:47:16 AM UTC-5, EdgarAllenPoe wrote: > > About the error thing. Just to be clear where I am working from. I > am using the online editor at: > http://127.0.0.1:8000/admin/default/edit/XxXxxx/models/db_wizard.py > > And for a test I just removed one of the commas

[web2py] Re: Simplifying a SQL statement

2011-11-20 Thread Adrian Edwards
Figured it out. Basically what I was trying to do was the following select SELECT entries FROM entries, event_users WHERE event_users.event == event_id Which I translated into entries_query = db.event_users.event == event_id entries = db(entries_query).select(db.entries.ALL, groupby=

[web2py] Using multi-field unique indexes

2011-11-20 Thread ~redShadow~
I just developed a way to quickly handle translations of table records, that works this way: Assuming we have a table name 'mytable' with three fields ('field0', 'field1' and 'field2'), it creates an exact copy of the original table (named 't9n_mytable', containing all the original fields plus a '

[web2py] Re: Eclipse+Pydev+GAE+Debugging

2011-11-20 Thread Nico de Groot
Not yet, I assumed running GAE locally wouldn't change debugging, but I will check (read: should have checked) this, unfortunately I don't have time for it this week. Maybe current GAE users can confirm/solve/document the problem? Nico de Groot

[web2py] Re: help on rewrite

2011-11-20 Thread Niphlod
so, here's a few tests on the functionality at the current state (patch applied). Maybe we can sum up a little "recipe" to explain better the "interaction" between parameter based and pattern based rewrite These settings for production sites are a real deal, so, here we are... The test is a ba

[web2py] Re: Using Python Imaging Library(PIL)

2011-11-20 Thread Web2Py Freak
i just used ssh to get into webfaction terminal and tested import Image on its python and its working .. thanx :)

Re: [web2py] Re: Using Python Imaging Library(PIL)

2011-11-20 Thread Kenneth Lundström
It seams to have PIL installed. At least one server I just tested. Kenneth i am using Webfaction

[web2py] Re: Using Python Imaging Library(PIL)

2011-11-20 Thread Web2Py Freak
i am using Webfaction

Re: [web2py] Re: Using Python Imaging Library(PIL)

2011-11-20 Thread Kenneth Lundström
Depends on the host. Do you have SSH access and can install things. If not have you tested if it already has it installed? Kenneth how do i install it in the host ???

[web2py] Re: Using Python Imaging Library(PIL)

2011-11-20 Thread Web2Py Freak
how do i install it in the host ???

[web2py] Re: Create a simple drop down list

2011-11-20 Thread EdgarAllenPoe
Well I may have spoke too soon... I have another table...this one: db.define_table('t_ab_team', [snip] Field('f_distribuionname', type='string', label=T('Distribuionname')), And I want to link the above field so that it show a drop down list also using the contents of the follo

[web2py] Re: help on rewrite

2011-11-20 Thread Niphlod
ok, I'll try to mess it up and see what is working and what is not. Thanks Niphlod

Re: [web2py] Re: Using Python Imaging Library(PIL)

2011-11-20 Thread Kenneth Lundström
Will not if PIL is not installed. Needs PIL on the host too. Kenneth i will try it , but when i upload my project to a host , how would the PIL work if its just installed to my PC ?

[web2py] Re: Using Python Imaging Library(PIL)

2011-11-20 Thread Web2Py Freak
i will try it , but when i upload my project to a host , how would the PIL work if its just installed to my PC ?

Re: [web2py] Re: Using Python Imaging Library(PIL)

2011-11-20 Thread Kenneth Lundström
I'm using Linux but does this work for you: http://code.google.com/appengine/docs/python/images/installingPIL.html#windows Kenneth windows 7

[web2py] Re: Using Python Imaging Library(PIL)

2011-11-20 Thread Web2Py Freak
windows 7

Re: [web2py] Re: Using Python Imaging Library(PIL)

2011-11-20 Thread Kenneth Lundström
PIL is not installed in web2py, it is installed on the operating system. What operating system are you using? Kenneth i dont know how to install it

[web2py] Re: Using Python Imaging Library(PIL)

2011-11-20 Thread Web2Py Freak
i dont know how to install it

[web2py] web2py and FirePHP

2011-11-20 Thread Ed Greenberg
I happened upon this old thready from 2009: https://groups.google.com/group/web2py/browse_thread/thread/cc13960a5079b2d5/d73a34f534a77419 But unfortunately, the link to the code has become 404 and the thread has died. Is anybody using the module that hooks web2py to FirePHP that could send me wha

Re: [web2py] Re: Using Python Imaging Library(PIL)

2011-11-20 Thread Kenneth Lundström
I don't understand what you mean. You don't need to do anything, this code works like it is. You have to of course have PIL installed? Kenneth i want to use this code but i dont know how to import the PIL ??? can you tell me how ?

[web2py] Re: Using Python Imaging Library(PIL)

2011-11-20 Thread Web2Py Freak
i want to use this code but i dont know how to import the PIL ??? can you tell me how ?

Re: [web2py] Using Python Imaging Library(PIL)

2011-11-20 Thread Kenneth Lundström
I use it to create a thumbnail: def makeThumbnail(dbtable,ImageID,size=(150,150)): try: thisImage=db(dbtable.id==ImageID).select()[0] import os, uuid from PIL import Image except: return if thisImage.image == "": return im=Image.open(request.folder

[web2py] Rss Reader

2011-11-20 Thread Web2Py Freak
Dear All, How can i use an RSS reader in my website to get feeds from another website ??

[web2py] Using Python Imaging Library(PIL)

2011-11-20 Thread Web2Py Freak
Dear All, How can i use the python PIL in my project ?

[web2py] Re: Create a simple drop down list

2011-11-20 Thread EdgarAllenPoe
Thanks again Anthony, Your help has been clear and concise. I have what I need now. About the error thing. Just to be clear where I am working from. I am using the online editor at: http://127.0.0.1:8000/admin/default/edit/XxXxxx/models/db_wizard.py And for a test I just removed one of th

Re: [web2py] Re: Custom name for uploaded file

2011-11-20 Thread Miroslav Gojic
Thanks Anthony, upload it's work Now I have some questions: Can I use form.formstyle = 'divs' on form created with SQLFORM.factory or some other methods to get div tag instead table what is difference between: if form.process().accepted: and if form.accepts(request,session): If I have two varia

[web2py] Re: Make an image Thumb

2011-11-20 Thread Web2Py Freak
Dear All, How can i install the PIL to my project i tried pbreit code but i didn't get i thumb i think maybe because am not using PIL in the correct way , i just Downloaded the PIL in source and copied it to the modules folder , how can i do it ?? Best regards, Hassan alnator