Re: [web2py] Re: Congratulations to Bruno and Mariano

2012-08-20 Thread Johann Spies
+1 -- Because experiencing your loyal love is better than life itself, my lips will praise you. (Psalm 63:3) --

[web2py] Pre-populate profile form

2012-08-20 Thread Daniel Gonzalez
Hi, I am trying to pre-populate the profile form with some random data, which I am using for testing, like this: def random_pre_populate(form): register_data = RegisterData().random() form.vars.first_name = register_data['first_name'] form.vars.surname1 = register_data['surname1']

[web2py] Displaying a message following auth.requires_login() redirect

2012-08-20 Thread Rob Goldsmith
Is it possible to display a message to the user on the login form when they have been redirected as a result of an auth.requires_login() redirect? (e.g. "You must be logged in to view this page") I found this discussion of the functionality from 2010 https://groups.google.com/forum/?fromgroups#!

[web2py] Re: need a simple wiki...

2012-08-20 Thread Calycé
Pystar, In the admin, add a group named 'wiki_editor' and put yourself in that group. Logout (if you were logged in the application), login and normally voilà! That's what I did and it worked. On Monday, August 20, 2012 7:43:34 AM UTC+2, Pystar wrote: > > Max, > Tried it, still gives me the "4

[web2py] Re: invalid select attribute: distinct

2012-08-20 Thread Uolter
I got the same error: global name 'ObjectId' is not defined and I just applied what I think is the required fix: Edit the gluon/dal.py file: - go to the line 4882. The select method inside the MongoDBAdapter class. - after the method signature add this try catch block: try:

Re: [web2py] Pre-populate profile form

2012-08-20 Thread Johann Spies
Search the book for "Populating database with dummy data" Regards Johann -- Because experiencing your loyal love is better than life itself, my lips will praise you. (Psalm 63:3) --

Re: [web2py] Pre-populate profile form

2012-08-20 Thread Daniel Gonzalez
Thanks Johan, For reference, here is the link. Unfortunately that does not help me, since it works directly with the backend, but I want to pre-populate the form that the user is going to submit. Besides, that

[web2py] Standalone application (mac/win)

2012-08-20 Thread mmstud
Is it possible to create easy to use standalone web2py application for mac and win users? I have registry application and remote database which should be available for clients. I'm searching for a solution where user just clicks the application icon and then browser (maybe internal?) starts up t

[web2py] Re: Standalone application (mac/win)

2012-08-20 Thread mmstud
Maybe this is all I need, is documentation update? http://web2py.com/books/default/chapter/29/14#How-to-distribute-your-applications-as-binaries maanantai, 20. elokuuta 2012 15.08.27 UTC+3 mmstud kirjoitti: > > Is it possible to create easy to use standalone web2py application for mac > and win

[web2py] Re: Pre-populate profile form

2012-08-20 Thread Cliff Kachinske
Have you looked into Selenium at www.seleniumhq.org? With it you can simulate user input and check the system response. On Monday, August 20, 2012 5:30:19 AM UTC-4, Daniel Gonzalez wrote: > > Hi, > > I am trying to pre-populate the profile form with some random data, which > I am using for testi

[web2py] Re: Is copying request.env in LOAD() reliable?

2012-08-20 Thread spiffytech
> > I assume you're using LOAD() with ajax=False (the default), correct? Correct. > I think Massimo generally discourages use of non-ajax components What's the rationale behind this? > LOAD('default', 'mycomponent', vars=dict(rows=rows)) > That did the trick nicely, and feels much less h

[web2py] Re: default tab key behavior change in fields

2012-08-20 Thread max
hi anthony, i can include the change in the views/xyz.html , but how cupld i set it globally for all the forms? Am Montag, 13. August 2012 15:50:25 UTC+2 schrieb max: > > thank anthony. > > Am Montag, 13. August 2012 15:30:24 UTC+2 schrieb Anthony: >> >> On Monday, August 13, 2012 9:24:13 AM UT

[web2py] Re: Beginner question about DAL

2012-08-20 Thread Spez
Hi Anthony, Now I faced a new problem, I have another tabel who has not the id filed, following your suggestions I defined a primarykey: legacy_db.define_table('timesheet_times', Field('uid', 'string'), Field('start_time', 'datetime'), Field('end_

[web2py] Re: whats the state of NoSQL in web2py 2.0

2012-08-20 Thread Massimo Di Pierro
db=DAL('mongodb://127.0.0.1:5984/db') they try some models and other dal expressions. On Monday, 20 August 2012 00:36:48 UTC-5, Pystar wrote: > > how do I test it? I have 2 days free I can use working on that. I need > some hints > > On Monday, August 20, 2012 5:48:22 AM UTC+1, Massimo Di Pierro

[web2py] Re: invalid select attribute: distinct

2012-08-20 Thread Massimo Di Pierro
Ouch! Thank you. Fix in trunk. On Monday, 20 August 2012 05:11:01 UTC-5, Uolter wrote: > > I got the same error: > > global name 'ObjectId' is not defined > > > and I just applied what I think is the required fix: > > Edit the gluon/dal.py file: > > - go to the line 4882. The select method insid

[web2py] Re: Pre-populate profile form

2012-08-20 Thread Daniel Gonzalez
Thanks Cliff, but that is overkill for me. I already have the test data. I just need to pre-populate the web2py form with it. On Monday, August 20, 2012 2:23:30 PM UTC+2, Cliff Kachinske wrote: > > Have you looked into Selenium at www.seleniumhq.org? > > With it you can simulate user input and ch

Re: [web2py] NameError one way. 404 NOT FOUND the other...

2012-08-20 Thread thinkwell
Thanks for your assistance everybody. For this particular issue, I suppose I'll just go with string formatting instead of templates; that'll work just as well for now until I understand web2py better. I do appreciate the responsiveness of the web2py mailing list. On Saturday, August 18, 2012 6:

Re: [web2py] Re: Back-and-forth between DAL & SQLAlchemy

2012-08-20 Thread Massimo Di Pierro
Web2py is more explicit than that. I think you are asking about the Field.Lazy in the example below db=DAL() db.define_table('mr_link', Field('recipient_id','reference recipient'), Field('msg_id','reference message')) db.

[web2py] Re: Web2Py + OAuth2 Server

2012-08-20 Thread João Alves
Hello, I didn't develop an OAuth 2.0 server to the web2py's core but I wrote a module instead. You can take a look here . Unfortunately, I don't have much time and I just implemented a version to work with pymongo + mongoDB, but it's quite easy to ex

Re: [web2py] Re: Pre-populate profile form

2012-08-20 Thread Johann Spies
On 20 August 2012 15:07, Daniel Gonzalez wrote: > Thanks Cliff, but that is overkill for me. I already have the test data. I > just need to pre-populate the web2py form with it. > > > Try the following: Export an empty csv-file of your table using appadmin. Use this as a template and copy your

[web2py] Re: linking tables to auth_user

2012-08-20 Thread Anthony
On Monday, August 20, 2012 12:46:26 AM UTC-4, Massimo Di Pierro wrote: > > True but auth_* tables are never lazy if DAL(...lazy_tables=True) > Yes, that's not the case now, but couldn't we add a lazy tables option to Auth as well -- e.g., auth.define_tables(lazy=True)? I think we would just have

Re: [web2py] Re: Pre-populate profile form

2012-08-20 Thread Daniel Gonzalez
Thanks Johann, but this is also not the way I want to do this. What I pretend to do is: 1. My test data is generated dynamically with the help of my test support classes, when the user wants to register. 2. After this, I want to pre-populate the profile form (not the database), so t

[web2py] Is only first argument available for "ordering factor" with GAE?

2012-08-20 Thread JungHyun Kim
Hello everyone! I have question about order by option with GAE. This code works well on my local (not GAE test server), but has problem on google app engine. (even on the GAE local test server) I filtered messages which has end_time after now, and tried to sort them by reg_time. messages

[web2py] Re: Congratulations to Bruno and Mariano

2012-08-20 Thread DenesL
Congratulations to both. --

Re: [web2py] Is only first argument available for "ordering factor" with GAE?

2012-08-20 Thread Jonathan Lundell
On 20 Aug 2012, at 7:20 AM, JungHyun Kim wrote: > I have question about order by option with GAE. > This code works well on my local (not GAE test server), but has problem on > google app engine. (even on the GAE local test server) > > I filtered messages which has end_time after now, and tried

[web2py] Re: need a simple wiki...

2012-08-20 Thread rif
The Search Pages is also not working. If I enter a page title and hit Submit I get: Traceback (most recent call last): File "/home/rif/Downloads/web2py/gluon/restricted.py", line 205, in restricted exec ccode in environment File "/home/rif/Downloads/web2py/applications/hopa/controllers/

[web2py] Re: How to get started with web2py's Debug? - very basic questions

2012-08-20 Thread Luther Goh Lu Feng
I am also trying the "toggle breakpoint" function I click on the button and it seems to just hang my web2py application. This is very much off an almost fresh web2py app created On Tuesday, August 14, 2012 4:35:57 AM UTC+8, Rob_McC wrote: > > Anthony: > > *>It sounds like he actually op

[web2py] Table.import_from_csv_file preserving ids

2012-08-20 Thread Alan Etkin
Is there any parameters configuration to pass so table.import_from_csv keeps old ids and does not create a different id sequence? If not, It would be possible to add the option, so when migrating data between databases ids can be preserved (provided that the user be warned that it'is not recomme

[web2py] Re: How to get started with web2py's Debug? - very basic questions

2012-08-20 Thread Rob_McC
Mine doesn't hang, I just get this error.. on a default type of app. *Set Breakpoint on /Users/robooo/Documents/signa_web2py_2_00/web2py/web2py.app/Contents/Resources/applications/welcome/controllers/default.py at line 1: Line /Users/robooo/Documents/signa_web2py_2_00/web2py/web2py.app/Conten

Re: [web2py] Is only first argument available for "ordering factor" with GAE?

2012-08-20 Thread JungHyun Kim
Thank you Lundell! If it is a limitation, I don't need to argue with it. You saved me! 2012년 8월 20일 월요일 오후 11시 25분 49초 UTC+9, Jonathan Lundell 님의 말: > > On 20 Aug 2012, at 7:20 AM, JungHyun Kim > > wrote: > > I have question about order by option with GAE. > This code works well on my local (no

[web2py] Re: need a simple wiki...

2012-08-20 Thread Alan Etkin
Incredible, this saves a lot of features development in pyodel. I was very worried on how to provide video streamming with rbac in the elearning plugin. The new changes should make it very easier. I'll try the changes as soon as possible. Thanks El domingo, 19 de agosto de 2012 20:45:34 UTC-3,

[web2py] Re: linking tables to auth_user

2012-08-20 Thread Massimo Di Pierro
I do not think we need an option. We need to re-factor Auth.define_tables. When we do they will behave as other tables (lazy or not). When we rewrite it, we could add the options for the string format as you suggest. On Monday, 20 August 2012 08:53:56 UTC-5, Anthony wrote: > > On Monday, August

[web2py] Re: whats the state of NoSQL in web2py 2.0

2012-08-20 Thread spiffytech
Are there any restrictions on what operations can/cannot be performed with MongoDB through the DAL? E.g., I don't think MongoDB has a native JOIN equivalent- does web2py emulate one? On Monday, August 20, 2012 9:02:12 AM UTC-4, Massimo Di Pierro wrote: > > db=DAL('mongodb://127.0.0.1:5984/db')

[web2py] Re: need a simple wiki...

2012-08-20 Thread Massimo Di Pierro
The generated HTML is always cached in DB. The tag search is also quite efficient. It shows a tagcloud in the search page. You can also do in views: {{=auth.wiki('header')}} ... {{=auth.wiki('footer')}} etc. and edit the header, footer, etc as normal wiki pages. On Monday, 20 August 2012 10:02

[web2py] Re: whats the state of NoSQL in web2py 2.0

2012-08-20 Thread Massimo Di Pierro
Yes. No joins. I am not sure about other restrictions. That is why it needs testing. On Monday, 20 August 2012 10:48:34 UTC-5, spiffytech wrote: > > Are there any restrictions on what operations can/cannot be performed with > MongoDB through the DAL? E.g., I don't think MongoDB has a native JOIN

[web2py] Re: Congratulations to Bruno and Mariano

2012-08-20 Thread David Rager
Whoot! Contrats! web2pythorific On Friday, August 17, 2012 8:13:45 AM UTC-6, Massimo Di Pierro wrote: > > Congratulations to Bruno Rocha and Mariano Reingart, > > New members of the Python Software Foundations. > > http://pyfound.blogspot.com.br/2012/08/welcome-new-psf-members.html > > > --

[web2py] web2py hanging after DB error - Windows / rocket / pyodbc / SQL Server

2012-08-20 Thread David Rager
Hey all - we have a persistent issue in our staging environment where our site will hang after certain DB errors. It feels like a transaction is hanging on the DB but am still confused as we instruct rocket to use multiple threads, so am unsure why it would block other requests. Is it possible

[web2py] Re: whats the state of NoSQL in web2py 2.0

2012-08-20 Thread David Rager
Having worked a number of years on MongoDB it generally leads to a good amount of denormalization to get it to work in any framework. If you have used web2py on GAE with the datastore it will probably be a very similar experience. Unless you have large datasets and high concurrency MongoDB m

[web2py] admin-page and ignore_common_filters

2012-08-20 Thread Martin Weissenboeck
I have an application which should be used by some organizations. Therefore I have added Field('org','reference org', default=lambda:session.org), and common_filter = lambda query: db.my_table.org==session.org to my_table. session.org contails the id of the respective organization. Great featur

[web2py] SQLFORM.factory + Multiple Tables + Upload Field + GAE Blob Problem

2012-08-20 Thread JungHyun Kim
Hello! I have a problem with upload field. I tried to upload a file through one form with two tables using SQLFORM.factory. It worked OK on web2py rocket server. But with GAE server (both local test server and real GAE server), I can't upload files. The problem is blob is None after uploaded.

Re: [web2py] Major speed improvement need testers

2012-08-20 Thread Jonathan Lundell
On 18 Aug 2012, at 1:46 PM, Massimo Di Pierro wrote: > As Bruno says. Something like this will completely nullify the benefit of > lazy tables. > > Field(..., readable=True) is OK but > db.table.field.readable=True is BAD because will force db.table to be > instantiated. > Here's a vague ide

[web2py] changing the links in auth navbar

2012-08-20 Thread Hassan Alnatour
Dear ALL , I am using {{='auth' in globals() and auth.navbar(separators=(' ','',''))}} >> so i get login | registration ... and some other links >> now how can i change the words ? i want to change login to something else so how can i do that ??? Best regards, --

[web2py] Re: admin-page and ignore_common_filters

2012-08-20 Thread Massimo Di Pierro
How do you set the common filter? Seems to me if session.org is not set, the common filter should not be set. web2py cannot ignore it because it does the wrong thing. On Monday, 20 August 2012 11:41:41 UTC-5, mweissen wrote: > > I have an application which should be used by some organizations.

Re: [web2py] Major speed improvement need testers

2012-08-20 Thread Massimo Di Pierro
can you show a proof of concept? On Monday, 20 August 2012 11:51:27 UTC-5, Jonathan Lundell wrote: > > On 18 Aug 2012, at 1:46 PM, Massimo Di Pierro > > > wrote: > > As Bruno says. Something like this will completely nullify the benefit of > lazy tables. > > Field(..., readable=True) is OK but

Re: [web2py] Re: admin-page and ignore_common_filters

2012-08-20 Thread Martin Weissenboeck
(1) session.org will be set with the login. But I am an administrator: I think I should use the admin application without a login to the application itself. (2) Lets say session.org==1: now it is not possible to change a record with my_table.org==2 using the admin app. (3) Did you mean: common_

Re: [web2py] Re: admin-page and ignore_common_filters

2012-08-20 Thread Massimo Di Pierro
You can do: db.define_table(, common_filter = None if not session.org else (lambda query:(db.my_table.org==session.org))) you can also use the check: from gluon.fileutils import check_credentials check_credentials('admin') #returns true if you are logged as admin. On Monday, 20 August 201

[web2py] Creating links to my custom login, register views

2012-08-20 Thread Pystar
I have created custom login and register functions/views for reasons best known to me and also created links to those functions/views sitewide in my application but the issue I am having now is that if I stop using my application for a while and get logged out automatically whenever I click on

Re: [web2py] id field? when using SQLForm.grid

2012-08-20 Thread Omi Chiba
I didn't test it but I'm sure it will work if there is only one primary key. My table has five key fields so I cannot do the solution. I think this is still a problem and should be fixed so it will work without defining 'id' field. db.define_table('EDTPOH00', Field('POIMHF', length=1),

[web2py] Clarification on using classes in models

2012-08-20 Thread Yarin
In this post Massimo says: "One should not define classes in Models and Controllers. I have issued that warning already to our users..." On the other hand, in this post

[web2py] Multiple login: __init__() got multiple values for keyword argument 'signals'

2012-08-20 Thread Alec Taylor
I followed the tutorial exactly, except used the Facebook login form rather than the RPX (Janrain) one: http://web2py.com/books/default/chapter/29/9#Other-login-methods-and-login-forms Error ticket: http://jsfiddle.net/AlecTaylor/PVGFM/show/light/ How do I get a "double login" form? Thanks fo

[web2py] Re: web2py hanging after DB error - Windows / rocket / pyodbc / SQL Server

2012-08-20 Thread Niphlod
it's pretty obscure the way you describe those errors: "certain DB errors" are what ? unique constraints not respected? db migrations ? heavy complicated queries ? file uploads ? On Monday, August 20, 2012 6:35:10 PM UTC+2, David Rager wrote: > > Hey all - we have a persistent issue in our stagi

Re: [web2py] Where to host web2py

2012-08-20 Thread Simon Carr
I think I have made a mistake with SWVPS, I would suggest that no one touch them. I had no response from them after sending my money, even though it was less than $20. I have sent them two emails to what is supposed to be 24/7 tech support and got no response. I am writing my $20 off, but don't won

Re: [web2py] Clarification on using classes in models

2012-08-20 Thread Bruno Rocha
You can define classes on models or controllers, the only caveat is that you can never import that classes in to other modules. They will be defined and will be available for the current request on global environment (means that it will be available on the flow of models->called-controller->render

Re: [web2py] Clarification on using classes in models

2012-08-20 Thread Anthony
There used to be a problem with potential memory leaks when defining classes in models and controllers (because they are executed). However, that problem was fixed. Now, the only limitation is that if you define a class in a model or controller, it should not include a __del__ method (and in ge

[web2py] Re: need a simple wiki...

2012-08-20 Thread Tim Michelsen
I just gave it a try and it didnt work as stated. In my index.py file I have the return auth.wiki() directive there but whenever I try to view the page I get a login page and after that a 401 unauthorized error. I also have a problem to create a new user (register) from the frontend. With curre

[web2py] Re: Creating links to my custom login, register views

2012-08-20 Thread Anthony
See http://web2py.com/books/default/chapter/29/9#Settings-and-messages. You'll need to set auth.settings.login_url (and maybe auth.settings.logged_url as well). Anthony On Monday, August 20, 2012 2:07:57 PM UTC-4, Pystar wrote: > > I have created custom login and register functions/views for re

Re: [web2py] Clarification on using classes in models

2012-08-20 Thread Yarin
Perfect - Thanks for clarifying Anthony, I missed that in the original thread On Monday, August 20, 2012 3:17:47 PM UTC-4, Anthony wrote: > > There used to be a problem with potential memory leaks when defining > classes in models and controllers (because they are executed). However, > that pro

[web2py] Re: changing the links in auth navbar

2012-08-20 Thread Anthony
The navbar() function is not that customizable. The link labels are wrapped in T(), so you could translate them in the language files. Alternatively, the navbar() function simply returns a SPAN object, so you could use the server-side DOM

[web2py] Re: IS_IN_DB cannot pull the data from the table

2012-08-20 Thread Omi Chiba
>Is the problem only in appadmin? No, it happnes anywhere. >Can you produce a minimum program with some sample data to reproduce this? I tried MySQL, MSSQL and DB2, and found only DB2 has this problem. This is how to reproduce the error on db2. This is very critical for my current project and I

Re: [web2py] Re: admin-page and ignore_common_filters

2012-08-20 Thread Martin Weissenboeck
A little bit more code: db.define_table('org', Field('orgnr', Field(shortname', length=20, requires=IS_LENGTH(maxsize=20,minsize=3)), ... ) auth.settings.extra_fields['auth_group']=[ Field('org','reference org', default=lambda: session.org, req

[web2py] Re: default tab key behavior change in fields

2012-08-20 Thread Anthony
Either directly in layout.html or in a JS file loaded into every page, include the code that checks for enter key presses in input fields (use the $('input') jQuery selector to find all input fields on the page). Anthony On Monday, August 20, 2012 8:56:18 AM UTC-4, max wrote: > > hi anthony, i

[web2py] How to add a hidden field

2012-08-20 Thread Simon Carr
I am still writing my learning application a Blog. I have now created a function in my controller to produce a form for users to leave comments for a post. How do I add a hidden field to the comment form with the post_id? here is my database defs if it helps. db.define_table( 'post', Field('auth

[web2py] generic.html controller wide?

2012-08-20 Thread Toby Shepard
I was thinking that it would be nice if I could make a director in the views folder matching a controller name, but then just put a file in there called 'generic.html' that would apply to any function called in that controller. Perhaps there is another way to do this. Thanks, Tobiah --

[web2py] Re: How to add a hidden field

2012-08-20 Thread Niphlod
take a look in the book http://web2py.com/books/default/chapter/29/7#Hidden-fields. If you have a page where the post is shown and the comments are "at the bottom" (so you have the post_id somewhere in the controller or in the request.args or vars) you can still do something like db.comments.p

[web2py] Re: How to add a hidden field

2012-08-20 Thread villas
Something like this... SQLFORM(, hidden=dict('post_id'='999')) Hope that is what you meant. On Monday, August 20, 2012 9:23:47 PM UTC+1, Simon Carr wrote: > > I am still writing my learning application a Blog. I have now created a > function in my controller to produce a form for users to

Re: [web2py] Re: How to add a hidden field

2012-08-20 Thread Simon Carr
Thanks niphold and thanks for pointing out the missing () Simon On 20 August 2012 21:32, Niphlod wrote: > take a look in the book > http://web2py.com/books/default/chapter/29/7#Hidden-fields. > > If you have a page where the post is shown and the comments are "at the > bottom" (so you have the

Re: [web2py] generic.html controller wide?

2012-08-20 Thread Bruno Rocha
Not tested, but should work. in your controllers/default.py response.view = "default/generic.%s" % request.extension def index(): return dict(message="Hello from index") def contact(): return dict(message="Hello from contact") then, in your views folder create a generic file: "vie

[web2py] simplest possible call to matplotlib

2012-08-20 Thread Jarrod Wilcox
I have carefully read the cookbook example on calling matplotlib, but the last steps assume more knowledge than I have. I have also seen a question answer from Massimo. Ditto. Would anybody care to take a look at the cookbook answer (page 200) and carry it through to the view file? --

[web2py] Massimo's canvas 0.1 usage?

2012-08-20 Thread Jarrod Wilcox
I have read the explanation of Canvas 0.1 and would very much appreciate a complete example of usage. --

Re: [web2py] Re: How to add a hidden field

2012-08-20 Thread Simon Carr
Cheers Villas, As I am learning, I will give both methods a try. Simon On 20 August 2012 21:42, villas wrote: > Something like this... > SQLFORM(, hidden=dict('post_id'='999')) > > Hope that is what you meant. > > > > On Monday, August 20, 2012 9:23:47 PM UTC+1, Simon Carr wrote: >> >> I

[web2py] How to build form is another action

2012-08-20 Thread Simon Carr
Sorry to be pain keep asking loads of what probably seems like dumb questions but. Given this section of my controller, you will see that in view_post(), I am calling comment_form() to generate a form and return it back so I can include it in the view_post.html. The form displays fine in the

[web2py] Rendering views manually

2012-08-20 Thread Yarin
Im trying to follow the example given herefor manually rendering views. I have this code in my controller: def index(): global my_var my_var = "something" content = '''My Page {{=my_var}} {{=request.raw_arg

[web2py] Re: Creating links to my custom login, register views

2012-08-20 Thread Niphlod
did you alter the auth.settings (login_url, on_failed_authentication, etc) accordingly ? On Monday, August 20, 2012 8:07:57 PM UTC+2, Pystar wrote: > > I have created custom login and register functions/views for reasons best > known to me and also created links to those functions/views sitewide

Re: [web2py] Rendering views manually

2012-08-20 Thread ian douglas
On 08/20/2012 02:17 PM, Yarin wrote: | defindex(): globalmy_var my_var ="something" content ='''My Page {{=my_var}} {{=request.raw_args}} ''' output =render(content,context=dict(n=5)) returnoutput | but this won't work- it gives an error: name 'my_var' is not defined Questions:

[web2py] Re: Rendering views manually

2012-08-20 Thread Niphlod
uhm I always seen that as a simple thing. context is equal to the dict you normally return from the view. On Monday, August 20, 2012 11:17:23 PM UTC+2, Yarin wrote: > > Im trying to follow the example given > here

Re: [web2py] Major speed improvement need testers

2012-08-20 Thread Jonathan Lundell
On 20 Aug 2012, at 10:32 AM, Massimo Di Pierro wrote: > can you show a proof of concept? Not exactly a proof, but a concept. At the very end of lazy_define_table, just before 'return table': if args.get('on_define'): args.get('on_define')(table) The caller-defined on_define functi

Re: [web2py] Rendering views manually

2012-08-20 Thread Yarin
wow im an idiot.. thanks On Monday, August 20, 2012 5:27:59 PM UTC-4, ian douglas wrote: > > > On 08/20/2012 02:17 PM, Yarin wrote: > > > def index(): > > global my_var > my_var = "something" > content = '''My Page > {{=my_var}} > {{=request.raw_args}} > ''' > > output = render(con

Re: [web2py] Re: Scheduler: help us test it while learning

2012-08-20 Thread Yarin
OK i've come around- agree this is the right set up, let's just make sure it's clear in the eventual documentation, as it wasn't obvious to me (not much is these days..) - both retries and repeats respect the period. Cool, i like it. On Sunday, August 19, 2012 7:13:15 AM UTC-4, Niphlod wrote:

Re: [web2py] Re: Scheduler: help us test it while learning

2012-08-20 Thread Niphlod
hey, more point of views, more eyes on the code = less errors in the code, more understandable docs, etc. Opensource development bases. And I like smart questions :-P On Monday, August 20, 2012 11:41:15 PM UTC+2, Yarin wrote: > > OK i've come around- agree this is the right set up, let's just ma

[web2py] Re: How to build form is another action

2012-08-20 Thread Anthony
> > Given this section of my controller, you will see that in view_post(), I > am calling comment_form() to generate a form and return it back so I can > include it in the view_post.html. The form displays fine in the view but > the when I view the source the action ="" so it does not post anyw

Re: [web2py] Complex query in DAL?

2012-08-20 Thread Carlos Correia
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Em 16-08-2012 20:07, pbreit escreveu: > I'd rather stay in app code. If I do db.executesql(..., as_dict=True) could I > copy that into a Storage object to get something roughly similar to a DAL > object? > > I started trying to build it in DAL and go

[web2py] routes.py changed but user still called from default

2012-08-20 Thread Simon Carr
I have updated my routes.py as below default_application = 'blog'# ordinarily set in base routes.py default_controller = 'post' # ordinarily set in app-specific routes.py default_function = 'index' # ordinarily set in app-specific routes.py This works fine for the home page and the link

[web2py] Re: Beginner question about DAL

2012-08-20 Thread Anthony
> > times = > legacy_db(legacy_db.timesheet_times).select(orderby=legacy_db.timesheet_times.trans_num) > legacy_db(legacy_db.timesheet_times) is a shortcut for: legacy_db(legacy_db.timesheet_times._id > 0) which won't work for keyed tables. So, you have to use the full expanded notation: l

Re: [web2py] Re: How to build form is another action

2012-08-20 Thread Simon Carr
The idea was that after a comment is accepted and saved to the DB the user will be returned to the view_post() controller which will update the page so they can see the comment they just posted. I assumed that because I put view_post() under the if form.process().accepted: it would only be called w

Re: [web2py] Re: How to build form is another action

2012-08-20 Thread Anthony
def comment_form(post_id): is not an action. Functions that take arguments cannot be actions and are not reachable via URL. As you are using it, it is simply a helper function that is called from view_post() and generates and processes a form. The form itself is delivered as part of a call to t

[web2py] Re: routes.py changed but user still called from default

2012-08-20 Thread Anthony
Do you have a default.py controller with a user() function? Does the problem go away if you remove routes.py altogether? Anyway, instead of the routes you have (which is legacy functionality), you're better off using the parameter-based router to set the default application, controller, and fun

[web2py] Re: SQLFORM.factory + Multiple Tables + Upload Field + GAE Blob Problem

2012-08-20 Thread howesc
looks like it's still unsolved. i have not used SQLFORM.factory with multiple fields, and i have not used the blob data type in BigTable, rather i use blobstore image uploads. can you get it to work with just 1 table in your form? can you determine what vars are posted and what comes out of f

[web2py] Re: Is only first argument available for "ordering factor" with GAE?

2012-08-20 Thread howesc
you may also do orderby=db.mibmessage.end_time|~db.mibmessage.reg_time - that is a legal sort on GAE, it may not be what you want though. you know about select().sort(lambda r:...) right? i use that on GAE to get around extra indexes and illegal sorts. :) On Monday, August 20, 2012 7:20:05 AM

[web2py] Re: Table.import_from_csv_file preserving ids

2012-08-20 Thread howesc
given that each DB implements auto_increment differently that can be tricky. i know that some of them you would have to set a super-secret-really-well-known variable to let it know where to start the IDs at for the next insert when done. i suspect this works differently per DB and could be tr

[web2py] Re: Displaying a message following auth.requires_login() redirect

2012-08-20 Thread Anthony
Maybe try: def failed_authentication(url): session.flash = "You must be logged in to view this page" redirect(url) auth.settings.on_failed_authentication = failed_authentication Anthony On Monday, August 20, 2012 5:48:33 AM UTC-4, Rob Goldsmith wrote: > > Is it possible to display a mess

Re: [web2py] Re: How to build form is another action

2012-08-20 Thread Simon Carr
Thanks for the help Anthony, I understand now. Simon On 20 August 2012 23:46, Anthony wrote: > def comment_form(post_id): > > is not an action. Functions that take arguments cannot be actions and are > not reachable via URL. As you are using it, it is simply a helper function > that is called f

Re: [web2py] Re: routes.py changed but user still called from default

2012-08-20 Thread Jonathan Lundell
On 20 Aug 2012, at 3:51 PM, Anthony wrote: > Do you have a default.py controller with a user() function? Does the problem > go away if you remove routes.py altogether? > > Anyway, instead of the routes you have (which is legacy functionality), > you're better off using the parameter-based route

[web2py] Re: Pre-populate profile form

2012-08-20 Thread Anthony
You never processed the form. You have to call form.process() or form.accepts() for your variable assignments to get transferred to the widgets. Anthony On Monday, August 20, 2012 5:30:19 AM UTC-4, Daniel Gonzalez wrote: > > Hi, > > I am trying to pre-populate the profile form with some random

Re: [web2py] Re: Table.import_from_csv_file preserving ids

2012-08-20 Thread Alan Etkin
I am looking at the dal.Table.import_... function and It looks like the increment loop is made in case there are no contiguous ids. I'm trying also to modify the function so it can be set to use the old ids if specified. I'll submit a patch to issues if I am able to test it and works Thanks 2012/

Re: [web2py] Re: routes.py changed but user still called from default

2012-08-20 Thread Simon Carr
Your correct, i found the issue. I had removed default thinking i didn't need once i had written my other functions. Thanks for everyone's help this evening. Simon On 20 Aug 2012 23:51, "Anthony" wrote: > Do you have a default.py controller with a user() function? Does the > problem go away i

Re: [web2py] Re: Table.import_from_csv_file preserving ids

2012-08-20 Thread Alexei Vinidiktov
This web2py group thread may be of help: https://groups.google.com/forum/?fromgroups=#!topic/web2py/0X3ykXLmcEQ Also see issue: http://code.google.com/p/web2py/issues/detail?id=796 If I understand it correctly, it has been implemented in trunk. On Tue, Aug 21, 2012 at 6:14 AM, Alan Etkin wrote

Re: [web2py] Re: Table.import_from_csv_file preserving ids

2012-08-20 Thread Alan Etkin
El lunes, 20 de agosto de 2012 21:04:46 UTC-3, Alexei Vinidiktov escribió: > > This web2py group thread may be of help: > > https://groups.google.com/forum/?fromgroups=#!topic/web2py/0X3ykXLmcEQ > > Also see issue: http://code.google.com/p/web2py/issues/detail?id=796 If > I understand it correct

[web2py] Re: Suggestions for multiple files upload in form

2012-08-20 Thread udik
Thanks Paolo, your code helped me a lot resolving my multi-document upload requirement. I had to tweak it a bit, like photo title was empty if I did not specify one- I just used element.filename in those cases document_name =element.filename if not element.name.split(":")[-1] else element.name.

Re: [web2py] Re: Table.import_from_csv_file preserving ids

2012-08-20 Thread Alexei Vinidiktov
On Tue, Aug 21, 2012 at 7:18 AM, Alan Etkin wrote: > El lunes, 20 de agosto de 2012 21:04:46 UTC-3, Alexei Vinidiktov escribió: > >> This web2py group thread may be of help: >> >> https://groups.google.com/**forum/?fromgroups=#!topic/** >> web2py/0X3ykXLmcEQ

Re: [web2py] Re: Table.import_from_csv_file preserving ids

2012-08-20 Thread Alexei Vinidiktov
On Tue, Aug 21, 2012 at 7:58 AM, Alexei Vinidiktov < alexei.vinidik...@gmail.com> wrote: > > > On Tue, Aug 21, 2012 at 7:18 AM, Alan Etkin wrote: > >> El lunes, 20 de agosto de 2012 21:04:46 UTC-3, Alexei Vinidiktov escribió: >> >>> This web2py group thread may be of help: >>> >>> https://groups.

  1   2   >