[web2py] Re: Upload in GAE, SQLFORM.factory, multiple tables

2011-12-21 Thread Murray3
As per latest documentation: http://web2py.com/books/default/chapter/29/13#Deployment-recipes In model i have: db.define_table('test', Field('test', 'string'), Field('image', 'upload')) In controller I have: def test(): form = SQLFORM(db.test) return dict(form=form) In view I

[web2py] Re: new book now available in HTML (english, japanese, italian)

2011-12-21 Thread Stefan Scholl
Massimo Di Pierro massimo.dipie...@gmail.com wrote: The latest book edition (4th) is now available for free here: http://web2py.com/book I have http://web2py.com/book/ in my bookmarks and get an invalid request now.

Re: [web2py] Web Development Introduction Based On Web2py

2011-12-21 Thread Khalil KHAMLICHI
Looks nice to the eyes, looks interesting to the mind. Keep going.

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

2011-12-21 Thread Johann Spies
Show me the code of regstatus Regards Johann -- Because experiencing your loyal love is better than life itself, my lips will praise you. (Psalm 63:3)

Re: [web2py] Re: new book now available in HTML (english, japanese, italian)

2011-12-21 Thread Johann Spies
It is working for me. Perhaps you should try again. Regards Johann -- Because experiencing your loyal love is better than life itself, my lips will praise you. (Psalm 63:3)

Re: [web2py] Re: web2py on github

2011-12-21 Thread Daniel Aguayo Catalán
mdipierro escribió: I somebody wants to keep an official mirror there I have no objection. I prefer to stick with mercurial on Google because mercurial is 100% python. On Apr 5, 1:53 am, elffikkelff...@gmail.com wrote: hi, I use a few project stored on github, and I find it easier to

[web2py] Re: new book now available in HTML (english, japanese, italian)

2011-12-21 Thread Alan Etkin
Is the spanish translation on the roadmap? Latinuxpress has made the 3d edition. I opened a thread in the spanish group asking the same. How is the translation work being managed?. Is it open to colaboration? I see that for example the italian has the 3d edition label and there seems to be just

[web2py] Web-page freezes on db.define_table

2011-12-21 Thread Axel
Hi, I have just started with web2py, setting up a simple page with MySQL. In db.py I added/changed the following: db = DAL('mysql://root:xxx@localhost:3306/test') db.define_table('testdata',Field('idtestdata'),Field('nyckel'),Field('data')) But when accessing the app I get an error ticket:

Re: [web2py] Web-page freezes on db.define_table

2011-12-21 Thread Johann Spies
Hallo Axel, On 21 December 2011 12:23, Axel axelo...@gmail.com wrote: But when accessing the app I get an error ticket: Ticket ID 127.0.0.1.2011-12-21.11-11-59.27d5caca-b9cf-4f73-b3e7-4a7a61318e19 class 'gluon.contrib.pymysql.err.InternalError' (1060, uDuplicate column name 'nyckel')

[web2py] Re: Web-page freezes on db.define_table

2011-12-21 Thread Axel
Johann Spies johann.spies@... writes: The error message supplies the answer:  Duplicate column name 'nyckel'You cannot have two fields in the same table with the same name.RegardsJohann I can't see that I have duplicate column names in the statement:

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

2011-12-21 Thread Martín Mulone
I'm not sure what you want but you can pass args to grid. Like: row_id = request.args[0] query = (db.mytable.id == row_id) table = SQLFORM.grid(query, ... args=request.args, ... ) 2011/12/21 Rahul

[web2py] How to show uploaded file as a link in View ?

2011-12-21 Thread Rahul
All, Consider the below code in my sample web2py application --- Model-- db.py -- db.define_table('updates', Field('description', 'text', label='Post An Update'), Field('pfile','upload',label='Attach File', autodelete=True), ) Controller--- posts function in

Re: [web2py] Web Development Introduction Based On Web2py

2011-12-21 Thread Martín Mulone
good job marco. 2011/12/21 Khalil KHAMLICHI khamlichi.kha...@gmail.com Looks nice to the eyes, looks interesting to the mind. Keep going. -- http://martin.tecnodoc.com.ar

Re: [web2py] Re: Web-page freezes on db.define_table

2011-12-21 Thread Johann Spies
On 21 December 2011 12:42, Axel axelo...@gmail.com wrote: I can't see that I have duplicate column names in the statement: db.define_table('testdata',Field('idtestdata'),Field('nyckel'),Field('data')) Obviously, there are no duplicate column names in the database. Or am I missing something

Re: [web2py] Re: web2py on github

2011-12-21 Thread Daniel Aguayo Catalán
Daniel Aguayo Catalán escribió: mdipierro escribió: I somebody wants to keep an official mirror there I have no objection. I prefer to stick with mercurial on Google because mercurial is 100% python. On Apr 5, 1:53 am, elffikkelff...@gmail.com wrote: hi, I use a few project stored on

[web2py] Re: commenting out lines in views

2011-12-21 Thread Jim Gregory
Thanks for the helpful clarification! However, neither method will work if there is web2py template code embedded inside the comment, e.g.: {{''' pThis is my title: {{=response.title}}/p '''}} returns an EOF while scanning triple-quoted string literal error. Is there a method to comment out

[web2py] Re: Web-page freezes on db.define_table

2011-12-21 Thread Axel
Johann Spies johann.spies@... writes: Use the ticket interface to go to the line of code that caused the problem.  Maybe there is something in the controller that causes this.RegardsJohann The ticket interface says: Traceback (most recent call last): File gluon/restricted.py, line 204, in

[web2py] How to achieve more info from AD/LDAP auth and add those info into DB?

2011-12-21 Thread Dan
Hi all, I'm a newbie on web2py. I'm using web2py 1.99.4 and successfully used auth_ldap to pass the authentication, and after that I want to create AD user's info (DisplayName, Email, etc)into the database in db.py. But It seems that I only got the db.auth_user.name, others like

[web2py] Various grid questions/requests

2011-12-21 Thread Liam
First up, I'm new to web2py and am enjoying using it very much. Thanks Massimo! I'm using SQLFORM.grid and would like to update the fields of a table via AJAX without the user having to click edit then submit in a new page. eg. I have a table, one of the columns is a boolean value (this gets

[web2py] Bugtracker for web2py?

2011-12-21 Thread greenguerilla
Hi guys, I found a small error in the documentation and was looking for a bugtracker where I could log this. Can someone please pass me the url? Thanks, John

[web2py] Re: Web-page freezes on db.define_table

2011-12-21 Thread Axel
I just deleted and unzipped Web2Py again. And now it works. :) Perhaps it was my Python indentation, or that when I manually created the table in MySQL I used the wrong field type. I don't really know. Anyway, thank you for the help!

Re: [web2py] Re: Web-page freezes on db.define_table

2011-12-21 Thread Johann Spies
On 21 December 2011 14:15, Axel axelo...@gmail.com wrote: Johann Spies johann.spies@... writes: Use the ticket interface to go to the line of code that caused the problem. Maybe there is something in the controller that causes this.RegardsJohann The ticket interface says: Traceback

[web2py] From csv to web2py-model

2011-12-21 Thread Johann Spies
I have to build new models from csv-data files regularly and have written a small, primitive script to assist me in this. I have attached it. Maybe someone finds it useful. Usage: python model_from_csv.py somefile.csv It will print out a dictionary with a as keys the fields and values the

[web2py] What is the best way to migrate a production server to 1.99.4?

2011-12-21 Thread Cliff
The subject says it all. I have apps in production on a customer's intranet. The customer has asked for some enhancements. I plan to use smartgrid, but I need the 1.99.4 version. What is the best way to upgrade in this situation?

[web2py] Re: Web-page freezes on db.define_table

2011-12-21 Thread Axel
It must have been the files in web2py/applications/yourapp/database/. I will remember to try this if the problem occurs again. Dropping the table might not be an option in the future... Thanks again for your help.

[web2py] Re: Various grid questions/requests

2011-12-21 Thread Cliff
I'm using SQLFORM.grid and would like to update the fields of a table via AJAX without the user having to click edit then submit in a new page. You can learn how to do this and more here: http://web2py.com/books/default/chapter/29/11 Another request is a way to specify my own create and edit

Re: [web2py] Re: Web-page freezes on db.define_table

2011-12-21 Thread Johann Spies
On 21 December 2011 15:04, Axel axelo...@gmail.com wrote: It must have been the files in web2py/applications/yourapp/database/. I will remember to try this if the problem occurs again. Dropping the table might not be an option in the future... Be careful with those files. If you delete

[web2py] need help with xmlrpclib

2011-12-21 Thread Mirek Zvolský
I have a xmlrpc service in Web2py (1.99.3 or 1.99.4). When I try: import xmlrpclib server = xmlrpclib.ServerProxy('https://zvolsky: @www.ereceipts-server.com:8001/ereceipts_server/services/call/xmlrpc', verbose=True) server.gettime() then I receive proper result from gettime() method and

[web2py] Re: web2py online book doesn't display chapter numbers

2011-12-21 Thread Yarin
Also, we need a way to link to the section header anchors FROM the header. No way to save your spot on a page. On Dec 20, 11:11 am, António Ramos ramstei...@gmail.com wrote: Also a Next Previous link in the end of each page would avoid going back to the top of the page to select other chapters

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

2011-12-21 Thread Cliff
Rahul, What is not working? When you click the button, does your reqstatus function fire at all? You can find out by inserting print 'hello, world' as the first line of the function, then looking at the web2py console for output. If you run in command line, the rocket output shows up in the

[web2py] Re: Upload in GAE, SQLFORM.factory, multiple tables

2011-12-21 Thread Murray3
reply to post not showing in group? anyway if any ideas to below problem, help appreciated. wrote: As per latest documentation:http://web2py.com/books/default/chapter/29/13#Deployment-recipes In model i have: db.define_table('test',     Field('test', 'string'),     Field('image',

[web2py] Re: Combine SQLFORM and SQLFORM.grid?

2011-12-21 Thread Cliff
Remember web2py uses the term 'form' in a very specific way. So don't think about a web2py form for CRUD operations on child records. You need a way to dynamically update the web page so it can manage the child records. Web2py provides several approaches to this problem. The image blog example

[web2py] Re: new book now available in HTML (english, japanese, italian)

2011-12-21 Thread Stefan Scholl
Johann Spies johann.sp...@gmail.com wrote: [-- text/plain, encoding 7bit, charset: ISO-8859-1, 8 lines --] It is working for me. Perhaps you should try again. Nope, still gone. When I look at the response header I see it's a 404 NOT FOUND. http://web2py.com/book/ instead of

Re: [web2py] Re: Developers - Vancouver, BC area

2011-12-21 Thread Bruce Wade
Yeah we will add it to the list once it is migrated :D The site is live by pyramid right now: youadworld.com On Tue, Dec 20, 2011 at 9:23 PM, Anthony abasta...@gmail.com wrote: Oh, sorry, you said you *will *be migrating it -- I guess we'll have to wait to list it. :-) On Wednesday,

Re: [web2py] Re: web2py on github

2011-12-21 Thread Bruce Wade
My problem with bitbucket is the 5 cap for free private, if you are wanting to use git and keep the projects public I recommend gitorious. 2011/12/21 Daniel Aguayo Catalán daniel.agu...@gmail.com Daniel Aguayo Catalán escribió: mdipierro escribió: I somebody wants to keep an official

[web2py] Re: Web Development Introduction Based On Web2py

2011-12-21 Thread carlo
this is remarkable! I hope to see next chapters very soon..thank you

Re: [web2py] Re: web2py on github

2011-12-21 Thread Chandrakant Kumar
the 5 users cap is only for free private repos, not for public repos. On Wed, 21 Dec 2011 20:14:51 +0530, Bruce Wade bruce.w...@gmail.com wrote: My problem with bitbucket is the 5 cap for free private, if you are wanting to use git and keep the projects public I recommend gitorious.

[web2py] Re: Various grid questions/requests

2011-12-21 Thread Anthony
I'm using SQLFORM.grid and would like to update the fields of a table via AJAX without the user having to click edit then submit in a new page. eg. I have a table, one of the columns is a boolean value (this gets displayed as a checkbox), the user can click the checkbox and the table

Re: [web2py] Re: web2py on github

2011-12-21 Thread Daniel Aguayo Catalán
Bruce Wade escribió: My problem with bitbucket is the 5 cap for free private, if you are wanting to use git and keep the projects public I recommend gitorious. I like gitorious because it's FLOSS and 'eats its own dog food' (gitorious code is hosted on gitorious), but private projects **for

Re: [web2py] Re: web2py on github

2011-12-21 Thread Anthony
On Wednesday, December 21, 2011 9:44:51 AM UTC-5, Detectedstealth wrote: My problem with bitbucket is the 5 cap for free private At least they have a free option for private repositories -- github does not. Does anyone offer free private repositories with unlimited collaborators?

Re: [web2py] Web Development Introduction Based On Web2py

2011-12-21 Thread Chandrakant Kumar
In the section 3.2, where you create the .hgignore file, why did you put '*' in there, that will make hg ignore all files in current directory. On Wed, 21 Dec 2011 00:03:21 +0530, ma...@rockiger.com rocki...@googlemail.com wrote: I published the first 3 chapters of my web development

[web2py] Re: From csv to web2py-model

2011-12-21 Thread Anthony
You might also find this useful (perhaps could incorporate with model_from_csv to identify more field types automatically): http://code.google.com/p/csvstudio/ Anthony On Wednesday, December 21, 2011 7:53:54 AM UTC-5, spyker wrote: I have to build new models from csv-data files regularly and

[web2py] how to present rows in multiple pages

2011-12-21 Thread thodoris
I have a query that returns many (45) results and i want to l present 10 rows per page and have links at the bottom with the page numbers (1,2,3,4,5 and maybe a button next or previews). How can i implement this in web2py? Thnx

[web2py] Re: commenting out lines in views

2011-12-21 Thread Anthony
On Wednesday, December 21, 2011 6:58:42 AM UTC-5, Jim Gregory wrote: Thanks for the helpful clarification! However, neither method will work if there is web2py template code embedded inside the comment, e.g.: {{''' pThis is my title: {{=response.title}}/p '''}} returns an EOF

[web2py] Re: how to present rows in multiple pages

2011-12-21 Thread Anthony
The easiest way is probably using SQLFORM.grid: http://web2py.com/books/default/chapter/29/7#SQLFORM.grid-and-SQLFORM.smartgrid-(experimental). Otherwise, you can handle the pagination manually -- here's an example: http://web2py.com/books/default/chapter/29/14#Pagination (note, it doesn't

[web2py] Re: how to present rows in multiple pages

2011-12-21 Thread Omi Chiba
You can also use the plugin. http://dev.s-cubism.com/plugin_paginator I use both SQLFORM.grid and this plugin depending on if the id filed is available on the table. On Dec 21, 9:39 am, thodoris pasxi...@gmail.com wrote: I have a query that returns many (45) results and i want to l present 10

[web2py] Re: How to show uploaded file as a link in View ?

2011-12-21 Thread Anthony
On Wednesday, December 21, 2011 5:54:43 AM UTC-5, Rahul wrote: form = crud.create(db.updates) if form.accepts(request.vars, session): FYI, crud.create() automatically handles the form processing, so you do not need to do form.accepts() when using Crud (only when using FORM or

Re: [web2py] Re: generating PDF invoices

2011-12-21 Thread Adnan Smajlovic
Thanks Cliff. Will look into PDF creation. On Tue, Dec 20, 2011 at 10:18 PM, Cliff cjk...@gmail.com wrote: The browser controls the content of those headers and footers, according to user settings. I don't think there is a way to override it. If you want total control you need to present a

Re: [web2py] Re: Overriding Grid/Smartgrid's 'Edit/Delete/View'

2011-12-21 Thread Adnan Smajlovic
Great. works perfect! Thanks a lot. On Tue, Dec 20, 2011 at 10:14 PM, Cliff cjk...@gmail.com wrote: You can learn more here: http://web2py.com/books/default/chapter/29/7#SQLFORM.grid-and-SQLFORM.smartgrid-(experimental) On Dec 20, 8:57 pm, Jim Steil j...@qlf.com wrote: Yes, you can pass

[web2py] Re: Upload in GAE, SQLFORM.factory, multiple tables

2011-12-21 Thread Murray3
On Dec 21, 1:44 pm, Murray3 cjjmur...@gmail.com wrote: reply to post not showing in group? anyway if any ideas to below problem, help appreciated. wrote: As per latest documentation:http://web2py.com/books/default/chapter/29/13#Deployment-recipes In model i have:

[web2py] error: ('IS_IN_SET' object has no attribute 'startswith')

2011-12-21 Thread Chandrakant Kumar
I'm passing a tuple of strings to IS_IN_SET validator, but i'm getting this error - type 'exceptions.AttributeError'('IS_IN_SET' object has no attribute 'startswith') code is - Field('state', IS_IN_SET(STATE_LIST)), where STATE_LIST is a tuple of strings. -- Using Opera's revolutionary

Re: [web2py] Web Development Introduction Based On Web2py

2011-12-21 Thread ma...@rockiger.com
Thats a typo, it should be* *~* for editor backup files. Thank you

Re: [web2py] Re: Web-page freezes on db.define_table

2011-12-21 Thread Adnan Smajlovic
Can they be recreated if they get lost/corrupted through fake_migrate=True? On Wed, Dec 21, 2011 at 8:16 AM, Johann Spies johann.sp...@gmail.comwrote: On 21 December 2011 15:04, Axel axelo...@gmail.com wrote: It must have been the files in web2py/applications/yourapp/database/. I will

[web2py] Linking to uploaded files (when using separate folders)

2011-12-21 Thread Yarin
I have an image table, modified from the image_blog example, like this: db.define_table('image', Field('title', unique=True), Field('file', 'upload', uploadfolder=os.path.join(request.folder,'static/userpics'), uploadseparate=True) ) I want to be able to generate a static link to the

Re: [web2py] Web Development Introduction Based On Web2py

2011-12-21 Thread ma...@rockiger.com
actually it is a problem with markmin plugin, it kills the ~

[web2py] Re: Web Development Introduction Based On Web2py

2011-12-21 Thread ma...@rockiger.com
Maybe a view dns server do not know about the domain. The domain is hosted in Germany and the website on Fluxflex (this means Amazon cloud?).

Re: [web2py] Web Development Introduction Based On Web2py

2011-12-21 Thread ma...@rockiger.com
Should go away, when all dns servers are updated.

[web2py] Re: error: ('IS_IN_SET' object has no attribute 'startswith')

2011-12-21 Thread DenesL
On Dec 21, 11:41 am, Chandrakant Kumar k.03chan...@gmail.com wrote: I'm passing a tuple of strings to IS_IN_SET validator, but i'm getting this error - type 'exceptions.AttributeError'('IS_IN_SET' object has no attribute 'startswith') code is - Field('state', IS_IN_SET(STATE_LIST)),

[web2py] Re: Is there any mainstream wysiwyg html editor in web2py world?

2011-12-21 Thread Ray (a.k.a. Iceberg)
Anthony, thank you for your input. And thank you too, Ross. I did some evaluation in these days. Now I gonna share my thoughts. elrte and ckeditor and tinymce etc. are definitely feature-riched, at the same time somwhat bloated. Each sizes 135KB, 355KB, 203KB, respectively. (How could this be

Re: [web2py] Re: error: ('IS_IN_SET' object has no attribute 'startswith')

2011-12-21 Thread Chandrakant Kumar
ah, that was silly of me, thank you for the correction. On Wed, 21 Dec 2011 22:39:29 +0530, DenesL denes1...@yahoo.ca wrote: On Dec 21, 11:41 am, Chandrakant Kumar k.03chan...@gmail.com wrote: I'm passing a tuple of strings to IS_IN_SET validator, but i'm getting this error - type

[web2py] Re: commenting out lines in views

2011-12-21 Thread Jim Gregory
I'm mainly testing some changes to the template and not sure if I want to keep them or not. Guess I'll take your advice and just keep each copy in version control, and roll back to previous versions as necessary. -Jim On Dec 21, 9:44 am, Anthony abasta...@gmail.com wrote: On Wednesday,

[web2py] Re: Is there any mainstream wysiwyg html editor in web2py world?

2011-12-21 Thread LightDot
I agree, most of the better known editors are bloated. I try to keep away if I can, especially from tiny and ckeditor. I haven't used elrte before, it seems a bit better. I have used jHtmlArea on a couple of projects with success, but lately I prefer WYMeditor. The .js is about 120kb minified,

[web2py] Re: how to present rows in multiple pages

2011-12-21 Thread lyn2py
I was wondering... pagination is a very common task on webpages, is there a reason why it isn't included in web2py (and requires a plugin or hardcoding)? Thanks! On Dec 22, 12:00 am, Omi Chiba ochib...@gmail.com wrote: You can also use the plugin.http://dev.s-cubism.com/plugin_paginator I use

Re: [web2py] Re: Is there any mainstream wysiwyg html editor in web2py world?

2011-12-21 Thread Vasile Ermicioi
I am developing one, I already use it on production, for a cms and for a forum. Works fine on all browsers except ie :( Planning for next weeks to make a page with docs and to fix ie bugs. A few features that I am proud of: - inserting html (e.g for inserting code of a embedded video from

Re: [web2py] Re: Is there any mainstream wysiwyg html editor in web2py world?

2011-12-21 Thread Vasile Ermicioi
just noticed that 9kb jHtmlArea also uses jquery, so it is 9kb + size of jquery

Re: [web2py] Re: Is there any mainstream wysiwyg html editor in web2py world?

2011-12-21 Thread LightDot
Well, jQuery is neded by web2py anyway.

[web2py] Re: Linking to uploaded files (when using separate folders)

2011-12-21 Thread Adi
wouldn't this bring exactly the path where you store it: div id=image-divimg src={{=URL('download', args=image.file)}} width=100px alt=some text //div maybe i'm missing the mark?

[web2py] Need help hiding inactive records from smartgrid

2011-12-21 Thread Cliff
In business applications it is generally a bad idea to delete records of purchases, sales, etc. At the same time you want indexes to include records of active things, such as active customers. A simple way to manage this requirement is to use an is_active boolean field. Then in your index

Re: [web2py] Web Development Introduction Based On Web2py

2011-12-21 Thread Daniel Aguayo Catalán
ma...@rockiger.com escribió: Should go away, when all dns servers are updated. Hi, at http://killer-web-development.com/section/1/3 shows a diagram that try to explain the MVC pattern that says: [USER - CONTROLLER - VIEW, USER - CONTROLLER - MODEL - DATABASE] ...but I think it should be

[web2py] Re: Is there any mainstream wysiwyg html editor in web2py world?

2011-12-21 Thread Ray (a.k.a. Iceberg)
The idea of uploading image to external and free server is clever! I love this idea! However your demo link does not work for uploading image. By the way, your upload feature is based on swf? So your site won't support ipad/iphone user? And what do you mean works fine ... except ie? Do you mean

Re: [web2py] Re: From csv to web2py-model

2011-12-21 Thread Johann Spies
On 21 December 2011 17:38, Anthony abasta...@gmail.com wrote: You might also find this useful (perhaps could incorporate with model_from_csv to identify more field types automatically): http://code.google.com/p/csvstudio/ Thanks. Johann -- Because experiencing your loyal love is better

[web2py] SQLFORM doesn't render attributes adjusted after form creation

2011-12-21 Thread Vinicius Assef
In web2py book, on chapter FORMS and VALIDATORS, section Forms and Validators, it's written: --- FORM and SQLFORM are helpers and they can be manipulated in as similar way as the DIV. For example you can set a form style: 1. form = SQLFORM(..) 2.

[web2py] Re: Is there any mainstream wysiwyg html editor in web2py world?

2011-12-21 Thread Ray (a.k.a. Iceberg)
Hi LightDot, Thanks for the remind. Actually WYMeditor was on my radar. I love its clean output code philosophy. However its default look-and-feel could surprise my end users, I am afraid. For example, those heading 1/2/3/.../6 containers look scary red when editing, although they look normal

[web2py] Re: Linking to uploaded files (when using separate folders)

2011-12-21 Thread Yarin
@Adi- you're right- I was trying trying to bypass the download function and use a static link, but now that you mention it I don't see why I'd need to- this works fine- thanks. On Dec 21, 1:18 pm, Adi adnan.smajlo...@gmail.com wrote: wouldn't this bring exactly the path where you store it: div

[web2py] Re: Linking to uploaded files (when using separate folders)

2011-12-21 Thread Yarin
I was trying trying to bypass the download function and use a static link According to Massimo: In 'uploads' if you need authorization. In 'static' if you do not. In the latter you do not need to worry about authorization and you can let the web server by-pass web2py I actually think the

[web2py] Re: SQLFORM doesn't render attributes adjusted after form creation

2011-12-21 Thread Anthony
That method will work in general, but not with form.custom.begin and form.custom.end specifically. I guess we should make that clear in the book. Anthony On Wednesday, December 21, 2011 1:44:03 PM UTC-5, viniciusban wrote: In web2py book, on chapter FORMS and VALIDATORS, section Forms and

Re: [web2py] Need help hiding inactive records from smartgrid

2011-12-21 Thread Jim Steil
Right, but you can pass a query along in the constraints argument. Here is a sample pulled from one of my apps: # Build query if searchText and searchText .strip() != '': queries.append(db.asset.description.contains(searchText)) if assetTypeId and assetTypeId 0:

[web2py] Computed field

2011-12-21 Thread Jose Carlos Junior
People, How can I make the field NR_INDISPONIBILIDADE the table below (chamado) in a computed field with the difference between the field dates DT_FECHAMENTO and DT_ABERTURA. Thank you, db.define_table(chamados ,Field('ID_CHAMADOS',type='id',readable=False)

Re: [web2py] Re: web2py on github

2011-12-21 Thread Willoughby
Short Answer: Because that's what the developers wanted and agreed to. Search the web2py-developer group for the months long discussion on changing it if you really want to know On Wednesday, December 21, 2011 10:20:38 AM UTC-5, Daniel Aguayo wrote: I know that web2py doesn't need a private

[web2py] Adding user to a group after registration

2011-12-21 Thread Chandrakant Kumar
I'm attempting to add a user to a group , depending on the role he chose from a dropdown list. for e.g., In the register form user is presented an option of choosing user type 1. individual 2. organisation how do i add the user to the appropriate group depending on his selection? (i

[web2py] Re: Linking to uploaded files (when using separate folders)

2011-12-21 Thread Anthony
It's tricky, but everything you need is in the encoded filename. With uploadseparate=True, the file is stored in a subfolder named /table.field/[first 2 characters of filename uuid]. Try something like this: sub = file.split('.') url = URL('static', 'userpics/%s.%s/%s/%s' % (sub[0], sub[1],

[web2py] Re: Combine SQLFORM and SQLFORM.grid?

2011-12-21 Thread apple
I have done something similar to what you are looking for but it was a little fiddly in places (if someone can suggest a better way I would be delighted!). My application had some extra functionality but the gist of it is: You have a form and a grid. You can put these on the same page easily

Re: [web2py] Adding user to a group after registration

2011-12-21 Thread Anthony
You can use an auth.settings.register_onaccept function, which could use auth.add_membership() to add the appropriate membership for the new user. Anthony On Wednesday, December 21, 2011 3:00:20 PM UTC-5, Chandra wrote: I'm attempting to add a user to a group , depending on the role he chose

Re: [web2py] Computed field

2011-12-21 Thread Jim Steil
Here's what I would try: Field('difference', compute=lambda u: (u['DT_FECHAMENTO '] - u['DT_ABERTURA ']), label='Difference') This is untested. I haven't used compute fields based on a math function before, but like I said, this is what I'd try first. Hope this helps. -Jim On

[web2py] Re: Is there any mainstream wysiwyg html editor in web2py world?

2011-12-21 Thread pbreit
The state of WYSIWYG textarea editing is horrible. The big 2, TinyMCE and CKEditor are bloated and have lousy UI/UX. There are a zillion less bloated options but hardly any that are decent. I used NicEdit which is OK but I don't think the developer is still working on it.

[web2py] Re: Is there any mainstream wysiwyg html editor in web2py world?

2011-12-21 Thread Anthony
CLEANUP(re.compile('script.*?/script', re.S|re.I)) It's not enough to exclude only script tags -- you're better off allowing only a whitelist of tags and attributes. When displaying the output, you could do XML(user_html, sanitize=True). See

[web2py] GAE SQLFORM not inserting into datastore

2011-12-21 Thread Murray3
As per latest documentation: http://web2py.com/books/default/chapter/29/13#Deployment-recipes In model i have: db.define_table('test',     Field('test', 'string'),     Field('image', 'upload')) In controller I have: def test():     form = SQLFORM(db.test)     return dict(form=form) In view I have:

[web2py] Re: Web Development Introduction Based On Web2py

2011-12-21 Thread kasapo
Another way of looking at it is that the user is presented with views (or more accurately, HTML rendered from a view by a controller using the models) but interacts with controllers. Whenever a user clicks on an application link on a view, the browser sends a request and the controller handles it

[web2py] Re: Combine SQLFORM and SQLFORM.grid?

2011-12-21 Thread apple
I missed a bit..[I did say it was a bit fiddly!] You still need to refresh the grid when the dialog box closes. To do this I replaced the LOAD calls with load2 which adds a url to the component: def load2(**args): calls LOAD and sets url attribute to enable easy refresh of the component

[web2py] Re: LDAP DAL Adapter Help

2011-12-21 Thread Bruno Lottero
I went for something like this: DAL https://web2py.agro.uba.ar/examples/global/vars/DAL( 'ldap://server:port', driver_args={'dn': 'cn=admin,ou=People,dc=example,dc=com', 'password':'password'}) Ok, now i have to find out how to make define_table() to work with ldap tree model Cheers.

[web2py] Re: Problem with Web2py sql that includes % on Postgres; breaking New Relic

2011-12-21 Thread pbreit
Graham sent me a patched NewRelic agent (version 1.0.6.176) which appears to be working fine.

[web2py] Re: Web Development Introduction Based On Web2py

2011-12-21 Thread kasapo
Found an error with the links in the Complete API section ( /api ) e.g. http://killer-web-development.com/docstring/SQLFORM Any request that goes to docstring seems to generate an error. Rock on and keep those chapters coming! On Dec 20, 12:33 pm, ma...@rockiger.com rocki...@googlemail.com

[web2py] Fwd: PyCon 2012: Talk acceptance - web2py: ideas we stole and ideas we had

2011-12-21 Thread Massimo DiPierro
:-) Begin forwarded message: From: ja...@jacobian.org Subject: PyCon 2012: Talk acceptance - web2py: ideas we stole and ideas we had Date: December 21, 2011 2:25:39 PM CST To: mdipie...@cs.depaul.edu Dear Massimo Di Pierro, I'm very pleased tell you that your talk has been accepted for

Re: [web2py] Fwd: PyCon 2012: Talk acceptance - web2py: ideas we stole and ideas we had

2011-12-21 Thread Michele Comitini
Bravo ;-) 2011/12/21 Massimo DiPierro mdipie...@cs.depaul.edu: :-) Begin forwarded message: From: ja...@jacobian.org Subject: PyCon 2012: Talk acceptance - web2py: ideas we stole and ideas we had Date: December 21, 2011 2:25:39 PM CST To: mdipie...@cs.depaul.edu Dear Massimo Di

Re: [web2py] LDAP: Mapping additional AD fields to Auth_user

2011-12-21 Thread brunoelottero
I will give this a try, i only have openldap available for testing purposes, but it should work for MS too.

Re: [web2py] Adding user to a group after registration

2011-12-21 Thread Chandrakant Kumar
I didn't even know that existed, but that worked exactly like i wanted, thanks. I thought i should post the code, if anybody in future needs it: #controllers/default.py def __add_user_membership(form): group = db(db.auth_group.role==form.vars.user_type).select().first()

[web2py] Re: PyCon 2012: Talk acceptance - web2py: ideas we stole and ideas we had

2011-12-21 Thread Anthony
Congratulations!

Re: [web2py] Adding user to a group after registration

2011-12-21 Thread Chandrakant Kumar
better version : def __add_user_membership(form): group_id = auth.id_group(role=form.vars.user_type) user_id = form.vars.id auth.add_membership(group.id,user_id) On Thu, 22 Dec 2011 01:52:50 +0530, Anthony abasta...@gmail.com wrote: You can use an

[web2py] Re: Fwd: PyCon 2012: Talk acceptance - web2py: ideas we stole and ideas we had

2011-12-21 Thread Alan Etkin
Nice email. Will the talk have video broadcast trough vimeo/ youtube/...? On 21 dic, 18:09, Massimo DiPierro mdipie...@cs.depaul.edu wrote: :-) Begin forwarded message: From: ja...@jacobian.org Subject: PyCon 2012: Talk acceptance - web2py: ideas we stole and ideas we had Date:

Re: [web2py] Re: Fwd: PyCon 2012: Talk acceptance - web2py: ideas we stole and ideas we had

2011-12-21 Thread Khalil KHAMLICHI
World wide this time.

  1   2   >