[web2py] Populating widgets with queries
I have a checkboxes widget which I invoke like so: form = SQLFORM.factory( Field('test', type='string', requires=IS_IN_DB(db, db.city.name_url, '%(name)s', multiple=True), widget=lambda f, v: SQLFORM.widgets.checkboxes.widget(f, v, style='divs'), default = 'New-York'), formstyle='divs') I use requires=IS_IN_DB solely to populate the checkboxes with fresh data. I don't really need the validation. Now I would prefer to spread the data in the one table being used across multiple checkbox groups. Is there an out-of-the-box way to populate form elements with queries instead of just binding them to tables? --
[web2py] Re: Populating widgets with queries
I should add that it would be easy for me to customize form elements this way, but I would like to do so in a way that does not sacrifice existing form functionality and is just generally in conformance with the web2py way. On Saturday, September 8, 2012 2:22:21 AM UTC-4, Mike Girard wrote: I have a checkboxes widget which I invoke like so: form = SQLFORM.factory( Field('test', type='string', requires=IS_IN_DB(db, db.city.name_url, '%(name)s', multiple=True), widget=lambda f, v: SQLFORM.widgets.checkboxes.widget(f, v, style='divs'), default = 'New-York'), formstyle='divs') I use requires=IS_IN_DB solely to populate the checkboxes with fresh data. I don't really need the validation. Now I would prefer to spread the data in the one table being used across multiple checkbox groups. Is there an out-of-the-box way to populate form elements with queries instead of just binding them to tables? --
Re: [web2py] Re: Why would I use DIV classes/helpers, over an html template?
I would never/rarely do what Cliff describes. I generally put as little logic into the views as possible. That is totally perfectly fine with Web2py. But it's nice to have full Python available. It's basically the best of both worlds. If you need to have the templating literally forbid you from using too much logic, then maybe Web2py isn't the right framework. But that seems bizarre to me. On Friday, September 7, 2012 12:21:30 PM UTC-7, luckysmack wrote: But see, to me, now that's putting HTML in the controller. Which I see as a negative. Ideally I would pass the data to the view and use a foreach over the data contents. And for marking a field as red, I would put some metadata into the data sent to the view. I would just test if vacant was true, and if so, change style. This way there's no hidden HTML tags/structure from a designers template file. On Sep 7, 2012 12:11 PM, Andrew W awill...@gmail.com javascript: wrote: Good example Cliff. -- --
Re: [web2py] Populating widgets with queries
maybe this? form = SQLFORM.factory( Field('test', type='string', requires=IS_IN_DB(*db(db.table.field == xyz)*, db.city.name_url, '%(name)s', multiple=True), widget=lambda f, v: SQLFORM.widgets.checkboxes.widget(f, v, style='divs'), default = 'New-York'), formstyle='divs') or myset = [(value 1, text 1), (value 2, text 2), (value 2, text 2)] form = SQLFORM.factory( Field('test', type='string', requires=IS_IN_SET(myset, multiple=True), widget=lambda f, v: SQLFORM.widgets.checkboxes.widget(f, v, style='divs'), default = 'New-York'), formstyle='divs') or myset = {value 1: text 1, value 2: text 2, value 2: text 2} form = SQLFORM.factory( Field('test', type='string', requires=IS_IN_SET(myset, multiple=True), widget=lambda f, v: SQLFORM.widgets.checkboxes.widget(f, v, style='divs'), default = 'New-York'), formstyle='divs') or myset = db.executesql(SELECT value, text FROM sometable) form = SQLFORM.factory( Field('test', type='string', requires=IS_IN_SET(myset, multiple=True), widget=lambda f, v: SQLFORM.widgets.checkboxes.widget(f, v, style='divs'), default = 'New-York'), formstyle='divs') *Bruno Cezar Rocha** - @rochacbruno* rochacbr...@gmail.com | Mobile: +55 (11) 99210-8821 www.CursoDePython.com.br | www.rochacbruno.com.br Blog: Using Python to get all the external links from a webpagehttp://rochacbruno.com.br/using-python-to-get-all-the-external-links-from-a-webpage/ Get a signature like this. http://r1.wisestamp.com/r/landing?promo=18dest=http%3A%2F%2Fwww.wisestamp.com%2Femail-install%3Futm_source%3Dextension%26utm_medium%3Demail%26utm_campaign%3Dpromo_18 Click here.http://r1.wisestamp.com/r/landing?promo=18dest=http%3A%2F%2Fwww.wisestamp.com%2Femail-install%3Futm_source%3Dextension%26utm_medium%3Demail%26utm_campaign%3Dpromo_18 On Sat, Sep 8, 2012 at 3:22 AM, Mike Girard mikegirar...@gmail.com wrote: I have a checkboxes widget which I invoke like so: form = SQLFORM.factory( Field('test', type='string', requires=IS_IN_DB(db, db.city.name_url, '%(name)s', multiple=True), widget=lambda f, v: SQLFORM.widgets.checkboxes.widget(f, v, style='divs'), default = 'New-York'), formstyle='divs') I use requires=IS_IN_DB solely to populate the checkboxes with fresh data. I don't really need the validation. Now I would prefer to spread the data in the one table being used across multiple checkbox groups. Is there an out-of-the-box way to populate form elements with queries instead of just binding them to tables? -- --
[web2py] Re: [OT] Ubuntu 12.10 will no longer ship with Python 2
As far as I can tell, Python 2 remains the default Python, at least in server. Defaulting to 3 would be completely insane. On Friday, September 7, 2012 5:56:59 AM UTC-7, Luther Goh Lu Feng wrote: FYI: Ubuntu 12.10 Quantal Quetzal says bye bye to Python 2. Take note if you run web2py and intend to use 12.10. I am not sure if there are ways to get Python 2 installed though. For 12.10, we intend to ship only Python 3 with the Ubuntu desktop image, not Python 2. Beta-1 continues this process. https://wiki.ubuntu.com/QuantalQuetzal/TechnicalOverview/Beta1#Python_3.0 --
Re: [web2py] Populating widgets with queries
The IS_IN_DB etc didn't work for me -- perhaps I did something wrong -- but the variations with IS_IN_SET do. Thanks! On Saturday, September 8, 2012 2:46:24 AM UTC-4, rochacbruno wrote: maybe this? form = SQLFORM.factory( Field('test', type='string', requires=IS_IN_DB(*db(db.table.field == xyz)*, db.city.name_url, '%(name)s', multiple=True), widget=lambda f, v: SQLFORM.widgets.checkboxes.widget(f, v, style='divs'), default = 'New-York'), formstyle='divs') or myset = [(value 1, text 1), (value 2, text 2), (value 2, text 2)] form = SQLFORM.factory( Field('test', type='string', requires=IS_IN_SET(myset, multiple=True), widget=lambda f, v: SQLFORM.widgets.checkboxes.widget(f, v, style='divs'), default = 'New-York'), formstyle='divs') or myset = {value 1: text 1, value 2: text 2, value 2: text 2} form = SQLFORM.factory( Field('test', type='string', requires=IS_IN_SET(myset, multiple=True), widget=lambda f, v: SQLFORM.widgets.checkboxes.widget(f, v, style='divs'), default = 'New-York'), formstyle='divs') or myset = db.executesql(SELECT value, text FROM sometable) form = SQLFORM.factory( Field('test', type='string', requires=IS_IN_SET(myset, multiple=True), widget=lambda f, v: SQLFORM.widgets.checkboxes.widget(f, v, style='divs'), default = 'New-York'), formstyle='divs') *Bruno Cezar Rocha** - @rochacbruno* rocha...@gmail.com javascript: | Mobile: +55 (11) 99210-8821 www.CursoDePython.com.br | www.rochacbruno.com.br Blog: Using Python to get all the external links from a webpagehttp://rochacbruno.com.br/using-python-to-get-all-the-external-links-from-a-webpage/ Get a signature like this. http://r1.wisestamp.com/r/landing?promo=18dest=http%3A%2F%2Fwww.wisestamp.com%2Femail-install%3Futm_source%3Dextension%26utm_medium%3Demail%26utm_campaign%3Dpromo_18 Click here.http://r1.wisestamp.com/r/landing?promo=18dest=http%3A%2F%2Fwww.wisestamp.com%2Femail-install%3Futm_source%3Dextension%26utm_medium%3Demail%26utm_campaign%3Dpromo_18 On Sat, Sep 8, 2012 at 3:22 AM, Mike Girard mikegi...@gmail.comjavascript: wrote: I have a checkboxes widget which I invoke like so: form = SQLFORM.factory( Field('test', type='string', requires=IS_IN_DB(db, db.city.name_url, '%(name)s', multiple=True), widget=lambda f, v: SQLFORM.widgets.checkboxes.widget(f, v, style='divs'), default = 'New-York'), formstyle='divs') I use requires=IS_IN_DB solely to populate the checkboxes with fresh data. I don't really need the validation. Now I would prefer to spread the data in the one table being used across multiple checkbox groups. Is there an out-of-the-box way to populate form elements with queries instead of just binding them to tables? -- --
[web2py] Web2py. for a minimalist app, it feels bloated. Do it I need it?
I am somewhat new to python, and * shock * have an idea for a simple app I want to build. To start the app will be relatively light weight, but if it works out in my grand scheme could be far more complex.but the core will be fairly simple. something an experienced python dev could probably whip up in bottle in a few days. The core will a simply be an advanced rest based api. The other half dozen or so apps will all be built of this core. The either apps will likely be built as a cms like system to manage each other. And as different as a POS in store program. So as many cool things as I thing web2py has, do you guys think its the right system? I know w2p can do great APIs easily. But for that simple aspect, I don't need a milti-application admin interface, or a code editor, and I may not even use DAL. (For my project I may actually use something like neo4j/orientdb/titan. Not sure yet. Might use mongodb as instead). So for that simple part, all the other stuff seems a little bloated to me. Stuff that I won't need. Sure as a whole, all the apps will be built into somewhat of a cms (which I would like to build anyways), for that I'm not sure I would need the web2py admin part. As a cms I would probably have my own interface, even for the admins. How or would web2py admin ui fit in. I know you guys are biased towards web2py, but does it sound like it would be a right fit? Or would it be too complex? In comparison, I feel django is too bloated as well since I would be doing a similar thing, except it would be done quite a bit differently. The core of how it works doesn't seem to fit my ideas. If I don't use web2py, the next best things I see as a starting point are pyramid, or bottle/flask or even wheezy looks pretty cool. What do you guys think? The core great api would be the crux of the other apps. This core is what talks to the db. And each if the apps with build on it. The rest part will be made so they can all communicate with each other based on the URL. The either individual apps, were they to be on their own, I can totally see as a web2py app. So I'm curious how this idea as a whole, would fit into web2py. If it can. Since there are a handful of web2py featured I won't even use. I don't need them to be auto imported if I'm not using them (since I can't see what's being imported). So in a way it feels like bloat. A reason I don't like django. What do you guys think? Any input is greatly appreciated. --
Re: [web2py] Re: static blog
Thanks. That would be great. On Saturday, September 8, 2012 8:31:16 AM UTC+12, Massimo Di Pierro wrote: Yes. I will post the script soon. I need to fix it because I changed the markmin syntax of links so my previous script broke. On Friday, 7 September 2012 14:58:06 UTC-5, Andrew W wrote: Thanks. My intention is to make , and print, a PDF of the markmin content, just like the book. For disaster recovery doco, I want a hard copy. With the new book app, are you still planning to have available a PDF from the files? --
[web2py] Re: Getting auth.wiki pages to display without login
The S comes from Welcome App's layout.html, line 80: div class=nav-collapses On Saturday, September 8, 2012 8:41:35 PM UTC+12, Andrew W wrote: Just Checking, were you logged in when you tried to open up the page ? Just to clarify, if I'm logged in it will take me directly to the page - as expected. I wanted to test having pages available to users who haven't logged in - which for this case would be most people - the public. I opened a new browser window, made sure I wasn't logged in to web2py, and pasted in the url of my new page. I get the login screen. I've just tried it again at home, creating just a simple page (OK, I did add an extra css file to the layout). Screen shot attached of page (when logged in), and screen when I paste in the url. Apart from that, auth.wiki is looking great. I'm experimenting with adding blocks with extra classes, allowing me to style them differently. Can I specify classes to other elements, or is it just blockquotes ? P.S. I'm getting a small S in the menu bar (app created from Welcome with no changes to menu) - see screen shot Thanks On Saturday, September 8, 2012 7:42:22 AM UTC+12, Massimo Di Pierro wrote: Strange. It should work even without url=True. You should be able to paste any URL in markmin and it should work. MARKMIN(text, url=True) simply allows you to user the shortcuts @/app/controller/function/args and they will be converted in http:///app/controller/function/args where app, controller and function are optional. You can do @///index for example. On Friday, 7 September 2012 14:15:31 UTC-5, Andrew W wrote: No I didn't. Only just found out about URL=True. Di I pass as a URL variable ? --
[web2py] Re: How do I incorporate git into my web2py workflow?
I've noticed that on Windows with tortoiseHG installed, that web2py doesn't recognise it as a Mercurial Installation.I guess I have to install Mercurial separately, although I'm using it through TortoiseHG ? On Saturday, September 8, 2012 10:46:13 AM UTC+12, Massimo Di Pierro wrote: One of the new features is that in admin you can use a git url to install a web2py directly from github. You can also push an app to github. All of this requires python-git. We are working on adding better git/hg features. On Friday, 7 September 2012 17:24:42 UTC-5, Pystar wrote: I would like to know how coders here incorporate git or any other VCS into their coding workflow with web2py? Thanks --
Re: [web2py] Re: web2py book on github
I use TortoiseHG on Windows which I find quite simple to use, although sometimes I have to go back to the command line. I recommend it. In any case, the tar.gz should work. Are you getting an error ? On Saturday, September 8, 2012 7:47:38 AM UTC+12, ikdme wrote: Hello, Please am a windows user and I don't know how to use mercurial or git so i downloaded the book in 'tar.gz' format. I managed to install the book but the images are not displaying (streaming). I don't know why. Please could someone help me with what to do. Thanks On Tue, Sep 4, 2012 at 8:54 PM, Niphlod nip...@gmail.com javascript:wrote: sections with code are h1,h2,h3,h4,h5,h6 contained in a div with class article containing a code tag. assuming you want them styled as h1,h2,h3,h4,h5,h6 with no changes in style in respect of other h1,h2,h3,h4,h5,h6 the simplest thing is .article h1 code, .article h2 code, .article h3 code, .article h4 code, .article h5 code, .article h6 code { display: block; color : #33; border: 0px; font-size: inherit; background: transparent; } On Monday, September 3, 2012 11:37:12 PM UTC+2, Massimo Di Pierro wrote: The book uses the default web2py style with bootstrap. The section titles, if they contain code are not rendered properly. Could use some help improving the css. massimo On Saturday, 1 September 2012 12:00:49 UTC-5, Massimo Di Pierro wrote: The web2py book app has been rewritten http://www.web2py.com/book and the source of the app and the book itself is now on github https://github.com/mdipierro/**web2py-book/tree/master/**sourceshttps://github.com/mdipierro/web2py-book/tree/master/sources Hopefully this will make it easier to keep it updated. You can just send me patches. You can also try run it yourself and see how it looks. It is no more db based. it is file based. The syntax is markmin as documented in the bok itself. Massimo -- --
[web2py] Routing a .json request
Hi, I am trying to access an action returning json data. According to Example 12 here: http://www.web2py.com/examples/default/examples, all actions requested with .json and returning a dict are automatically converted to json. But this is not working for me, maybe because routing is interfering. I am using a router, like this: routes_in = ( ('/call_stats.json', '/myapp/dashboard/call_stats.json'), ) My client is calling call_stats.json, but I just get this response: invalid view (dashboard/call_stats.json) I have tried several combinations of router settings (with and without .json) This is my action, in controller dashboard.py: def call_stats(): return CallStats().get_stats() Which is returning a dict. How can I tell web2py that that action needs to be served as json? Thanks Daniel --
Re: [web2py] Re: web2py book on github
The documentation is starting to look much better :) Maybe the chapters have gotten a little large though and should each be separated into Basic use and Advanced use... Also the new code boxes are much nicer than before, but still doesn't have python syntax-highlighting. Can we get this also? On Sat, Sep 8, 2012 at 6:57 PM, Andrew W awillima...@gmail.com wrote: I use TortoiseHG on Windows which I find quite simple to use, although sometimes I have to go back to the command line. I recommend it. In any case, the tar.gz should work. Are you getting an error ? On Saturday, September 8, 2012 7:47:38 AM UTC+12, ikdme wrote: Hello, Please am a windows user and I don't know how to use mercurial or git so i downloaded the book in 'tar.gz' format. I managed to install the book but the images are not displaying (streaming). I don't know why. Please could someone help me with what to do. Thanks On Tue, Sep 4, 2012 at 8:54 PM, Niphlod nip...@gmail.com wrote: sections with code are h1,h2,h3,h4,h5,h6 contained in a div with class article containing a code tag. assuming you want them styled as h1,h2,h3,h4,h5,h6 with no changes in style in respect of other h1,h2,h3,h4,h5,h6 the simplest thing is .article h1 code, .article h2 code, .article h3 code, .article h4 code, .article h5 code, .article h6 code { display: block; color : #33; border: 0px; font-size: inherit; background: transparent; } On Monday, September 3, 2012 11:37:12 PM UTC+2, Massimo Di Pierro wrote: The book uses the default web2py style with bootstrap. The section titles, if they contain code are not rendered properly. Could use some help improving the css. massimo On Saturday, 1 September 2012 12:00:49 UTC-5, Massimo Di Pierro wrote: The web2py book app has been rewritten http://www.web2py.com/book and the source of the app and the book itself is now on github https://github.com/mdipierro/web2py-book/tree/master/sources Hopefully this will make it easier to keep it updated. You can just send me patches. You can also try run it yourself and see how it looks. It is no more db based. it is file based. The syntax is markmin as documented in the bok itself. Massimo -- -- --
[web2py] Can I insert a template into a form?
I have a SQLFORM with many fields. I want to insert a html file (like {{include abc.html}} in views) into the middle of the form. Can I do that? --
Re: [web2py] Re: web2py book on github
I'm not getting any errors. The images are not displaying. Every other is working well. I miss the line numbers. On Sat, Sep 8, 2012 at 10:30 AM, Alec Taylor alec.tayl...@gmail.com wrote: The documentation is starting to look much better :) Maybe the chapters have gotten a little large though and should each be separated into Basic use and Advanced use... Also the new code boxes are much nicer than before, but still doesn't have python syntax-highlighting. Can we get this also? On Sat, Sep 8, 2012 at 6:57 PM, Andrew W awillima...@gmail.com wrote: I use TortoiseHG on Windows which I find quite simple to use, although sometimes I have to go back to the command line. I recommend it. In any case, the tar.gz should work. Are you getting an error ? On Saturday, September 8, 2012 7:47:38 AM UTC+12, ikdme wrote: Hello, Please am a windows user and I don't know how to use mercurial or git so i downloaded the book in 'tar.gz' format. I managed to install the book but the images are not displaying (streaming). I don't know why. Please could someone help me with what to do. Thanks On Tue, Sep 4, 2012 at 8:54 PM, Niphlod nip...@gmail.com wrote: sections with code are h1,h2,h3,h4,h5,h6 contained in a div with class article containing a code tag. assuming you want them styled as h1,h2,h3,h4,h5,h6 with no changes in style in respect of other h1,h2,h3,h4,h5,h6 the simplest thing is .article h1 code, .article h2 code, .article h3 code, .article h4 code, .article h5 code, .article h6 code { display: block; color : #33; border: 0px; font-size: inherit; background: transparent; } On Monday, September 3, 2012 11:37:12 PM UTC+2, Massimo Di Pierro wrote: The book uses the default web2py style with bootstrap. The section titles, if they contain code are not rendered properly. Could use some help improving the css. massimo On Saturday, 1 September 2012 12:00:49 UTC-5, Massimo Di Pierro wrote: The web2py book app has been rewritten http://www.web2py.com/book and the source of the app and the book itself is now on github https://github.com/mdipierro/web2py-book/tree/master/sources Hopefully this will make it easier to keep it updated. You can just send me patches. You can also try run it yourself and see how it looks. It is no more db based. it is file based. The syntax is markmin as documented in the bok itself. Massimo -- -- -- --
[web2py] modified_by and modified_on not updating
I want to maintain an audit history of all my objects. So near the beginning of my model definition I have db._common_fields.append(auth.signature) and at the very end I have auth.enable_record_versioning(db) The problem I am having is that when I pull up all the records representing the history of an object, the modified_by and modified_on fields do not reflect the time and user that performed the change. In fact, they appear to be stuck on whoever was logged in when I last restart the web2py server and the time at which I restarted it. (Maybe it's the first person to perform an edit and the time they do it at since last restart.) Anyway, is there something obvious I am missing here? --
Re: [web2py] Re: web2py book on github
are you on the latest web2py version ? BTW: the book is still online at web2py.com/book if you want to read it: it's not required to download the app to read it ^_^ On Saturday, September 8, 2012 2:16:44 PM UTC+2, ikdme wrote: I'm not getting any errors. The images are not displaying. Every other is working well. I miss the line numbers. On Sat, Sep 8, 2012 at 10:30 AM, Alec Taylor alec.t...@gmail.comjavascript: wrote: The documentation is starting to look much better :) Maybe the chapters have gotten a little large though and should each be separated into Basic use and Advanced use... Also the new code boxes are much nicer than before, but still doesn't have python syntax-highlighting. Can we get this also? On Sat, Sep 8, 2012 at 6:57 PM, Andrew W awill...@gmail.comjavascript: wrote: I use TortoiseHG on Windows which I find quite simple to use, although sometimes I have to go back to the command line. I recommend it. In any case, the tar.gz should work. Are you getting an error ? On Saturday, September 8, 2012 7:47:38 AM UTC+12, ikdme wrote: Hello, Please am a windows user and I don't know how to use mercurial or git so i downloaded the book in 'tar.gz' format. I managed to install the book but the images are not displaying (streaming). I don't know why. Please could someone help me with what to do. Thanks On Tue, Sep 4, 2012 at 8:54 PM, Niphlod nip...@gmail.com wrote: sections with code are h1,h2,h3,h4,h5,h6 contained in a div with class article containing a code tag. assuming you want them styled as h1,h2,h3,h4,h5,h6 with no changes in style in respect of other h1,h2,h3,h4,h5,h6 the simplest thing is .article h1 code, .article h2 code, .article h3 code, .article h4 code, .article h5 code, .article h6 code { display: block; color : #33; border: 0px; font-size: inherit; background: transparent; } On Monday, September 3, 2012 11:37:12 PM UTC+2, Massimo Di Pierro wrote: The book uses the default web2py style with bootstrap. The section titles, if they contain code are not rendered properly. Could use some help improving the css. massimo On Saturday, 1 September 2012 12:00:49 UTC-5, Massimo Di Pierro wrote: The web2py book app has been rewritten http://www.web2py.com/book and the source of the app and the book itself is now on github https://github.com/mdipierro/web2py-book/tree/master/sources Hopefully this will make it easier to keep it updated. You can just send me patches. You can also try run it yourself and see how it looks. It is no more db based. it is file based. The syntax is markmin as documented in the bok itself. Massimo -- -- -- --
[web2py] Object Row. Error in 2.0.8 not in 2.0.0
Hi all In Version 2.0.0 (2012-06-04 18:49:33) dev works well Model: tb_studio = db.define_table('studio', Field('name', label=T('Name')), #... format='%(name)s', migrate=MIGRATE ) tb_emails = db.define_table('emails', Field('studio', tb_studio, readable=False, writable=False, default=1), Field('email', label=T('Email')), migrate=MIGRATE ) Controller def bg_studio(): row = db(tb_studio.id==1).select(cache=(cache.ram, 60)).first() email = row.emails.select().first() return dict(row=row, email=email) In Version 2.0.8 (2012-09-07 09:38:35) stable, error occurs: File /usr/home/jose/web2py/applications/dm/controllers/default.py http://127.0.0.1:8000/admin/default/edit/dm/controllers/default.py, line 45, in bg_studio email = row.emails.select().first() AttributeError: 'Row' object has no attribute 'emails' Jose --
[web2py] Re: need help testing google checkout with pos plugin
Hi, reading through the recent posts about user_signature=False/True I have a better understanding of digitally signed signatures and why they are important for security. I think this answers my question. Thanks! On Tuesday, September 4, 2012 6:08:56 PM UTC-5, greaneym wrote: Hello, I would like to test the google_checkout_plugin and need some help, please. This are the names of the plugin I downloaded: web2py.plugin.google_checkout.w2p and web2py.app.PosOnlineStore.w2p Does this first plugin provide the functionality (of what is described in the Google developer documentation) of the XML API, which requires a digital signature and has integration with the user's database? or does the plugin have functionality of the HTML API, with no dig.signature and which requires the user to login to an account on google checkout and look at what purchases have been made? I have a sandbox account and am trying to test but get errors. With the plugin installed and testing on the pos appliance/plugin, I am not able to get to the google checkout sandbox. Do I need some type of digital signature? Here is the button info that I think google wants people to use: Here are the contents of my pos/default/index.html file, where I have substituted numbers necessary. --pos index info-snip--- img src={{=URL('plugin_google_checkout','button', vars=dict(next=' https://checkout.google.com/buttons/buy.gif?merchant_id=digits_of_mysandbox_acctnumberw=117h=48style=whitevariant=textloc=en_US'))}} / form method=POST action= https://sandbox.google.com/checkout/api/checkout/v2/checkout/Merchant/mysandboxacctnumber input type=hidden name=cart value=stringnameofmycart input type=hidden name=signature value=REPLACE_WITH_SIGNATURE !-- Button code -- input type=image name=Google Checkout alt=Fast checkout through Google src= http://sandbox.google.com/checkout/buttons/checkout.gif?merchant_id=mysandboxdigitsacctnumberw=180h=46style=whitevariant=textloc=en_US height=46 width=180 /form I do not see the image of the button, but I see the text google fast checkout and when I click on that I got a 503 error. I've made sure that any long lines are continuous and not interrupted by spaces or carriage returns. I appreciate any help. Thank you, Margaret --
[web2py] select entries from database
I got a table for articles which contains an ids of users which commented on that particular image. now I like to read all the user ids of an particular aricle and display a list off all articles those users commented on. here is my first attempt: but its pretty aweful: db.define_table('Article', Field('Title'), Field('content','blob'), Field('Users','list:reference auth_user'), Field('Submitted','datetime',default=datetime.datetime.now(),writable=False,readable=False) ) model: def displaylist(): id=request.vars.id row=db(db.Articles.id==id).select() row=row[0] Userids=row.Users related=[] for i in Userids: related.append(db().select(db.Articles.User,i)) return dict(originalArticle=row,related=related) view: {{for i in related:}} {{#=some funky select}} {{pass}} --
[web2py] Re: Web2py. for a minimalist app, it feels bloated. Do it I need it?
http://web2py.com/books/default/chapter/29/14#Building-a-minimalist-web2py On Saturday, 8 September 2012 02:39:26 UTC-5, luckysmack wrote: I am somewhat new to python, and * shock * have an idea for a simple app I want to build. To start the app will be relatively light weight, but if it works out in my grand scheme could be far more complex.but the core will be fairly simple. something an experienced python dev could probably whip up in bottle in a few days. The core will a simply be an advanced rest based api. The other half dozen or so apps will all be built of this core. The either apps will likely be built as a cms like system to manage each other. And as different as a POS in store program. So as many cool things as I thing web2py has, do you guys think its the right system? I know w2p can do great APIs easily. But for that simple aspect, I don't need a milti-application admin interface, or a code editor, and I may not even use DAL. (For my project I may actually use something like neo4j/orientdb/titan. Not sure yet. Might use mongodb as instead). So for that simple part, all the other stuff seems a little bloated to me. Stuff that I won't need. Sure as a whole, all the apps will be built into somewhat of a cms (which I would like to build anyways), for that I'm not sure I would need the web2py admin part. As a cms I would probably have my own interface, even for the admins. How or would web2py admin ui fit in. I know you guys are biased towards web2py, but does it sound like it would be a right fit? Or would it be too complex? In comparison, I feel django is too bloated as well since I would be doing a similar thing, except it would be done quite a bit differently. The core of how it works doesn't seem to fit my ideas. If I don't use web2py, the next best things I see as a starting point are pyramid, or bottle/flask or even wheezy looks pretty cool. What do you guys think? The core great api would be the crux of the other apps. This core is what talks to the db. And each if the apps with build on it. The rest part will be made so they can all communicate with each other based on the URL. The either individual apps, were they to be on their own, I can totally see as a web2py app. So I'm curious how this idea as a whole, would fit into web2py. If it can. Since there are a handful of web2py featured I won't even use. I don't need them to be auto imported if I'm not using them (since I can't see what's being imported). So in a way it feels like bloat. A reason I don't like django. What do you guys think? Any input is greatly appreciated. --
[web2py] Re: Getting auth.wiki pages to display without login
I do not have that extra s. Are you saying it in the distribution? On Saturday, 8 September 2012 03:51:35 UTC-5, Andrew W wrote: The S comes from Welcome App's layout.html, line 80: div class=nav-collapses On Saturday, September 8, 2012 8:41:35 PM UTC+12, Andrew W wrote: Just Checking, were you logged in when you tried to open up the page ? Just to clarify, if I'm logged in it will take me directly to the page - as expected. I wanted to test having pages available to users who haven't logged in - which for this case would be most people - the public. I opened a new browser window, made sure I wasn't logged in to web2py, and pasted in the url of my new page. I get the login screen. I've just tried it again at home, creating just a simple page (OK, I did add an extra css file to the layout). Screen shot attached of page (when logged in), and screen when I paste in the url. Apart from that, auth.wiki is looking great. I'm experimenting with adding blocks with extra classes, allowing me to style them differently. Can I specify classes to other elements, or is it just blockquotes ? P.S. I'm getting a small S in the menu bar (app created from Welcome with no changes to menu) - see screen shot Thanks On Saturday, September 8, 2012 7:42:22 AM UTC+12, Massimo Di Pierro wrote: Strange. It should work even without url=True. You should be able to paste any URL in markmin and it should work. MARKMIN(text, url=True) simply allows you to user the shortcuts @/app/controller/function/args and they will be converted in http:///app/controller/function/args where app, controller and function are optional. You can do @///index for example. On Friday, 7 September 2012 14:15:31 UTC-5, Andrew W wrote: No I didn't. Only just found out about URL=True. Di I pass as a URL variable ? --
[web2py] Re: How do I incorporate git into my web2py workflow?
yes. On Saturday, 8 September 2012 03:54:55 UTC-5, Andrew W wrote: I've noticed that on Windows with tortoiseHG installed, that web2py doesn't recognise it as a Mercurial Installation.I guess I have to install Mercurial separately, although I'm using it through TortoiseHG ? On Saturday, September 8, 2012 10:46:13 AM UTC+12, Massimo Di Pierro wrote: One of the new features is that in admin you can use a git url to install a web2py directly from github. You can also push an app to github. All of this requires python-git. We are working on adding better git/hg features. On Friday, 7 September 2012 17:24:42 UTC-5, Pystar wrote: I would like to know how coders here incorporate git or any other VCS into their coding workflow with web2py? Thanks --
[web2py] Re: select entries from database
Use belongs (http://web2py.com/books/default/chapter/29/06#belongs) db(db.Articles.User.belongs([make,user_ids,into,a,list])).select() On Saturday, September 8, 2012 9:48:43 PM UTC+8, BlueShadow wrote: I got a table for articles which contains an ids of users which commented on that particular image. now I like to read all the user ids of an particular aricle and display a list off all articles those users commented on. here is my first attempt: but its pretty aweful: db.define_table('Article', Field('Title'), Field('content','blob'), Field('Users','list:reference auth_user'), Field('Submitted','datetime',default=datetime.datetime.now(),writable=False,readable=False) ) model: def displaylist(): id=request.vars.id row=db(db.Articles.id==id).select() row=row[0] Userids=row.Users related=[] for i in Userids: related.append(db().select(db.Articles.User,i)) return dict(originalArticle=row,related=related) view: {{for i in related:}} {{#=some funky select}} {{pass}} --
[web2py] Re: Object Row. Error in 2.0.8 not in 2.0.0
Short answer: if you cache the select, subqueries are missing. So you have to replace email = row.emails.select().first() with email = db(db.emails.studio==row.id).select().first() This is probably the only change of behavior and it is due to the need of speedup. before cache was caching value but not the full object. We achieved a 100x speedup by caching the final rows object. The problem is that subselects, update_record and delete_record are methods of the rows and they are not serializable, therefore they are missing when the rows are cached. Massimo On Saturday, 8 September 2012 08:34:46 UTC-5, Jose wrote: Hi all In Version 2.0.0 (2012-06-04 18:49:33) dev works well Model: tb_studio = db.define_table('studio', Field('name', label=T('Name')), #... format='%(name)s', migrate=MIGRATE ) tb_emails = db.define_table('emails', Field('studio', tb_studio, readable=False, writable=False, default=1), Field('email', label=T('Email')), migrate=MIGRATE ) Controller def bg_studio(): row = db(tb_studio.id==1).select(cache=(cache.ram, 60)).first() email = row.emails.select().first() return dict(row=row, email=email) In Version 2.0.8 (2012-09-07 09:38:35) stable, error occurs: File /usr/home/jose/web2py/applications/dm/controllers/default.py http://127.0.0.1:8000/admin/default/edit/dm/controllers/default.py, line 45, in bg_studio email = row.emails.select().first() AttributeError: 'Row' object has no attribute 'emails' Jose --
[web2py] Re: Routing a .json request
works for me. Do you have a views/generic.json? If you do did you enable it? response.generic_patterns = ['/myapp/dashboard/call_stats.json'] On Saturday, 8 September 2012 03:59:47 UTC-5, Daniel Gonzalez wrote: Hi, I am trying to access an action returning json data. According to Example 12 here: http://www.web2py.com/examples/default/examples, all actions requested with .json and returning a dict are automatically converted to json. But this is not working for me, maybe because routing is interfering. I am using a router, like this: routes_in = ( ('/call_stats.json', '/myapp/dashboard/call_stats.json'), ) My client is calling call_stats.json, but I just get this response: invalid view (dashboard/call_stats.json) I have tried several combinations of router settings (with and without .json) This is my action, in controller dashboard.py: def call_stats(): return CallStats().get_stats() Which is returning a dict. How can I tell web2py that that action needs to be served as json? Thanks Daniel --
[web2py] Re: Object Row. Error in 2.0.8 not in 2.0.0
Does this break backward compatibility? If so, should we make caching the full Rows object an option (maybe just via the new cacheable argument)? Anthony On Saturday, September 8, 2012 10:06:56 AM UTC-4, Massimo Di Pierro wrote: Short answer: if you cache the select, subqueries are missing. So you have to replace email = row.emails.select().first() with email = db(db.emails.studio==row.id).select().first() This is probably the only change of behavior and it is due to the need of speedup. before cache was caching value but not the full object. We achieved a 100x speedup by caching the final rows object. The problem is that subselects, update_record and delete_record are methods of the rows and they are not serializable, therefore they are missing when the rows are cached. Massimo On Saturday, 8 September 2012 08:34:46 UTC-5, Jose wrote: Hi all In Version 2.0.0 (2012-06-04 18:49:33) dev works well Model: tb_studio = db.define_table('studio', Field('name', label=T('Name')), #... format='%(name)s', migrate=MIGRATE ) tb_emails = db.define_table('emails', Field('studio', tb_studio, readable=False, writable=False, default=1), Field('email', label=T('Email')), migrate=MIGRATE ) Controller def bg_studio(): row = db(tb_studio.id==1).select(cache=(cache.ram, 60)).first() email = row.emails.select().first() return dict(row=row, email=email) In Version 2.0.8 (2012-09-07 09:38:35) stable, error occurs: File /usr/home/jose/web2py/applications/dm/controllers/default.py http://127.0.0.1:8000/admin/default/edit/dm/controllers/default.py, line 45, in bg_studio email = row.emails.select().first() AttributeError: 'Row' object has no attribute 'emails' Jose --
[web2py] Re: modified_by and modified_on not updating
I am trying to reproduce the problem but I cannot. Are you running 2.0.8? On Saturday, 8 September 2012 07:34:19 UTC-5, Joel Carrier wrote: I want to maintain an audit history of all my objects. So near the beginning of my model definition I have db._common_fields.append(auth.signature) and at the very end I have auth.enable_record_versioning(db) The problem I am having is that when I pull up all the records representing the history of an object, the modified_by and modified_on fields do not reflect the time and user that performed the change. In fact, they appear to be stuck on whoever was logged in when I last restart the web2py server and the time at which I restarted it. (Maybe it's the first person to perform an edit and the time they do it at since last restart.) Anyway, is there something obvious I am missing here? --
[web2py] Re: Can I insert a template into a form?
If you are building a custom form in the view, then yes, you should be able to do an include in the middle of it. If you just have the SQLFORM object and want something inserted when it is serialized in the view, it's trickier but probably doable (need to call response.render() and insert the result via server-side DOM). Can you show more details? Anthony On Saturday, September 8, 2012 7:01:27 AM UTC-4, lyn2py wrote: I have a SQLFORM with many fields. I want to insert a html file (like {{include abc.html}} in views) into the middle of the form. Can I do that? --
[web2py] What is the plan for the replacement of plugin_wiki with auth.wiki ?
--
[web2py] Re: What is the plan for the replacement of plugin_wiki with auth.wiki ?
Like you, I understand that plugin_wiki will eventually be deprecated, but you can still use it as it is and I am sure Massimo will accept patches and fix bugs etc. However, I can't imagine there would ever be any kind of 'conversion' program. The basic design of auth_wiki is better and integrated, and it is up to us to suggest how it can be improved. Let's put it this way, what would you like to do with auth_wiki that you currently cannot? Regards, D --
[web2py] Re: Getting auth.wiki pages to display without login
Just a thought, but doesn't the wiki page have an is_public field? If so, did you tick it? On Saturday, September 8, 2012 9:41:35 AM UTC+1, Andrew W wrote: Just Checking, were you logged in when you tried to open up the page ? Just to clarify, if I'm logged in it will take me directly to the page - as expected. I wanted to test having pages available to users who haven't logged in - which for this case would be most people - the public. I opened a new browser window, made sure I wasn't logged in to web2py, and pasted in the url of my new page. I get the login screen. I've just tried it again at home, creating just a simple page (OK, I did add an extra css file to the layout). Screen shot attached of page (when logged in), and screen when I paste in the url. Apart from that, auth.wiki is looking great. I'm experimenting with adding blocks with extra classes, allowing me to style them differently. Can I specify classes to other elements, or is it just blockquotes ? P.S. I'm getting a small S in the menu bar (app created from Welcome with no changes to menu) - see screen shot Thanks On Saturday, September 8, 2012 7:42:22 AM UTC+12, Massimo Di Pierro wrote: Strange. It should work even without url=True. You should be able to paste any URL in markmin and it should work. MARKMIN(text, url=True) simply allows you to user the shortcuts @/app/controller/function/args and they will be converted in http:///app/controller/function/args where app, controller and function are optional. You can do @///index for example. On Friday, 7 September 2012 14:15:31 UTC-5, Andrew W wrote: No I didn't. Only just found out about URL=True. Di I pass as a URL variable ? --
[web2py] Re: Can I insert a template into a form?
Thanks Anthony for stepping up. I have a views file, it has quite a chunk of html in it. If I could put it in the controller, I would, but it's quite hefty. I have about 15 fields, displayed via SQLFORM, just a simple form = SQLFORM(db.table) I want to insert a {{include html_file}} in the middle, and I've tried form[0].insert(7,'{{include template.html}}') but of course it didn't work out (it just printed the string in the correct place). I have two choices from what I can tell, 1 - to manually code each field in views 2 - find a way to insert the html template file (hence my question here) Please let me know if it would be worth the effort (as I can tell from your reply, it may get messy), or I should just hand code the fields. Or perhaps, is there a way to unload the fields manually, like for field in form: print field #I can find some way to do this 7 times,use the include,then unload the rest of the fields Thanks! On Saturday, September 8, 2012 10:26:37 PM UTC+8, Anthony wrote: If you are building a custom form in the view, then yes, you should be able to do an include in the middle of it. If you just have the SQLFORM object and want something inserted when it is serialized in the view, it's trickier but probably doable (need to call response.render() and insert the result via server-side DOM). Can you show more details? Anthony On Saturday, September 8, 2012 7:01:27 AM UTC-4, lyn2py wrote: I have a SQLFORM with many fields. I want to insert a html file (like {{include abc.html}} in views) into the middle of the form. Can I do that? --
[web2py] Re: Object Row. Error in 2.0.8 not in 2.0.0
What do other people think? We can make the new behavior optional and only ckickin when both cache!=None and cacheable=True. Massimo On Saturday, 8 September 2012 09:20:24 UTC-5, Anthony wrote: Does this break backward compatibility? If so, should we make caching the full Rows object an option (maybe just via the new cacheable argument)? Anthony On Saturday, September 8, 2012 10:06:56 AM UTC-4, Massimo Di Pierro wrote: Short answer: if you cache the select, subqueries are missing. So you have to replace email = row.emails.select().first() with email = db(db.emails.studio==row.id).select().first() This is probably the only change of behavior and it is due to the need of speedup. before cache was caching value but not the full object. We achieved a 100x speedup by caching the final rows object. The problem is that subselects, update_record and delete_record are methods of the rows and they are not serializable, therefore they are missing when the rows are cached. Massimo On Saturday, 8 September 2012 08:34:46 UTC-5, Jose wrote: Hi all In Version 2.0.0 (2012-06-04 18:49:33) dev works well Model: tb_studio = db.define_table('studio', Field('name', label=T('Name')), #... format='%(name)s', migrate=MIGRATE ) tb_emails = db.define_table('emails', Field('studio', tb_studio, readable=False, writable=False, default=1), Field('email', label=T('Email')), migrate=MIGRATE ) Controller def bg_studio(): row = db(tb_studio.id==1).select(cache=(cache.ram, 60)).first() email = row.emails.select().first() return dict(row=row, email=email) In Version 2.0.8 (2012-09-07 09:38:35) stable, error occurs: File /usr/home/jose/web2py/applications/dm/controllers/default.py http://127.0.0.1:8000/admin/default/edit/dm/controllers/default.py, line 45, in bg_studio email = row.emails.select().first() AttributeError: 'Row' object has no attribute 'emails' Jose --
[web2py] Re: modified_by and modified_on not updating
At first I thought it was related to running on a windows machine using the development server. Then I deployed to a linux machine using the setup-web2py-ubuntu.sh script Yes, the version is: Version 2.0.8 (2012-09-07 03:47:51) stable db.py: # -*- coding: utf-8 -*- if 0: from gluon.sql import * from gluon.validators import * from gluon import T from gluon import current db = SQLDB('mysql://'+settings.sql_user+':'+settings.sql_password+'@'+ settings.db_host+'/'+settings.db_name,migrate=settings.migrate,pool_size=10) response.generic_patterns = ['*'] #if request.is_local else [] current.db = db current.T = T from gluon.tools import Auth, Crud, Service, PluginManager, prettydate auth = Auth(db, hmac_key=settings.hmac_key, salt=True) crud, service, plugins = Crud(db), Service(), PluginManager() current.auth = auth auth.settings.registration_requires_verification = True auth.settings.registration_requires_approval = False auth.settings.reset_password_requires_verification = True db._common_fields.append(auth.signature) db.define_table('auth_user', Field('id','id'), Field('first_name', type='string', label=T('First Name')), Field('last_name', type='string', label=T('Last Name')), Field('email', type='string', label=T('Email')), Field('password', type='password', readable=False, label=T('Password')), Field('date_of_birth', type='date', label=T('Date of Birth')), Field('birth_country','integer'), Field('birth_city'), Field('registration_key',default='', writable=False,readable=False), Field('reset_password_key',default='', writable=False,readable=False), Field('registration_id',default='', writable=False,readable=False), format='[%(id)s] %(first_name)s %(last_name)s', ) db.auth_user.first_name.requires = IS_UPPER() db.auth_user.last_name.requires = IS_UPPER() db.auth_user.password.requires = CRYPT(key=auth.settings.hmac_key) db.auth_user.registration_id.requires = IS_NOT_IN_DB(db, db.auth_user. registration_id) db.auth_user.email.requires = ( IS_EMAIL(error_message=auth.messages.invalid_email), IS_NOT_IN_DB(db, db.auth_user.email), IS_UPPER() ) and in models directory i also have a z.py auth.enable_record_versioning(db) Do I have to update my entities using SQLForms only? Or is it suppose to work with any .update_record()? Thanks for your help! On Saturday, September 8, 2012 10:23:05 AM UTC-4, Massimo Di Pierro wrote: I am trying to reproduce the problem but I cannot. Are you running 2.0.8? On Saturday, 8 September 2012 07:34:19 UTC-5, Joel Carrier wrote: I want to maintain an audit history of all my objects. So near the beginning of my model definition I have db._common_fields.append(auth.signature) and at the very end I have auth.enable_record_versioning(db) The problem I am having is that when I pull up all the records representing the history of an object, the modified_by and modified_on fields do not reflect the time and user that performed the change. In fact, they appear to be stuck on whoever was logged in when I last restart the web2py server and the time at which I restarted it. (Maybe it's the first person to perform an edit and the time they do it at since last restart.) Anyway, is there something obvious I am missing here? --
[web2py] Re: modified_by and modified_on not updating
Supposed to work any update_record but let me give it a try. On Saturday, 8 September 2012 12:39:20 UTC-5, Joel Carrier wrote: At first I thought it was related to running on a windows machine using the development server. Then I deployed to a linux machine using the setup-web2py-ubuntu.sh script Yes, the version is: Version 2.0.8 (2012-09-07 03:47:51) stable db.py: # -*- coding: utf-8 -*- if 0: from gluon.sql import * from gluon.validators import * from gluon import T from gluon import current db = SQLDB('mysql://'+settings.sql_user+':'+settings.sql_password+'@'+ settings.db_host+'/'+settings.db_name,migrate=settings.migrate,pool_size= 10) response.generic_patterns = ['*'] #if request.is_local else [] current.db = db current.T = T from gluon.tools import Auth, Crud, Service, PluginManager, prettydate auth = Auth(db, hmac_key=settings.hmac_key, salt=True) crud, service, plugins = Crud(db), Service(), PluginManager() current.auth = auth auth.settings.registration_requires_verification = True auth.settings.registration_requires_approval = False auth.settings.reset_password_requires_verification = True db._common_fields.append(auth.signature) db.define_table('auth_user', Field('id','id'), Field('first_name', type='string', label=T('First Name')), Field('last_name', type='string', label=T('Last Name')), Field('email', type='string', label=T('Email')), Field('password', type='password', readable=False, label=T('Password')), Field('date_of_birth', type='date', label=T('Date of Birth')), Field('birth_country','integer'), Field('birth_city'), Field('registration_key',default='', writable=False,readable=False), Field('reset_password_key',default='', writable=False,readable=False), Field('registration_id',default='', writable=False,readable=False), format='[%(id)s] %(first_name)s %(last_name)s', ) db.auth_user.first_name.requires = IS_UPPER() db.auth_user.last_name.requires = IS_UPPER() db.auth_user.password.requires = CRYPT(key=auth.settings.hmac_key) db.auth_user.registration_id.requires = IS_NOT_IN_DB(db, db.auth_user. registration_id) db.auth_user.email.requires = ( IS_EMAIL(error_message=auth.messages.invalid_email), IS_NOT_IN_DB(db, db.auth_user.email), IS_UPPER() ) and in models directory i also have a z.py auth.enable_record_versioning(db) Do I have to update my entities using SQLForms only? Or is it suppose to work with any .update_record()? Thanks for your help! On Saturday, September 8, 2012 10:23:05 AM UTC-4, Massimo Di Pierro wrote: I am trying to reproduce the problem but I cannot. Are you running 2.0.8? On Saturday, 8 September 2012 07:34:19 UTC-5, Joel Carrier wrote: I want to maintain an audit history of all my objects. So near the beginning of my model definition I have db._common_fields.append(auth.signature) and at the very end I have auth.enable_record_versioning(db) The problem I am having is that when I pull up all the records representing the history of an object, the modified_by and modified_on fields do not reflect the time and user that performed the change. In fact, they appear to be stuck on whoever was logged in when I last restart the web2py server and the time at which I restarted it. (Maybe it's the first person to perform an edit and the time they do it at since last restart.) Anyway, is there something obvious I am missing here? --
[web2py] Re: modified_by and modified_on not updating
works for me db= DAL() from gluon.tools import Auth auth = Auth(db) auth.define_tables() db._common_fields.append(auth.signature) db.define_table('thing', Field('name'), Field('name2', writable=False, compute=lambda r: r.name+'xxx')) auth.enable_record_versioning(db) print db.thing(2).modified_on 2012-09-08 09:22:28 db.thing(2).update_record(name='test4') print db.thing(2).modified_on 2012-09-08 12:49:01 Massimo On Saturday, 8 September 2012 12:48:14 UTC-5, Massimo Di Pierro wrote: Supposed to work any update_record but let me give it a try. On Saturday, 8 September 2012 12:39:20 UTC-5, Joel Carrier wrote: At first I thought it was related to running on a windows machine using the development server. Then I deployed to a linux machine using the setup-web2py-ubuntu.sh script Yes, the version is: Version 2.0.8 (2012-09-07 03:47:51) stable db.py: # -*- coding: utf-8 -*- if 0: from gluon.sql import * from gluon.validators import * from gluon import T from gluon import current db = SQLDB('mysql://'+settings.sql_user+':'+settings.sql_password+'@'+ settings.db_host+'/'+settings.db_name,migrate=settings.migrate,pool_size= 10) response.generic_patterns = ['*'] #if request.is_local else [] current.db = db current.T = T from gluon.tools import Auth, Crud, Service, PluginManager, prettydate auth = Auth(db, hmac_key=settings.hmac_key, salt=True) crud, service, plugins = Crud(db), Service(), PluginManager() current.auth = auth auth.settings.registration_requires_verification = True auth.settings.registration_requires_approval = False auth.settings.reset_password_requires_verification = True db._common_fields.append(auth.signature) db.define_table('auth_user', Field('id','id'), Field('first_name', type='string', label=T('First Name')), Field('last_name', type='string', label=T('Last Name')), Field('email', type='string', label=T('Email')), Field('password', type='password', readable=False, label=T('Password')), Field('date_of_birth', type='date', label=T('Date of Birth')), Field('birth_country','integer'), Field('birth_city'), Field('registration_key',default='', writable=False,readable=False), Field('reset_password_key',default='', writable=False,readable=False), Field('registration_id',default='', writable=False,readable=False), format='[%(id)s] %(first_name)s %(last_name)s', ) db.auth_user.first_name.requires = IS_UPPER() db.auth_user.last_name.requires = IS_UPPER() db.auth_user.password.requires = CRYPT(key=auth.settings.hmac_key) db.auth_user.registration_id.requires = IS_NOT_IN_DB(db, db.auth_user. registration_id) db.auth_user.email.requires = ( IS_EMAIL(error_message=auth.messages.invalid_email), IS_NOT_IN_DB(db, db.auth_user.email), IS_UPPER() ) and in models directory i also have a z.py auth.enable_record_versioning(db) Do I have to update my entities using SQLForms only? Or is it suppose to work with any .update_record()? Thanks for your help! On Saturday, September 8, 2012 10:23:05 AM UTC-4, Massimo Di Pierro wrote: I am trying to reproduce the problem but I cannot. Are you running 2.0.8? On Saturday, 8 September 2012 07:34:19 UTC-5, Joel Carrier wrote: I want to maintain an audit history of all my objects. So near the beginning of my model definition I have db._common_fields.append(auth.signature) and at the very end I have auth.enable_record_versioning(db) The problem I am having is that when I pull up all the records representing the history of an object, the modified_by and modified_on fields do not reflect the time and user that performed the change. In fact, they appear to be stuck on whoever was logged in when I last restart the web2py server and the time at which I restarted it. (Maybe it's the first person to perform an edit and the time they do it at since last restart.) Anyway, is there something obvious I am missing here? --
[web2py] Re: modified_by and modified_on not updating
raising a little hand here... 2.0.8 and salt=True in auth are incompatible. Someone here is: - posting the wrong code - use the wrong web2py version - telling lies :P @Joel: jokes apart, can you please verify ? On Saturday, September 8, 2012 7:48:14 PM UTC+2, Massimo Di Pierro wrote: Supposed to work any update_record but let me give it a try. On Saturday, 8 September 2012 12:39:20 UTC-5, Joel Carrier wrote: At first I thought it was related to running on a windows machine using the development server. Then I deployed to a linux machine using the setup-web2py-ubuntu.sh script Yes, the version is: Version 2.0.8 (2012-09-07 03:47:51) stable db.py: # -*- coding: utf-8 -*- if 0: from gluon.sql import * from gluon.validators import * from gluon import T from gluon import current db = SQLDB('mysql://'+settings.sql_user+':'+settings.sql_password+'@'+ settings.db_host+'/'+settings.db_name,migrate=settings.migrate,pool_size= 10) response.generic_patterns = ['*'] #if request.is_local else [] current.db = db current.T = T from gluon.tools import Auth, Crud, Service, PluginManager, prettydate auth = Auth(db, hmac_key=settings.hmac_key, salt=True) crud, service, plugins = Crud(db), Service(), PluginManager() current.auth = auth auth.settings.registration_requires_verification = True auth.settings.registration_requires_approval = False auth.settings.reset_password_requires_verification = True db._common_fields.append(auth.signature) db.define_table('auth_user', Field('id','id'), Field('first_name', type='string', label=T('First Name')), Field('last_name', type='string', label=T('Last Name')), Field('email', type='string', label=T('Email')), Field('password', type='password', readable=False, label=T('Password')), Field('date_of_birth', type='date', label=T('Date of Birth')), Field('birth_country','integer'), Field('birth_city'), Field('registration_key',default='', writable=False,readable=False), Field('reset_password_key',default='', writable=False,readable=False), Field('registration_id',default='', writable=False,readable=False), format='[%(id)s] %(first_name)s %(last_name)s', ) db.auth_user.first_name.requires = IS_UPPER() db.auth_user.last_name.requires = IS_UPPER() db.auth_user.password.requires = CRYPT(key=auth.settings.hmac_key) db.auth_user.registration_id.requires = IS_NOT_IN_DB(db, db.auth_user. registration_id) db.auth_user.email.requires = ( IS_EMAIL(error_message=auth.messages.invalid_email), IS_NOT_IN_DB(db, db.auth_user.email), IS_UPPER() ) and in models directory i also have a z.py auth.enable_record_versioning(db) Do I have to update my entities using SQLForms only? Or is it suppose to work with any .update_record()? Thanks for your help! On Saturday, September 8, 2012 10:23:05 AM UTC-4, Massimo Di Pierro wrote: I am trying to reproduce the problem but I cannot. Are you running 2.0.8? On Saturday, 8 September 2012 07:34:19 UTC-5, Joel Carrier wrote: I want to maintain an audit history of all my objects. So near the beginning of my model definition I have db._common_fields.append(auth.signature) and at the very end I have auth.enable_record_versioning(db) The problem I am having is that when I pull up all the records representing the history of an object, the modified_by and modified_on fields do not reflect the time and user that performed the change. In fact, they appear to be stuck on whoever was logged in when I last restart the web2py server and the time at which I restarted it. (Maybe it's the first person to perform an edit and the time they do it at since last restart.) Anyway, is there something obvious I am missing here? --
[web2py] Re: modified_by and modified_on not updating
Hmmm... i never call auth.define_tables I guess because I wanted to customize the auth_user table. And yet the following tables all get created: | auth_cas | | auth_cas_archive | | auth_event | | auth_event_archive | | auth_group | | auth_group_archive | | auth_membership | | auth_membership_archive | | auth_permission | | auth_permission_archive | | auth_user| | auth_user_archive Could that be why? On Saturday, September 8, 2012 1:51:24 PM UTC-4, Massimo Di Pierro wrote: works for me db= DAL() from gluon.tools import Auth auth = Auth(db) auth.define_tables() db._common_fields.append(auth.signature) db.define_table('thing', Field('name'), Field('name2', writable=False, compute=lambda r: r.name+'xxx')) auth.enable_record_versioning(db) print db.thing(2).modified_on 2012-09-08 09:22:28 db.thing(2).update_record(name='test4') print db.thing(2).modified_on 2012-09-08 12:49:01 Massimo On Saturday, 8 September 2012 12:48:14 UTC-5, Massimo Di Pierro wrote: Supposed to work any update_record but let me give it a try. On Saturday, 8 September 2012 12:39:20 UTC-5, Joel Carrier wrote: At first I thought it was related to running on a windows machine using the development server. Then I deployed to a linux machine using the setup-web2py-ubuntu.sh script Yes, the version is: Version 2.0.8 (2012-09-07 03:47:51) stable db.py: # -*- coding: utf-8 -*- if 0: from gluon.sql import * from gluon.validators import * from gluon import T from gluon import current db = SQLDB('mysql://'+settings.sql_user+':'+settings.sql_password+'@'+ settings.db_host+'/'+settings.db_name,migrate=settings.migrate,pool_size =10) response.generic_patterns = ['*'] #if request.is_local else [] current.db = db current.T = T from gluon.tools import Auth, Crud, Service, PluginManager, prettydate auth = Auth(db, hmac_key=settings.hmac_key, salt=True) crud, service, plugins = Crud(db), Service(), PluginManager() current.auth = auth auth.settings.registration_requires_verification = True auth.settings.registration_requires_approval = False auth.settings.reset_password_requires_verification = True db._common_fields.append(auth.signature) db.define_table('auth_user', Field('id','id'), Field('first_name', type='string', label=T('First Name')), Field('last_name', type='string', label=T('Last Name')), Field('email', type='string', label=T('Email')), Field('password', type='password', readable=False, label=T('Password')), Field('date_of_birth', type='date', label=T('Date of Birth')), Field('birth_country','integer'), Field('birth_city'), Field('registration_key',default='', writable=False,readable=False), Field('reset_password_key',default='', writable=False,readable=False), Field('registration_id',default='', writable=False,readable=False), format='[%(id)s] %(first_name)s %(last_name)s', ) db.auth_user.first_name.requires = IS_UPPER() db.auth_user.last_name.requires = IS_UPPER() db.auth_user.password.requires = CRYPT(key=auth.settings.hmac_key) db.auth_user.registration_id.requires = IS_NOT_IN_DB(db, db.auth_user. registration_id) db.auth_user.email.requires = ( IS_EMAIL(error_message=auth.messages.invalid_email), IS_NOT_IN_DB(db, db.auth_user.email), IS_UPPER() ) and in models directory i also have a z.py auth.enable_record_versioning(db) Do I have to update my entities using SQLForms only? Or is it suppose to work with any .update_record()? Thanks for your help! On Saturday, September 8, 2012 10:23:05 AM UTC-4, Massimo Di Pierro wrote: I am trying to reproduce the problem but I cannot. Are you running 2.0.8? On Saturday, 8 September 2012 07:34:19 UTC-5, Joel Carrier wrote: I want to maintain an audit history of all my objects. So near the beginning of my model definition I have db._common_fields.append(auth.signature) and at the very end I have auth.enable_record_versioning(db) The problem I am having is that when I pull up all the records representing the history of an object, the modified_by and modified_on fields do not reflect the time and user that performed the change. In fact, they appear to be stuck on whoever was logged in when I last restart the web2py server and the time at which I restarted it. (Maybe it's the first person to perform an edit and the time they do it at since last restart.) Anyway, is there something obvious I am missing here? --
Re: [web2py] Re: web2py book on github
Hi, am currently running version 2.0.7. Also, my internet access is not always up. On Sat, Sep 8, 2012 at 1:46 PM, Niphlod niph...@gmail.com wrote: are you on the latest web2py version ? BTW: the book is still online at web2py.com/book if you want to read it: it's not required to download the app to read it ^_^ On Saturday, September 8, 2012 2:16:44 PM UTC+2, ikdme wrote: I'm not getting any errors. The images are not displaying. Every other is working well. I miss the line numbers. On Sat, Sep 8, 2012 at 10:30 AM, Alec Taylor alec.t...@gmail.com wrote: The documentation is starting to look much better :) Maybe the chapters have gotten a little large though and should each be separated into Basic use and Advanced use... Also the new code boxes are much nicer than before, but still doesn't have python syntax-highlighting. Can we get this also? On Sat, Sep 8, 2012 at 6:57 PM, Andrew W awill...@gmail.com wrote: I use TortoiseHG on Windows which I find quite simple to use, although sometimes I have to go back to the command line. I recommend it. In any case, the tar.gz should work. Are you getting an error ? On Saturday, September 8, 2012 7:47:38 AM UTC+12, ikdme wrote: Hello, Please am a windows user and I don't know how to use mercurial or git so i downloaded the book in 'tar.gz' format. I managed to install the book but the images are not displaying (streaming). I don't know why. Please could someone help me with what to do. Thanks On Tue, Sep 4, 2012 at 8:54 PM, Niphlod nip...@gmail.com wrote: sections with code are h1,h2,h3,h4,h5,h6 contained in a div with class article containing a code tag. assuming you want them styled as h1,h2,h3,h4,h5,h6 with no changes in style in respect of other h1,h2,h3,h4,h5,h6 the simplest thing is .article h1 code, .article h2 code, .article h3 code, .article h4 code, .article h5 code, .article h6 code { display: block; color : #33; border: 0px; font-size: inherit; background: transparent; } On Monday, September 3, 2012 11:37:12 PM UTC+2, Massimo Di Pierro wrote: The book uses the default web2py style with bootstrap. The section titles, if they contain code are not rendered properly. Could use some help improving the css. massimo On Saturday, 1 September 2012 12:00:49 UTC-5, Massimo Di Pierro wrote: The web2py book app has been rewritten http://www.web2py.com/book and the source of the app and the book itself is now on github https://github.com/mdipierro/**web2py-book/tree/master/** sources https://github.com/mdipierro/web2py-book/tree/master/sources Hopefully this will make it easier to keep it updated. You can just send me patches. You can also try run it yourself and see how it looks. It is no more db based. it is file based. The syntax is markmin as documented in the bok itself. Massimo -- -- -- -- --
[web2py] Re: modified_by and modified_on not updating
Ha, as soon as I pasted this snippet I realized that and was looking to modify. When developing I was working off the trunk and having this problem. For some reason I thought maybe after deploying to linux and using a stable version the problem would go away. Then I deployed to a linux machine using version 2.0.8. I hit the salt problem and removed it. Other than that, the code is the same, I promise! :) And my problem persisted. On Saturday, September 8, 2012 1:54:37 PM UTC-4, Niphlod wrote: raising a little hand here... 2.0.8 and salt=True in auth are incompatible. Someone here is: - posting the wrong code - use the wrong web2py version - telling lies :P @Joel: jokes apart, can you please verify ? On Saturday, September 8, 2012 7:48:14 PM UTC+2, Massimo Di Pierro wrote: Supposed to work any update_record but let me give it a try. On Saturday, 8 September 2012 12:39:20 UTC-5, Joel Carrier wrote: At first I thought it was related to running on a windows machine using the development server. Then I deployed to a linux machine using the setup-web2py-ubuntu.sh script Yes, the version is: Version 2.0.8 (2012-09-07 03:47:51) stable db.py: # -*- coding: utf-8 -*- if 0: from gluon.sql import * from gluon.validators import * from gluon import T from gluon import current db = SQLDB('mysql://'+settings.sql_user+':'+settings.sql_password+'@'+ settings.db_host+'/'+settings.db_name,migrate=settings.migrate,pool_size =10) response.generic_patterns = ['*'] #if request.is_local else [] current.db = db current.T = T from gluon.tools import Auth, Crud, Service, PluginManager, prettydate auth = Auth(db, hmac_key=settings.hmac_key, salt=True) crud, service, plugins = Crud(db), Service(), PluginManager() current.auth = auth auth.settings.registration_requires_verification = True auth.settings.registration_requires_approval = False auth.settings.reset_password_requires_verification = True db._common_fields.append(auth.signature) db.define_table('auth_user', Field('id','id'), Field('first_name', type='string', label=T('First Name')), Field('last_name', type='string', label=T('Last Name')), Field('email', type='string', label=T('Email')), Field('password', type='password', readable=False, label=T('Password')), Field('date_of_birth', type='date', label=T('Date of Birth')), Field('birth_country','integer'), Field('birth_city'), Field('registration_key',default='', writable=False,readable=False), Field('reset_password_key',default='', writable=False,readable=False), Field('registration_id',default='', writable=False,readable=False), format='[%(id)s] %(first_name)s %(last_name)s', ) db.auth_user.first_name.requires = IS_UPPER() db.auth_user.last_name.requires = IS_UPPER() db.auth_user.password.requires = CRYPT(key=auth.settings.hmac_key) db.auth_user.registration_id.requires = IS_NOT_IN_DB(db, db.auth_user. registration_id) db.auth_user.email.requires = ( IS_EMAIL(error_message=auth.messages.invalid_email), IS_NOT_IN_DB(db, db.auth_user.email), IS_UPPER() ) and in models directory i also have a z.py auth.enable_record_versioning(db) Do I have to update my entities using SQLForms only? Or is it suppose to work with any .update_record()? Thanks for your help! On Saturday, September 8, 2012 10:23:05 AM UTC-4, Massimo Di Pierro wrote: I am trying to reproduce the problem but I cannot. Are you running 2.0.8? On Saturday, 8 September 2012 07:34:19 UTC-5, Joel Carrier wrote: I want to maintain an audit history of all my objects. So near the beginning of my model definition I have db._common_fields.append(auth.signature) and at the very end I have auth.enable_record_versioning(db) The problem I am having is that when I pull up all the records representing the history of an object, the modified_by and modified_on fields do not reflect the time and user that performed the change. In fact, they appear to be stuck on whoever was logged in when I last restart the web2py server and the time at which I restarted it. (Maybe it's the first person to perform an edit and the time they do it at since last restart.) Anyway, is there something obvious I am missing here? --
[web2py] Re: modified_by and modified_on not updating
Good eye Niphlod! On Saturday, September 8, 2012 1:59:11 PM UTC-4, Joel Carrier wrote: Ha, as soon as I pasted this snippet I realized that and was looking to modify. When developing I was working off the trunk and having this problem. For some reason I thought maybe after deploying to linux and using a stable version the problem would go away. Then I deployed to a linux machine using version 2.0.8. I hit the salt problem and removed it. Other than that, the code is the same, I promise! :) And my problem persisted. On Saturday, September 8, 2012 1:54:37 PM UTC-4, Niphlod wrote: raising a little hand here... 2.0.8 and salt=True in auth are incompatible. Someone here is: - posting the wrong code - use the wrong web2py version - telling lies :P @Joel: jokes apart, can you please verify ? On Saturday, September 8, 2012 7:48:14 PM UTC+2, Massimo Di Pierro wrote: Supposed to work any update_record but let me give it a try. On Saturday, 8 September 2012 12:39:20 UTC-5, Joel Carrier wrote: At first I thought it was related to running on a windows machine using the development server. Then I deployed to a linux machine using the setup-web2py-ubuntu.sh script Yes, the version is: Version 2.0.8 (2012-09-07 03:47:51) stable db.py: # -*- coding: utf-8 -*- if 0: from gluon.sql import * from gluon.validators import * from gluon import T from gluon import current db = SQLDB('mysql://'+settings.sql_user+':'+settings.sql_password+'@'+ settings.db_host+'/'+settings.db_name,migrate=settings.migrate, pool_size=10) response.generic_patterns = ['*'] #if request.is_local else [] current.db = db current.T = T from gluon.tools import Auth, Crud, Service, PluginManager, prettydate auth = Auth(db, hmac_key=settings.hmac_key, salt=True) crud, service, plugins = Crud(db), Service(), PluginManager() current.auth = auth auth.settings.registration_requires_verification = True auth.settings.registration_requires_approval = False auth.settings.reset_password_requires_verification = True db._common_fields.append(auth.signature) db.define_table('auth_user', Field('id','id'), Field('first_name', type='string', label=T('First Name')), Field('last_name', type='string', label=T('Last Name')), Field('email', type='string', label=T('Email')), Field('password', type='password', readable=False, label=T('Password')), Field('date_of_birth', type='date', label=T('Date of Birth')), Field('birth_country','integer'), Field('birth_city'), Field('registration_key',default='', writable=False,readable=False), Field('reset_password_key',default='', writable=False,readable=False), Field('registration_id',default='', writable=False,readable=False), format='[%(id)s] %(first_name)s %(last_name)s', ) db.auth_user.first_name.requires = IS_UPPER() db.auth_user.last_name.requires = IS_UPPER() db.auth_user.password.requires = CRYPT(key=auth.settings.hmac_key) db.auth_user.registration_id.requires = IS_NOT_IN_DB(db, db.auth_user. registration_id) db.auth_user.email.requires = ( IS_EMAIL(error_message=auth.messages.invalid_email), IS_NOT_IN_DB(db, db.auth_user.email), IS_UPPER() ) and in models directory i also have a z.py auth.enable_record_versioning(db) Do I have to update my entities using SQLForms only? Or is it suppose to work with any .update_record()? Thanks for your help! On Saturday, September 8, 2012 10:23:05 AM UTC-4, Massimo Di Pierro wrote: I am trying to reproduce the problem but I cannot. Are you running 2.0.8? On Saturday, 8 September 2012 07:34:19 UTC-5, Joel Carrier wrote: I want to maintain an audit history of all my objects. So near the beginning of my model definition I have db._common_fields.append(auth.signature) and at the very end I have auth.enable_record_versioning(db) The problem I am having is that when I pull up all the records representing the history of an object, the modified_by and modified_on fields do not reflect the time and user that performed the change. In fact, they appear to be stuck on whoever was logged in when I last restart the web2py server and the time at which I restarted it. (Maybe it's the first person to perform an edit and the time they do it at since last restart.) Anyway, is there something obvious I am missing here? --
Re: [web2py] Re: Object Row. Error in 2.0.8 not in 2.0.0
I don't understand (ckickin?) It should be optional and it shouldn't default to current behavior as it breaks old apps. On Sat, Sep 8, 2012 at 7:22 PM, Massimo Di Pierro massimo.dipie...@gmail.com wrote: What do other people think? We can make the new behavior optional and only ckickin when both cache!=None and cacheable=True. Massimo On Saturday, 8 September 2012 09:20:24 UTC-5, Anthony wrote: Does this break backward compatibility? If so, should we make caching the full Rows object an option (maybe just via the new cacheable argument)? Anthony On Saturday, September 8, 2012 10:06:56 AM UTC-4, Massimo Di Pierro wrote: Short answer: if you cache the select, subqueries are missing. So you have to replace email = row.emails.select().first() with email = db(db.emails.studio==row.id).s**elect().first() This is probably the only change of behavior and it is due to the need of speedup. before cache was caching value but not the full object. We achieved a 100x speedup by caching the final rows object. The problem is that subselects, update_record and delete_record are methods of the rows and they are not serializable, therefore they are missing when the rows are cached. Massimo On Saturday, 8 September 2012 08:34:46 UTC-5, Jose wrote: Hi all In Version 2.0.0 (2012-06-04 18:49:33) dev works well Model: tb_studio = db.define_table('studio', Field('name', label=T('Name')), #... format='%(name)s', migrate=MIGRATE ) tb_emails = db.define_table('emails', Field('studio', tb_studio, readable=False, writable=False, default=1), Field('email', label=T('Email')), migrate=MIGRATE ) Controller def bg_studio(): row = db(tb_studio.id==1).select(**cache=(cache.ram, 60)).first() email = row.emails.select().first() return dict(row=row, email=email) In Version 2.0.8 (2012-09-07 09:38:35) stable, error occurs: File /usr/home/jose/web2py/**applications/dm/controllers/**default.py http://127.0.0.1:8000/admin/default/edit/dm/controllers/default.py, line 45, in bg_studio email = row.emails.select().first() AttributeError: 'Row' object has no attribute 'emails' Jose -- --
[web2py] Re: How do I incorporate git into my web2py workflow?
I actually meant having a git repository on your local development machine not pushing to github or something similar. How do you use git and web2py? On Friday, September 7, 2012 11:46:13 PM UTC+1, Massimo Di Pierro wrote: One of the new features is that in admin you can use a git url to install a web2py directly from github. You can also push an app to github. All of this requires python-git. We are working on adding better git/hg features. On Friday, 7 September 2012 17:24:42 UTC-5, Pystar wrote: I would like to know how coders here incorporate git or any other VCS into their coding workflow with web2py? Thanks --
[web2py] Re: Web2py. for a minimalist app, it feels bloated. Do it I need it?
Thanks, that is helpful. I'll have to try it out when I get to my computer. --
[web2py] Re: Object Row. Error in 2.0.8 not in 2.0.0
I'd say, when cacheable=True and cache!=None, then cache the entire Rows object (new behavior). However, if cacheable=False, then revert to the old caching behavior (which should be the default). Anthony On Saturday, September 8, 2012 1:22:32 PM UTC-4, Massimo Di Pierro wrote: What do other people think? We can make the new behavior optional and only ckickin when both cache!=None and cacheable=True. Massimo On Saturday, 8 September 2012 09:20:24 UTC-5, Anthony wrote: Does this break backward compatibility? If so, should we make caching the full Rows object an option (maybe just via the new cacheable argument)? Anthony On Saturday, September 8, 2012 10:06:56 AM UTC-4, Massimo Di Pierro wrote: Short answer: if you cache the select, subqueries are missing. So you have to replace email = row.emails.select().first() with email = db(db.emails.studio==row.id).select().first() This is probably the only change of behavior and it is due to the need of speedup. before cache was caching value but not the full object. We achieved a 100x speedup by caching the final rows object. The problem is that subselects, update_record and delete_record are methods of the rows and they are not serializable, therefore they are missing when the rows are cached. Massimo On Saturday, 8 September 2012 08:34:46 UTC-5, Jose wrote: Hi all In Version 2.0.0 (2012-06-04 18:49:33) dev works well Model: tb_studio = db.define_table('studio', Field('name', label=T('Name')), #... format='%(name)s', migrate=MIGRATE ) tb_emails = db.define_table('emails', Field('studio', tb_studio, readable=False, writable=False, default=1), Field('email', label=T('Email')), migrate=MIGRATE ) Controller def bg_studio(): row = db(tb_studio.id==1).select(cache=(cache.ram, 60)).first() email = row.emails.select().first() return dict(row=row, email=email) In Version 2.0.8 (2012-09-07 09:38:35) stable, error occurs: File /usr/home/jose/web2py/applications/dm/controllers/default.py http://127.0.0.1:8000/admin/default/edit/dm/controllers/default.py, line 45, in bg_studio email = row.emails.select().first() AttributeError: 'Row' object has no attribute 'emails' Jose --
[web2py] Re: What is the plan for the replacement of plugin_wiki with auth.wiki ?
Thanks, Villas I understand that i can use both. The first one will be deprecated, but it is documented. The second one has better design and integrated, but it is not documented. I prefer to wait for the second to be documented. Regards, Ashraf --
[web2py] Re: Can I insert a template into a form?
On Saturday, September 8, 2012 12:14:16 PM UTC-4, lyn2py wrote: Thanks Anthony for stepping up. I have a views file, it has quite a chunk of html in it. If I could put it in the controller, I would, but it's quite hefty. I have about 15 fields, displayed via SQLFORM, just a simple form = SQLFORM(db.table) I want to insert a {{include html_file}} in the middle, and I've tried form[0].insert(7,'{{include template.html}}') Try: form[0].insert(7, XML(response.render('path/to/template.html', dict(var1='something'),othervar ='something else'))) response.render() will render a template and return the HTML as a string. You should wrap the response in XML() so the text doesn't get escaped. The path to the template should be relative to the /views folder. The second argument can be a dict -- the items in the dict will be available as variables in the view environment (just like when a controller function returns a dict). You can also add additional keyword arguments, which will also get added to the view environment. Anthony --
[web2py] Re: What is the plan for the replacement of plugin_wiki with auth.wiki ?
Most of the functionality of plugin_wiki is in auth.wiki. Only comments and star ratings are missing. Everything else is done better in auth.wiki. yet we provide plugin_comments and plugin_ratings as separate which work with auth.wik() On Saturday, 8 September 2012 14:55:19 UTC-5, apps in tables wrote: Thanks, Villas I understand that i can use both. The first one will be deprecated, but it is documented. The second one has better design and integrated, but it is not documented. I prefer to wait for the second to be documented. Regards, Ashraf --
[web2py] Re: Web2py. for a minimalist app, it feels bloated. Do it I need it?
Let us know if everything works fine. I have not used the script in a while. On Saturday, 8 September 2012 14:46:46 UTC-5, luckysmack wrote: Thanks, that is helpful. I'll have to try it out when I get to my computer. --
[web2py] Re: Object Row. Error in 2.0.8 not in 2.0.0
El sábado, 8 de septiembre de 2012 16:47:56 UTC-3, Anthony escribió: I'd say, when cacheable=True and cache!=None, then cache the entire Rows object (new behavior). However, if cacheable=False, then revert to the old caching behavior (which should be the default). +1 --
[web2py] auth.wiki with style
auth.wiki is looking pretty good (for what I need it for). Sorry, but just can't wait for the doco to arrive. I want to create a doco site with a look and feel like http://hginit.com/01.html. Note the tags off to the left. This is done with div class=cheatcontent style=margin-top:-50px div class=cheattop div class=commandhg init/div /div p class=cheattextcreates a repository/p img src=i/cheatbot.png http://hginit.com/i/cheatbot.png width=241 height=41 / /div I have been able to create something along this line with the (markmin) documented blockquote and then add css styles around it: blockquote class=Blah can auth.wiki allow the addition of divs or other elements? or should it? It's meant to be simple and shouldn't have to do everything, but adding divs might be nice. --
Re: [web2py] Re: need a simple wiki...
auth.wiki shouldn't include a WYSIWYG widget by default instead of a text box? On Mon, Sep 3, 2012 at 10:16 PM, Andrew W awillima...@gmail.com wrote: I've just done some tests on tools.py On edit: The page.body is being updated correctly, but page.html does not change. I've added some print statements and markmin_render() (the compute functions for page.html) is called on the intial page create, but is not called on subsequent updates - page.html is not getting updated when editing an existing page. Hope this helps. Not sure how to fix it though. Is it the SQLFORM call not triggering a compute of page.html? On Tuesday, September 4, 2012 11:47:03 AM UTC+12, Andrew W wrote: P.S. Menu changes work, in that the menu text gets updated, but the displayed menu text in the content area after I press submit still has the old text. On Tuesday, September 4, 2012 11:42:48 AM UTC+12, Andrew W wrote: I can create pages OK, but when I click on Edit, make some changes and then press Submit, the changes do not get displayed. The changes are still there if I open up the Edit screen again, but the html won't change. I've stopped and restarted rocket but the old html stays. I've tried on a few different installations ??? If it is cached in the db, then a restart should have reset the cache. They're not saved to a file are they ? I'm updating pages but they don't get refreshed - is there caching on by default ? This might have been causing my earlier issue as I'm not seeing an updated page. How do you update them? The html is cached in db but should be updated when you use the edit action. -- -- Linux User #387870 . _/_õ|__| ..º[ .-.___.-._| . . . . .__( o)__( o).:___ --
[web2py] Re: What is the plan for the replacement of plugin_wiki with auth.wiki ?
Yes, I guess we just need a few notes to encourage everyone to use it. I was disappointed at first with auth_wiki because I was unsure how to use my previous work with plugin_wiki, but I think I will be able to re-use this making use of the 'component' which is really more flexible. The flexibility with urls is also really so much better. That was real problem for me with plugin_wiki. On Saturday, September 8, 2012 9:32:19 PM UTC+1, Massimo Di Pierro wrote: Most of the functionality of plugin_wiki is in auth.wiki. Only comments and star ratings are missing. Everything else is done better in auth.wiki. yet we provide plugin_comments and plugin_ratings as separate which work with auth.wik() On Saturday, 8 September 2012 14:55:19 UTC-5, apps in tables wrote: Thanks, Villas I understand that i can use both. The first one will be deprecated, but it is documented. The second one has better design and integrated, but it is not documented. I prefer to wait for the second to be documented. Regards, Ashraf --
Re: [web2py] Re: need a simple wiki...
Good point. On Sunday, September 9, 2012 8:44:32 AM UTC+12, Tito Garrido wrote: auth.wiki shouldn't include a WYSIWYG widget by default instead of a text box? On Mon, Sep 3, 2012 at 10:16 PM, Andrew W awill...@gmail.comjavascript: wrote: I've just done some tests on tools.py On edit: The page.body is being updated correctly, but page.html does not change. I've added some print statements and markmin_render() (the compute functions for page.html) is called on the intial page create, but is not called on subsequent updates - page.html is not getting updated when editing an existing page. Hope this helps. Not sure how to fix it though. Is it the SQLFORM call not triggering a compute of page.html? On Tuesday, September 4, 2012 11:47:03 AM UTC+12, Andrew W wrote: P.S. Menu changes work, in that the menu text gets updated, but the displayed menu text in the content area after I press submit still has the old text. On Tuesday, September 4, 2012 11:42:48 AM UTC+12, Andrew W wrote: I can create pages OK, but when I click on Edit, make some changes and then press Submit, the changes do not get displayed. The changes are still there if I open up the Edit screen again, but the html won't change. I've stopped and restarted rocket but the old html stays. I've tried on a few different installations ??? If it is cached in the db, then a restart should have reset the cache. They're not saved to a file are they ? I'm updating pages but they don't get refreshed - is there caching on by default ? This might have been causing my earlier issue as I'm not seeing an updated page. How do you update them? The html is cached in db but should be updated when you use the edit action. -- -- Linux User #387870 . _/_õ|__| ..º[ .-.___.-._| . . . . .__( o)__( o).:___ --
[web2py] Re: Object Row. Error in 2.0.8 not in 2.0.0
In trunk. Could you check it? On Saturday, 8 September 2012 15:40:37 UTC-5, Jose wrote: El sábado, 8 de septiembre de 2012 16:47:56 UTC-3, Anthony escribió: I'd say, when cacheable=True and cache!=None, then cache the entire Rows object (new behavior). However, if cacheable=False, then revert to the old caching behavior (which should be the default). +1 --
Re: [web2py] Re: need a simple wiki...
I guess it can be made an option but I really hate WYSIWG. I think wiki markup are superior. On Saturday, 8 September 2012 15:46:16 UTC-5, Andrew W wrote: Good point. On Sunday, September 9, 2012 8:44:32 AM UTC+12, Tito Garrido wrote: auth.wiki shouldn't include a WYSIWYG widget by default instead of a text box? On Mon, Sep 3, 2012 at 10:16 PM, Andrew W awill...@gmail.com wrote: I've just done some tests on tools.py On edit: The page.body is being updated correctly, but page.html does not change. I've added some print statements and markmin_render() (the compute functions for page.html) is called on the intial page create, but is not called on subsequent updates - page.html is not getting updated when editing an existing page. Hope this helps. Not sure how to fix it though. Is it the SQLFORM call not triggering a compute of page.html? On Tuesday, September 4, 2012 11:47:03 AM UTC+12, Andrew W wrote: P.S. Menu changes work, in that the menu text gets updated, but the displayed menu text in the content area after I press submit still has the old text. On Tuesday, September 4, 2012 11:42:48 AM UTC+12, Andrew W wrote: I can create pages OK, but when I click on Edit, make some changes and then press Submit, the changes do not get displayed. The changes are still there if I open up the Edit screen again, but the html won't change. I've stopped and restarted rocket but the old html stays. I've tried on a few different installations ??? If it is cached in the db, then a restart should have reset the cache. They're not saved to a file are they ? I'm updating pages but they don't get refreshed - is there caching on by default ? This might have been causing my earlier issue as I'm not seeing an updated page. How do you update them? The html is cached in db but should be updated when you use the edit action. -- -- Linux User #387870 . _/_õ|__| ..º[ .-.___.-._| . . . . .__( o)__( o).:___ --
[web2py] Re: Web2py. for a minimalist app, it feels bloated. Do it I need it?
Ok will do. But im still curious though if web2py as a whole would fit my idea? In web2py I you have applications, one for each app.If I had this core as one app, and the others build on it (they wouldnt just use the api, the api would be part of the app). So it seems like I would need to duplicate that part into each app the way web2py seems to be built. I could be wrong on this, as an example, this rest api code would be its own git repo, and the others would be separate ones. I dont see how I would separate them in a web2py app. On Saturday, September 8, 2012 12:39:26 AM UTC-7, luckysmack wrote: I am somewhat new to python, and * shock * have an idea for a simple app I want to build. To start the app will be relatively light weight, but if it works out in my grand scheme could be far more complex.but the core will be fairly simple. something an experienced python dev could probably whip up in bottle in a few days. The core will a simply be an advanced rest based api. The other half dozen or so apps will all be built of this core. The either apps will likely be built as a cms like system to manage each other. And as different as a POS in store program. So as many cool things as I thing web2py has, do you guys think its the right system? I know w2p can do great APIs easily. But for that simple aspect, I don't need a milti-application admin interface, or a code editor, and I may not even use DAL. (For my project I may actually use something like neo4j/orientdb/titan. Not sure yet. Might use mongodb as instead). So for that simple part, all the other stuff seems a little bloated to me. Stuff that I won't need. Sure as a whole, all the apps will be built into somewhat of a cms (which I would like to build anyways), for that I'm not sure I would need the web2py admin part. As a cms I would probably have my own interface, even for the admins. How or would web2py admin ui fit in. I know you guys are biased towards web2py, but does it sound like it would be a right fit? Or would it be too complex? In comparison, I feel django is too bloated as well since I would be doing a similar thing, except it would be done quite a bit differently. The core of how it works doesn't seem to fit my ideas. If I don't use web2py, the next best things I see as a starting point are pyramid, or bottle/flask or even wheezy looks pretty cool. What do you guys think? The core great api would be the crux of the other apps. This core is what talks to the db. And each if the apps with build on it. The rest part will be made so they can all communicate with each other based on the URL. The either individual apps, were they to be on their own, I can totally see as a web2py app. So I'm curious how this idea as a whole, would fit into web2py. If it can. Since there are a handful of web2py featured I won't even use. I don't need them to be auto imported if I'm not using them (since I can't see what's being imported). So in a way it feels like bloat. A reason I don't like django. What do you guys think? Any input is greatly appreciated. --
Re: [web2py] Re: Object Row. Error in 2.0.8 not in 2.0.0
I am using: cache_key = %s_%s_%s % (query, start, end) total, rows = cache.ram(cache_key, lambda: (db(query).count(), db(query).select(limitby=(start, end), cacheable=True)), 3600) Should I put a dummy cache=(...) just to have the benefits? --
[web2py] Re: What is the plan for the replacement of plugin_wiki with auth.wiki ?
And the documentation of auth.wiki will be ready on Regards, Ashraf --
[web2py] Re: Object Row. Error in 2.0.8 not in 2.0.0
El sábado, 8 de septiembre de 2012 17:47:49 UTC-3, Massimo Di Pierro escribió: In trunk. Could you check it? Works fine! Jose --
Re: [web2py] Re: Object Row. Error in 2.0.8 not in 2.0.0
No, what you have will work as expected. On Saturday, 8 September 2012 17:02:00 UTC-5, rochacbruno wrote: I am using: cache_key = %s_%s_%s % (query, start, end) total, rows = cache.ram(cache_key, lambda: (db(query).count(), db(query).select(limitby=(start, end), cacheable=True)), 3600) Should I put a dummy cache=(...) just to have the benefits? --
[web2py] short term roadmap
I have been speaking with some friends and heavy web2py users and we agree that the following issue need to be addressed: 1) Improve Mercurial and Git support. Currently Git+web2py allows clone and push whirl Hg+web2py allows commit, status and revert. I think we need an abstraction layer that allows clone, push, commit, status, revert, and pull with both the version control system (with a preference for Git). I think we need an abstraction layer on top of both VCS even if for now we may support only one of them. 2) Handle gthub callback so that a push to github triggers a local web2py pull (for testing) 3) make it easier to run tests and manage databases (rename, backup, etc) at the click of a button. 4) Bootstrap looks great but it is not consistent throughout the welcome app. The idea is that this should be edited in web2py.css instead of any python code to allow backwards compatibility. Also we should avoid changing bootstrap.css so that we can just drop-in new versions of bootstrap, and or bootswatches. So we need someone with good CSS skills. It shouldn't be too much extra work to make it look great out of the box. 5) Port admin on top of bootstrap (while preserving the artwork). If you want to work on any of these topics, there may be funding available. I think 1) should be a priority for web2py 2.1 or 2.2. P.S. Friends have suggested looking to the following links: Here are some issues and examples of what is possible from wrapbootstrap.com templates: 1. Web2py forms: they are using no styling webkit (see registration/login/password reset). (Example: http://wbpreview.com/previews/WB00U99JJ/login.html 2. Navbar has login/logout/password which seems to be styled differently that the other menu items. (Nice dropdown example: http://wbpreview.com/previews/WB0087188/account.html) 3. Form Validation: would be nice to use bootstrap form validation perhaps with popovers overriding of the the redflash for incomplete forms. (Example: http://wbpreview.com/previews/WB0F35928/form-validation.html ) 4. Notifications: Use Bootstrap notifications for flash, overriding the web2py growl notifications. (Lot's of options here: http://wbpreview.com/previews/WB0881879/noty.html) --
Re: [web2py] short term roadmap
I think we need to come together and make donations of at least U.S. 10:00 U.S. dollars to fund the changes. The community web2py will be happier, harder and making the job easier. Ovidio Marinho Falcao Neto Web Developer ovidio...@gmail.com ovidiomari...@itjp.net.br ITJP - itjp.net.br 83 8826 9088 - Oi 83 9334 0266 - Claro Brasil 2012/9/8 Massimo DiPierro massimo.dipie...@gmail.com I have been speaking with some friends and heavy web2py users and we agree that the following issue need to be addressed: 1) Improve Mercurial and Git support. Currently Git+web2py allows clone and push whirl Hg+web2py allows commit, status and revert. I think we need an abstraction layer that allows clone, push, commit, status, revert, and pull with both the version control system (with a preference for Git). I think we need an abstraction layer on top of both VCS even if for now we may support only one of them. 2) Handle gthub callback so that a push to github triggers a local web2py pull (for testing) 3) make it easier to run tests and manage databases (rename, backup, etc) at the click of a button. 4) Bootstrap looks great but it is not consistent throughout the welcome app. The idea is that this should be edited in web2py.css instead of any python code to allow backwards compatibility. Also we should avoid changing bootstrap.css so that we can just drop-in new versions of bootstrap, and or bootswatches. So we need someone with good CSS skills. It shouldn't be too much extra work to make it look great out of the box. 5) Port admin on top of bootstrap (while preserving the artwork). If you want to work on any of these topics, there may be funding available. I think 1) should be a priority for web2py 2.1 or 2.2. P.S. Friends have suggested looking to the following links: Here are some issues and examples of what is possible from wrapbootstrap.com templates: 1. Web2py forms: they are using no styling webkit (see registration/login/password reset). (Example: http://wbpreview.com/previews/WB00U99JJ/login.html 2. Navbar has login/logout/password which seems to be styled differently that the other menu items. (Nice dropdown example: http://wbpreview.com/previews/WB0087188/account.html) 3. Form Validation: would be nice to use bootstrap form validation perhaps with popovers overriding of the the redflash for incomplete forms. (Example: http://wbpreview.com/previews/WB0F35928/form-validation.html ) 4. Notifications: Use Bootstrap notifications for flash, overriding the web2py growl notifications. (Lot's of options here: http://wbpreview.com/previews/WB0881879/noty.html) -- --
[web2py] Re: Web2py. for a minimalist app, it feels bloated. Do it I need it?
Maybe have a look at http://web2py.com/books/default/chapter/29/04#Cooperation and http://web2py.com/books/default/chapter/29/09#Central-Authentication-Service . Anthony On Saturday, September 8, 2012 5:19:03 PM UTC-4, luckysmack wrote: Ok will do. But im still curious though if web2py as a whole would fit my idea? In web2py I you have applications, one for each app.If I had this core as one app, and the others build on it (they wouldnt just use the api, the api would be part of the app). So it seems like I would need to duplicate that part into each app the way web2py seems to be built. I could be wrong on this, as an example, this rest api code would be its own git repo, and the others would be separate ones. I dont see how I would separate them in a web2py app. On Saturday, September 8, 2012 12:39:26 AM UTC-7, luckysmack wrote: I am somewhat new to python, and * shock * have an idea for a simple app I want to build. To start the app will be relatively light weight, but if it works out in my grand scheme could be far more complex.but the core will be fairly simple. something an experienced python dev could probably whip up in bottle in a few days. The core will a simply be an advanced rest based api. The other half dozen or so apps will all be built of this core. The either apps will likely be built as a cms like system to manage each other. And as different as a POS in store program. So as many cool things as I thing web2py has, do you guys think its the right system? I know w2p can do great APIs easily. But for that simple aspect, I don't need a milti-application admin interface, or a code editor, and I may not even use DAL. (For my project I may actually use something like neo4j/orientdb/titan. Not sure yet. Might use mongodb as instead). So for that simple part, all the other stuff seems a little bloated to me. Stuff that I won't need. Sure as a whole, all the apps will be built into somewhat of a cms (which I would like to build anyways), for that I'm not sure I would need the web2py admin part. As a cms I would probably have my own interface, even for the admins. How or would web2py admin ui fit in. I know you guys are biased towards web2py, but does it sound like it would be a right fit? Or would it be too complex? In comparison, I feel django is too bloated as well since I would be doing a similar thing, except it would be done quite a bit differently. The core of how it works doesn't seem to fit my ideas. If I don't use web2py, the next best things I see as a starting point are pyramid, or bottle/flask or even wheezy looks pretty cool. What do you guys think? The core great api would be the crux of the other apps. This core is what talks to the db. And each if the apps with build on it. The rest part will be made so they can all communicate with each other based on the URL. The either individual apps, were they to be on their own, I can totally see as a web2py app. So I'm curious how this idea as a whole, would fit into web2py. If it can. Since there are a handful of web2py featured I won't even use. I don't need them to be auto imported if I'm not using them (since I can't see what's being imported). So in a way it feels like bloat. A reason I don't like django. What do you guys think? Any input is greatly appreciated. --
Re: [web2py] short term roadmap
While this is a possibility, it may be easier if people publicly sponsor features they want and pay directly the developer who gets it done. Massimo On Saturday, 8 September 2012 18:59:28 UTC-5, Ovidio Marinho wrote: I think we need to come together and make donations of at least U.S. 10:00 U.S. dollars to fund the changes. The community web2py will be happier, harder and making the job easier. Ovidio Marinho Falcao Neto Web Developer ovid...@gmail.com javascript: ovidio...@itjp.net.br javascript: ITJP - itjp.net.br 83 8826 9088 - Oi 83 9334 0266 - Claro Brasil 2012/9/8 Massimo DiPierro massimo@gmail.com javascript: I have been speaking with some friends and heavy web2py users and we agree that the following issue need to be addressed: 1) Improve Mercurial and Git support. Currently Git+web2py allows clone and push whirl Hg+web2py allows commit, status and revert. I think we need an abstraction layer that allows clone, push, commit, status, revert, and pull with both the version control system (with a preference for Git). I think we need an abstraction layer on top of both VCS even if for now we may support only one of them. 2) Handle gthub callback so that a push to github triggers a local web2py pull (for testing) 3) make it easier to run tests and manage databases (rename, backup, etc) at the click of a button. 4) Bootstrap looks great but it is not consistent throughout the welcome app. The idea is that this should be edited in web2py.css instead of any python code to allow backwards compatibility. Also we should avoid changing bootstrap.css so that we can just drop-in new versions of bootstrap, and or bootswatches. So we need someone with good CSS skills. It shouldn't be too much extra work to make it look great out of the box. 5) Port admin on top of bootstrap (while preserving the artwork). If you want to work on any of these topics, there may be funding available. I think 1) should be a priority for web2py 2.1 or 2.2. P.S. Friends have suggested looking to the following links: Here are some issues and examples of what is possible from wrapbootstrap.com templates: 1. Web2py forms: they are using no styling webkit (see registration/login/password reset). (Example: http://wbpreview.com/previews/WB00U99JJ/login.html 2. Navbar has login/logout/password which seems to be styled differently that the other menu items. (Nice dropdown example: http://wbpreview.com/previews/WB0087188/account.html) 3. Form Validation: would be nice to use bootstrap form validation perhaps with popovers overriding of the the redflash for incomplete forms. (Example: http://wbpreview.com/previews/WB0F35928/form-validation.html ) 4. Notifications: Use Bootstrap notifications for flash, overriding the web2py growl notifications. (Lot's of options here: http://wbpreview.com/previews/WB0881879/noty.html) -- --
Re: [web2py] Re: need a simple wiki...
On Saturday, September 8, 2012 5:16:32 PM UTC-4, Massimo Di Pierro wrote: I guess it can be made an option but I really hate WYSIWG. I think wiki markup are superior. I think it really depends on the end user -- some folks just aren't realistically going to learn wiki markup and will expect WYSIWYG. The Stack Overflow approach isn't a bad compromise. --
Re: [web2py] Re: need a simple wiki...
Looking at the source code... this is already possible. Wiki(render=lambda page: page.body) I now exposed in auth.wiki(render=lambda page: page.body). This option will allow html in wiki. We may want to allow autolinks as well. On Saturday, 8 September 2012 19:42:18 UTC-5, Anthony wrote: On Saturday, September 8, 2012 5:16:32 PM UTC-4, Massimo Di Pierro wrote: I guess it can be made an option but I really hate WYSIWG. I think wiki markup are superior. I think it really depends on the end user -- some folks just aren't realistically going to learn wiki markup and will expect WYSIWYG. The Stack Overflow approach isn't a bad compromise. --
[web2py] Re: Can I insert a template into a form?
Thanks Anthony, that worked! On Sunday, September 9, 2012 4:03:07 AM UTC+8, Anthony wrote: On Saturday, September 8, 2012 12:14:16 PM UTC-4, lyn2py wrote: Thanks Anthony for stepping up. I have a views file, it has quite a chunk of html in it. If I could put it in the controller, I would, but it's quite hefty. I have about 15 fields, displayed via SQLFORM, just a simple form = SQLFORM(db.table) I want to insert a {{include html_file}} in the middle, and I've tried form[0].insert(7,'{{include template.html}}') Try: form[0].insert(7, XML(response.render('path/to/template.html', dict(var1='something'),othervar ='something else'))) response.render() will render a template and return the HTML as a string. You should wrap the response in XML() so the text doesn't get escaped. The path to the template should be relative to the /views folder. The second argument can be a dict -- the items in the dict will be available as variables in the view environment (just like when a controller function returns a dict). You can also add additional keyword arguments, which will also get added to the view environment. Anthony --
Re: [web2py] Re: Web2py. for a minimalist app, it feels bloated. Do it I need it?
Ahh thats excellent. Thanks! So it seems that the cooperation portion will work great with what I need. and the auth system using CAP will be great too. thanks. On Sat, Sep 8, 2012 at 5:20 PM, Anthony abasta...@gmail.com wrote: Maybe have a look at http://web2py.com/books/default/chapter/29/04#Cooperation and http://web2py.com/books/default/chapter/29/09#Central-Authentication-Service . Anthony On Saturday, September 8, 2012 5:19:03 PM UTC-4, luckysmack wrote: Ok will do. But im still curious though if web2py as a whole would fit my idea? In web2py I you have applications, one for each app.If I had this core as one app, and the others build on it (they wouldnt just use the api, the api would be part of the app). So it seems like I would need to duplicate that part into each app the way web2py seems to be built. I could be wrong on this, as an example, this rest api code would be its own git repo, and the others would be separate ones. I dont see how I would separate them in a web2py app. On Saturday, September 8, 2012 12:39:26 AM UTC-7, luckysmack wrote: I am somewhat new to python, and * shock * have an idea for a simple app I want to build. To start the app will be relatively light weight, but if it works out in my grand scheme could be far more complex.but the core will be fairly simple. something an experienced python dev could probably whip up in bottle in a few days. The core will a simply be an advanced rest based api. The other half dozen or so apps will all be built of this core. The either apps will likely be built as a cms like system to manage each other. And as different as a POS in store program. So as many cool things as I thing web2py has, do you guys think its the right system? I know w2p can do great APIs easily. But for that simple aspect, I don't need a milti-application admin interface, or a code editor, and I may not even use DAL. (For my project I may actually use something like neo4j/orientdb/titan. Not sure yet. Might use mongodb as instead). So for that simple part, all the other stuff seems a little bloated to me. Stuff that I won't need. Sure as a whole, all the apps will be built into somewhat of a cms (which I would like to build anyways), for that I'm not sure I would need the web2py admin part. As a cms I would probably have my own interface, even for the admins. How or would web2py admin ui fit in. I know you guys are biased towards web2py, but does it sound like it would be a right fit? Or would it be too complex? In comparison, I feel django is too bloated as well since I would be doing a similar thing, except it would be done quite a bit differently. The core of how it works doesn't seem to fit my ideas. If I don't use web2py, the next best things I see as a starting point are pyramid, or bottle/flask or even wheezy looks pretty cool. What do you guys think? The core great api would be the crux of the other apps. This core is what talks to the db. And each if the apps with build on it. The rest part will be made so they can all communicate with each other based on the URL. The either individual apps, were they to be on their own, I can totally see as a web2py app. So I'm curious how this idea as a whole, would fit into web2py. If it can. Since there are a handful of web2py featured I won't even use. I don't need them to be auto imported if I'm not using them (since I can't see what's being imported). So in a way it feels like bloat. A reason I don't like django. What do you guys think? Any input is greatly appreciated. -- -- -- Shawn McElroy Anything worth doing, is worth doing right — Hunter S. Thompson A mind troubled by doubt cannot focus on the course to victory — Ahttp://www.goodreads.com/author/quotes/5237.Hunter_S_Thompsonrthur Golden --
Re: [web2py] Re: need a simple wiki...
Now in trunk: auth.wiki(render='html') will allow html, will do autolink, oembed and allows @ syntax as well as @{component:...} syntax. On Saturday, 8 September 2012 20:34:25 UTC-5, Massimo Di Pierro wrote: Looking at the source code... this is already possible. Wiki(render=lambda page: page.body) I now exposed in auth.wiki(render=lambda page: page.body). This option will allow html in wiki. We may want to allow autolinks as well. On Saturday, 8 September 2012 19:42:18 UTC-5, Anthony wrote: On Saturday, September 8, 2012 5:16:32 PM UTC-4, Massimo Di Pierro wrote: I guess it can be made an option but I really hate WYSIWG. I think wiki markup are superior. I think it really depends on the end user -- some folks just aren't realistically going to learn wiki markup and will expect WYSIWYG. The Stack Overflow approach isn't a bad compromise. --
[web2py] help test codemirrorw
we are considering replacing the admin editor with codemirror since it should work with IE. Can you please help us try it? get web2py form github and edit admin/models/0.py and set the editor to 'codemirror'. let us know what browser you try and your findings. Massimo --
[web2py] Re: Getting auth.wiki pages to display without login
Worth a look, but I couldn't find this magic checkbox. I thought I must have missed something so obvious. Sorry Massimo, I must have accidentally put the s there while having a look at layout.html. Here is what I'm doing, keeping it as simple as possible (using trunk version). Steps: 1) From Admin screen, create a New simple application auth_wiki_simpletest 2) Edit default.py 3) change def index() function. return auth.wiki() 4) Click on default/index. The login screen appears. Register a new user. Then the _create/index page appears. 5) Enter a Page Name Simple and press Create Page from Slug 6) Press Submit. The page appears. So far so good. 7) Copy the url. http://127.0.0.1:8000/auth_wiki_simpletest/default/index/simple 8) Logout 9) Go back to the Welcome App 127.0.0.1:8000. Displays OK without login. 10) Paste in the url: http://127.0.0.1:8000/auth_wiki_simpletest/default/index/simple 11) This page appears: http://127.0.0.1:8000/auth_wiki_simpletest/default/user/login On Sunday, September 9, 2012 3:57:28 AM UTC+12, villas wrote: Just a thought, but doesn't the wiki page have an is_public field? If so, did you tick it? On Saturday, September 8, 2012 9:41:35 AM UTC+1, Andrew W wrote: Just Checking, were you logged in when you tried to open up the page ? Just to clarify, if I'm logged in it will take me directly to the page - as expected. I wanted to test having pages available to users who haven't logged in - which for this case would be most people - the public. I opened a new browser window, made sure I wasn't logged in to web2py, and pasted in the url of my new page. I get the login screen. I've just tried it again at home, creating just a simple page (OK, I did add an extra css file to the layout). Screen shot attached of page (when logged in), and screen when I paste in the url. Apart from that, auth.wiki is looking great. I'm experimenting with adding blocks with extra classes, allowing me to style them differently. Can I specify classes to other elements, or is it just blockquotes ? P.S. I'm getting a small S in the menu bar (app created from Welcome with no changes to menu) - see screen shot Thanks On Saturday, September 8, 2012 7:42:22 AM UTC+12, Massimo Di Pierro wrote: Strange. It should work even without url=True. You should be able to paste any URL in markmin and it should work. MARKMIN(text, url=True) simply allows you to user the shortcuts @/app/controller/function/args and they will be converted in http:///app/controller/function/args where app, controller and function are optional. You can do @///index for example. On Friday, 7 September 2012 14:15:31 UTC-5, Andrew W wrote: No I didn't. Only just found out about URL=True. Di I pass as a URL variable ? --
[web2py] problem with jQuery UI modal and LOAD helper
Hello everyone, I am trying to duplicate an issue I have with jQuery UI and load helper. I have the following in a file named test.load (test.load contains a link that upon clicking will show a jQuery UI modal -- AKA dialog box) script $(document).ready(function() { $('div#thedialog').dialog({ autoOpen: false, }) $('#thelink').click(function(){ $('div#thedialog').dialog('open'); }); }) /script /head body div id=thedialog title=Download complete {{=testForm}} /div a href=# id=thelinkClickme/a The test.load file is included in the view file index.html: {{extend 'layout.html'}} {{=LOAD('default','test.load',ajax=True)}} /br I also have the following in my controller. The controller generates a simple form and passes it to the test.load file: def test(): testForm = SQLFORM.factory( Field('city'), Field('code'), ) if testForm.process().accepted: response.flash =form accepted else: response.flash =form not accepted return dict(testForm = testForm) The view part works fine and the modal display the form. But whenever I submit the form, the flash alert form not accepted is displayed, meaning that something has gone wrong. I don't have any validators on the fields of the form generated. So I can't figure out what's going wrong in here. Could somebody please help me? Thanks! --
Re: [web2py] help test codemirrorw
Thats great! I started using codemirror on another project and I find it awesome. I will update from trunk now and test in Ubuntu.. --
Re: [web2py] help test codemirrorw
code mirror works ok for me in chrome, opera and firefox (ubuntu). --