[web2py:18967] Re: auth and views?

2009-04-02 Thread Kacper Krupa
3) def login(): return auth.login() # create view "default/login.html" def register(): return auth.register() # create view "default/register.html" etc etc function should returns dict objects (then the templates are loaded afaik). So: def login(): dict(form=auth.login()) etc. On Apr 2, 6:54 am

[web2py:18969] How to use has_permission in a list of records

2009-04-02 Thread kellda
Using auth.has_permission for a single record (update, read) is clear for me but how to check the permission in a form with a list of records? def list(): records=db((db.test.id>0)).select() return dict(records=records) how to filter only the records with the permission? Do I have to che

[web2py:18968] Re: auth and views?

2009-04-02 Thread Vidul Petrov
Very useful feature (from my point of view) is that you can define only one template outside the actions - response.view='%s/ default.html' % request.controller - and it becomes the default one for all actions in a given controller. On Apr 2, 10:54 am, Kacper Krupa wrote: > 3) > def login(): ret

[web2py:18970] Re: Ajax Auth and Multiple Single Signon

2009-04-02 Thread notabene
I am working on an extension to auth that allows single signon from OpenID, Google, Yahoo, AOL, Facebook , MySpace and Windows Live. It use the RPX service from JanRain and allows consolidation of different identities as a single user. RPX has an ajax signin popup. Look here: https://rpxnow.com/

[web2py:18972] Save a view as a file ?

2009-04-02 Thread JC11
Hello, I would like to use the excellent template facilities in web2py views {{}} but save the results to a file rather than present them as a web page. How would this be possible ? This is just for one of several views in my application and should happen always for the one view without the

[web2py:18971] Re: DAL problem

2009-04-02 Thread mdipierro
should be def index(): rows = (db.mb_posts.board_id==db.mb_boards.id)& (db.mb_posts.reply_to==0) mb_posts2 = db.mb_posts.with_alias("mb_posts2") rows2 = (db.mb_posts2.board_id==db.mb_boards.id) query = db().select(db.mb_boards.ALL, db.mb_posts.id.count(), db.mb_posts2.id.count(),

[web2py:18973] Re: Save a view as a file ?

2009-04-02 Thread mdipierro
Yes but I am not sure from your question if you want the visitor to save the file on the client machine or on the server machine. I assume the former: def save_file(): filename='bla.html' response.headers['Content-Disposition']='attachment; filename="%s"' % filename return dict(var

[web2py:18974] Re: How to use has_permission in a list of records

2009-04-02 Thread mdipierro
This gives you a list of all record you can "read" db(db.auth_permission.name=="read")& (db.auth_permission.table_name=="yourtable")& (db.auth_permission.group_id==db.auth_membership.group_id)& (db.auth_membership.user_id==auth.user.id)).select (db.auth_permission.record_id) record_id=="0" in

[web2py:18975] Re: Ajax Auth and Multiple Single Signon

2009-04-02 Thread mdipierro
Look forward to see this! On Apr 2, 7:00 am, notabene wrote: > I am working on an extension to auth that allows single signon from > OpenID, Google, Yahoo, AOL, Facebook , MySpace and Windows Live. > > It use the RPX service from JanRain and allows consolidation of > different identities as a si

[web2py:18976] Re: Web2Py Conference

2009-04-02 Thread Michael
When is the conference? I live about 2hrs outside of Boston in Connecticut, could possibly make the trip if its not too late. On Apr 1, 4:50 pm, Tito Garrido wrote: > LOL!!! > > > > > > On Wed, Apr 1, 2009 at 5:10 PM, Yarko Tymciurak wrote: > > LOL > > > On Wed, Apr 1, 2009 at 2:51 PM, mdipierr

[web2py:18977] Re: Web2Py Conference

2009-04-02 Thread mdipierro
It was April 1st. Everybody got drunk and now nobody remembers anything about it. On Apr 2, 9:17 am, Michael wrote: > When is the conference? I live about 2hrs outside of Boston in > Connecticut, could possibly make the trip if its not too late. > > On Apr 1, 4:50 pm, Tito Garrido wrote: > > >

[web2py:18978] Re: How to use has_permission in a list of records

2009-04-02 Thread mdipierro
I could create a new auth method that allows: db(auth.accessible(db.yourtable,"read")&..yourquery..).select (db.yourtable.ALL) but it would not work on GAE because of the JOIN. Should I add it anyway? Massimo On Apr 2, 8:54 am, mdipierro wrote: > This gives you a list of all record you can "r

[web2py:18979] Re: Writing a Book

2009-04-02 Thread gabe
I would also add e-commerce examples and payment authentication systems (paypal, google checkout, 3rd party payment). I know what you are thinking, greedy capitalist...just look at the riots. Given the current economic environment I think this would be a relevant focus. Personally, those in my c

[web2py:18980] Re: How to use has_permission in a list of records

2009-04-02 Thread kellda
Thanks for fast answer. Such a method would be nice. Daniel --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2py Web Framework" group. To post to this group, send email to web2py@googlegroups.com To unsubscri

[web2py:18981] Re: How to use has_permission in a list of records

2009-04-02 Thread Yarko Tymciurak
On Thu, Apr 2, 2009 at 9:39 AM, mdipierro wrote: > > I could create a new auth method that allows: > > db(auth.accessible(db.yourtable,"read")&..yourquery..).select > (db.yourtable.ALL) > > but it would not work on GAE because of the JOIN. Should I add it > anyway? > h. > > Massimo > >

[web2py:18982] Re: Writing a Book

2009-04-02 Thread Zoom.Quiet
On Thu, Apr 2, 2009 at 03:18, mdipierro wrote: > > I look forward to this! > Sooo great news.. hope thin and very sapid book; focus litter topic and clean explain, is better ... > On Apr 1, 1:28 pm, TheDude wrote: >> (This isn't an April Fool's Joke) >> >> So, I've been writing a book for Web2

[web2py:18983] Re: How do we do Partial page updates like Ruiby on Rails

2009-04-02 Thread Brian
Steve, I eventually ran into the problem of having one controller need to use the partial for another controller. When this happens, you can move the partial function into a model file. Then, as partials get more complex, you can abstract most of them out to a view with response.render(...). F

[web2py:18984] Re: Writing a Book

2009-04-02 Thread Álvaro Justen [Turicas]
On Wed, Apr 1, 2009 at 3:28 PM, TheDude wrote: > > (This isn't an April Fool's Joke) > > So, I've been writing a book for Web2Py, but recently came towards a > new direction...we already have a great in-depth book writeen by > Massimo so I was wondering... > > Would you guys be interested in a bo

[web2py:18985] Re: How do we do Partial page updates like Ruiby on Rails

2009-04-02 Thread mdipierro
I would avoid using the XML as much as possible since this code introduces XSS vulnerabilities. Technically you are not using the partial described above (your are not calling the _department_view using ajax). your way of using sub-templates is fine. Massimo On Apr 2, 10:45 am, Brian wrote:

[web2py:18986] set id of table tags

2009-04-02 Thread phneoix
how to get an output from SQLTABLE or crud.select in the following way. . thanks --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2py Web Framework" group. To post to this group, send email to web2py@g

[web2py:18987] Re: set id of table tags

2009-04-02 Thread Kacper Krupa
SQLFORM(db.table, row, ..., _id="foo") On Apr 2, 7:06 pm, phneoix wrote: > how to get an output from SQLTABLE or crud.select in the following > way. > . > > thanks --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google

[web2py:18988] Re: Web2Py Conference

2009-04-02 Thread DJ
this is hilarious! you should make a cartoon out of this (like your superman!) On Apr 1, 3:51 pm, mdipierro wrote: > The new commercial is on TV now: > > A kid is playing with a train and says "Hi, I am Ruby on Rails" > A hot but professionally dressed girl comes in a says: "Hi, I am > web2py" >

[web2py:18989] Re: set id of table tags

2009-04-02 Thread phneoix
thanks On Apr 2, 10:22 pm, Kacper Krupa wrote: > SQLFORM(db.table, row, ..., _id="foo") > > On Apr 2, 7:06 pm, phneoix wrote: > > > how to get an output from SQLTABLE or crud.select in the following > > way. > > . > > > thanks --~--~-~--~~~---~--~~ Yo

[web2py:18990] Re: DAL problem

2009-04-02 Thread TheDude
Massimo, I still get the error: Traceback (most recent call last): File "/home/daniel/web2py/gluon/restricted.py", line 98, in restricted exec ccode in environment File "/home/daniel/web2py/applications/community/controllers/ forum.py", line 9, in File "/home/daniel/web2py/gluon/globals

[web2py:18991] Re: DAL problem

2009-04-02 Thread mdipierro
ry def index(): rows = (db.mb_posts.board_id==db.mb_boards.id)& (db.mb_posts.reply_to==0) mb_posts2 = db.mb_posts.with_alias("mb_posts2") rows2 = (mb_posts2.board_id==db.mb_boards.id) query = db().select(db.mb_boards.ALL, db.mb_posts.id.count(), mb_posts2.id.count(), left=(db.mb_p

[web2py:18992] Re: DAL problem

2009-04-02 Thread TheDude
SQL Works! However... {{=board.mb_boards.keys()}} brings up: ['update_record', 'mb_posts', 'description', 'id', 'name'] As you can see, no mb_posts2 (mb_posts does not contain mb_posts2 either). So, I said to myself may be it's because of the .ALL within the select. Still no go. On Apr 2, 2:56 

[web2py:18993] Re: Save a view as a file ?

2009-04-02 Thread JC11
Sorry I did not make that clear. The file should be saved on the server. JC On Apr 2, 2:16 pm, mdipierro wrote: > Yes but I am not sure from your question if you want the visitor to > save the file on the client machine or on the server machine. I assume > the former: > > def save_file(): >    

[web2py:18994] Re: DAL problem

2009-04-02 Thread mdipierro
what is "board"? On Apr 2, 5:20 pm, TheDude wrote: > SQL Works! However... > > {{=board.mb_boards.keys()}} > brings up: > ['update_record', 'mb_posts', 'description', 'id', 'name'] > > As you can see, no mb_posts2 (mb_posts does not contain mb_posts2 > either). So, I said to myself may be it's b

[web2py:18995] Re: Save a view as a file ?

2009-04-02 Thread mdipierro
open(filename,'wb').save(response.render(view_filename,dict(a=3))) On Apr 2, 5:22 pm, JC11 wrote: > Sorry I did not make that clear. The file should be saved on the > server. > JC > > On Apr 2, 2:16 pm, mdipierro wrote: > > > Yes but I am not sure from your question if you want the visitor to

[web2py:18996] Re: DAL problem

2009-04-02 Thread TheDude
Sorry, it's in my views :) {{extend 'layout.html'}} Message Boards Board Threads Posts Last Topic {{for board in query:}} {{=A(board.mb_boards.name, _href=URL(r=request, f='view', args=board.mb_boards.id))}}{{=board.mb_boards.description}} {{=board.mb_boards.mb_posts.count()}} {{=board.mb_boa

[web2py:18997] PyCon Videos

2009-04-02 Thread Yarko Tymciurak
http://blip.tv/file/1949388/ ORM Panel w/ Massimo representing web2py DAL. Other PyCon videos are being linked (nicely) to http://us.pycon.org/2009/conference/schedule/ but not all yet - you can find the uploaded Pycon files on http://blip.tvand search for PyCon If you couldn't attend, or not s

[web2py:18998] Re: PyCon Videos

2009-04-02 Thread Yarko Tymciurak
To those of you who attended, and came by to introduce themselves, thanks! It's great to meet people who you just "see" on the network. Looking forward to meeting more people at future conferences. On Apr 2, 6:19 pm, Yarko Tymciurak wrote: > http://blip.tv/file/1949388/ > > ORM Panel w/ Massim

[web2py:18999] WARNING:root:unable to import dbhash (only from external cron)

2009-04-02 Thread seth
I'm having trouble doing a db.table.insert from an external cron on macosx. The system cron file 0-59/1 * * * * cd /Users/username/Desktop/appname/web2py && python web2py.py -R applications/appname/controllers/test.py -C -D 1 >> /tmp/ cron.output 2>&1 The crontab file in appname/cron directory

[web2py:19000] Re: WARNING:root:unable to import dbhash (only from external cron)

2009-04-02 Thread mdipierro
I do not know if this is related but sqlite that ships on python for macosx has known bugs. This would not be the only one. You should use the binary distribution on OSX which does not seem to have these problems. On Apr 2, 6:29 pm, seth wrote: > I'm having trouble doing a db.table.insert from a

[web2py:19001] Re: Web2Py Conference

2009-04-02 Thread Yannick
this is so true...lol...nice ads hehe On Apr 1, 3:51 pm, mdipierro wrote: > The new commercial is on TV now: > > A kid is playing with a train and says "Hi, I am Ruby on Rails" > A hot but professionally dressed girl comes in a says: "Hi, I am > web2py" > Kid: "My train has 3 cars. They are call

[web2py:19002] Re: Web2Py Conference

2009-04-02 Thread Skylar Saveland
uhm.. so where are the latest docs? :-P --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2py Web Framework" group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send e

[web2py:19003] Re: How do we do Partial page updates like Ruiby on Rails

2009-04-02 Thread Steve Shepherd
@Brian Thanks for your code. As Massimo described preloading the page is dangerous using xml also this is SLOW. By using ajax calls you make a round trip to the server to retrieve the content needed and replace the innerhtml of a div . This means the server loads a list of departments quickly. Then

[web2py:19004] okapi

2009-04-02 Thread mdipierro
I saw this at PyCon http://www.aminus.net/wiki/Okapi from the creator of cherrypy and the wsgiserver. I think it would be a very useful addition to the web2py admin interface (a browser in browser to test various pages). For now it could be just a link to a static html page in admin|design alth

[web2py:19005] Re: How do we do Partial page updates like Ruiby on Rails

2009-04-02 Thread mdipierro
not sure what you are asking me. Massimo On Apr 2, 10:21 pm, Steve Shepherd wrote: > @Brian > Thanks for your code. > As Massimo described preloading the page is dangerous using xml also this is > SLOW. > By using ajax calls you make a round trip to the server to retrieve the > content needed a