[web2py] Possible to do secondary, ternary..., n-ary orderby in grid?

2013-08-20 Thread Lamps902
Is it possible to do a ranked/n-ary/sequenced orderby in SQLFORM.grid? For example, let's say you list user information in a grid, which includes first name, last name, and middle name. It's possible to use orderby to order the users by last name. Is it possible to order by last name, then

Re: [web2py] Possible to do secondary, ternary..., n-ary orderby in grid?

2013-08-20 Thread Lamps902
Awesome - thanks! On Tuesday, August 20, 2013 8:57:21 AM UTC-5, Jonathan Lundell wrote: On 20 Aug 2013, at 6:45 AM, Lamps902 dhea...@gmail.com javascript: wrote: Is it possible to do a ranked/n-ary/sequenced orderby in SQLFORM.grid? For example, let's say you list user information

[web2py] Re: Values in request.vars persist/doubled when form submitted after unexpected logout/session deletion

2013-08-09 Thread Lamps902
11:26:05 AM UTC-4, Lamps902 wrote: The method of the forms was left at default/wasn't explicitly set, so they had the 'post' method. Setting the method to 'get' seems to fix the problem. Hmm, I would have expected the opposite. Can you show an example of code that produces the problem

[web2py] Re: Values in request.vars persist/doubled when form submitted after unexpected logout/session deletion

2013-08-07 Thread Lamps902
your form happen to be a GET form rather than a POST form? Anthony On Tuesday, August 6, 2013 10:21:06 PM UTC-4, Lamps902 wrote: I have a controller function which is protected by a standard authentication decorator (@auth.requires_login()). The function presents a page containing some

[web2py] Re: Values in request.vars persist/doubled when form submitted after unexpected logout/session deletion

2013-08-07 Thread Lamps902
to login. Does your form happen to be a GET form rather than a POST form? Anthony On Tuesday, August 6, 2013 10:21:06 PM UTC-4, Lamps902 wrote: I have a controller function which is protected by a standard authentication decorator (@auth.requires_login()). The function presents a page

[web2py] Manually creating multiple buttons to be used with SQLFORM.grid's 'selectable' parameter

2013-08-07 Thread Lamps902
I am attempting to create multiple buttons for an SQLFORM.grid which, upon being click, will have the effect of redirecting data selected in the grid's checkboxes to other controller functions. The code is something like the following: def redirect_func(x): if request.vars.action ==

[web2py] Re: Manually creating multiple buttons to be used with SQLFORM.grid's 'selectable' parameter

2013-08-07 Thread Lamps902
Nevermind. Took care of it by creating a series of images to be used as buttons, and using jquery to append a hidden var specifying to which function the redirect should go, and to submit the form contained within the grid. -- --- You received this message because you are subscribed to

[web2py] Values in request.vars persist/doubled when form submitted after unexpected logout/session deletion

2013-08-06 Thread Lamps902
I have a controller function which is protected by a standard authentication decorator (@auth.requires_login()). The function presents a page containing some forms (which contain a bunch of INPUTS() of _type = 'hidden' and one INPUT(_type = 'image', which presents the submission button). If a

[web2py] Re: Rendering image buffer with IMG() helper?

2013-07-15 Thread Lamps902
. Anthony On Monday, July 8, 2013 3:43:22 PM UTC-4, Lamps902 wrote: Maybe I'm a bit confused on how to generate/stream the image, given the buffer. The following should work, right? def render_image(): return Image.open(request.vars.image_buffer) ... img_buffer = io.BytesIO

[web2py] Possible to use pylab for visualization in web2py environment?

2013-07-08 Thread Lamps902
Is it possible to use pylab in web2py to generate a visualization? Something along these lines: import pylab x, y = ... pylab.plot(x,y) pylab.show() Doing so produces this error: no display name and no $DISPLAY environment variable Thank you. -- --- You received this message because you

[web2py] Rendering image buffer with IMG() helper?

2013-07-08 Thread Lamps902
I'm attempting to do the following: img_buffer = io.BytesIO() pylab.savefig(img_buffer, format = 'png') img_buffer.seek(0) IMG(_src=img_buffer, _alt = 'image buffer not displaying') This shows the _alt message. Any ideas on how to get it to show the image? Thanks. -- --- You received this

[web2py] Re: Rendering image buffer with IMG() helper?

2013-07-08 Thread Lamps902
of an image element should be a URL where the browser can request the image. You cannot pass an actual image file object to the helper. Anthony On Monday, July 8, 2013 1:38:56 PM UTC-4, Lamps902 wrote: I'm attempting to do the following: img_buffer = io.BytesIO() pylab.savefig(img_buffer

[web2py] Re: Rendering image buffer with IMG() helper?

2013-07-08 Thread Lamps902
Maybe I'm a bit confused on how to generate/stream the image, given the buffer. The following should work, right? def render_image(): return Image.open(request.vars.image_buffer) ... img_buffer = io.BytesIO() pylab.savefig(img_buffer, format = 'png') img_buffer.seek(0)Enter code here...

[web2py] Re: using _after_delete callback when enable_record_versioning() is used

2013-06-11 Thread Lamps902
, result in a list index out of range error (I guess I can't access the object as a result of is_active being set to False?). On Monday, June 10, 2013 10:31:24 PM UTC-5, Anthony wrote: Can you use the _after_update callback instead? On Monday, June 10, 2013 5:32:12 PM UTC-4, Lamps902 wrote

[web2py] Rendering null values in SQLFORM.grid

2013-06-10 Thread Lamps902
If there's a NULL value in my postgresql DB, SQLFORM.grid renders it as None. Is it there something that can be done globally for an SQLFORM.grid that would simply make it display all NULL values as an empty string (i.e. not display anything in the grid for NULLs), or does that have to be

[web2py] Re: Rendering null values in SQLFORM.grid

2013-06-10 Thread Lamps902
a default='' on the interested fields. Il giorno lunedì 10 giugno 2013 15:42:21 UTC+2, Lamps902 ha scritto: If there's a NULL value in my postgresql DB, SQLFORM.grid renders it as None. Is it there something that can be done globally for an SQLFORM.grid that would simply make it display all

[web2py] Key/constraint issue when using separate database for archiving

2013-06-10 Thread Lamps902
I've asked this one before, but didn't get an answer; perhaps I was being too vague, so I'll give it another shot with more detail: I've got a primary postgresql database (db1), and I've set up a separate postgresql database (db1_archive) used for archiving several of the tables from db1.

[web2py] using _after_delete callback when enable_record_versioning() is used

2013-06-10 Thread Lamps902
When enable_record_versioning is being utilized, db rows aren't actually deleted, but the is_active bit is flipped off instead. As far as I can tell, this means that the _after_delete callback for a given table won't be called, which is problematic when you are using this callback to

[web2py] Re: Key/constraint issue when using separate database for archiving

2013-06-10 Thread Lamps902
that into account in their own code, so I think it can be a safe thing to do. On Monday, June 10, 2013 5:56:09 PM UTC+2, Lamps902 wrote: I've asked this one before, but didn't get an answer; perhaps I was being too vague, so I'll give it another shot with more detail: I've got a primary postgresql

[web2py] Re: Removing Foreign Key constraint?

2013-06-06 Thread Lamps902
To clarify, due to the SQL Foreign Key constraint (which is retained when archive tables are created through auth.enable_record_versioning), some of the archive database's tables still retain an association with the auth_user table's id field. However, the rows with the ids on which the new

[web2py] Removing Foreign Key constraint?

2013-06-05 Thread Lamps902
For purposes of archiving, I've created a new db, and archived some tables using auth.enable_record_versioning(db, tables=[...]). Among other things, this has the effect of migrating Foreign Key constraints from the original tables, so the *modified_by*, and *created_by* fields in the tables in

[web2py] Gateway time-out 504 error with enable_record_versioning

2013-06-04 Thread Lamps902
I've defined a new db to be used for archiving purposes with the following: db_archive = DAL(postgres://[address/authentication_info]/db_archive) Then, I attempt to enable archiving of a table by doing this: db.[table_name]._enable_record_versioning(db_archive) The app seems to be successfully

[web2py] Re: Gateway time-out 504 error with enable_record_versioning

2013-06-04 Thread Lamps902
Nevermind - sorted it out. Seems that a bunch of my tables had a dependency on auth_user, and since a new db was created, with table names set to [original_table_name]_archive by default, there was no auth_user table, and the dependency was not being satisfied. If using

[web2py] Excessive memory usage with uwsgi/nginx

2013-06-03 Thread Lamps902
My web2py application is running on Webfaction's servers over uwsgi/nginx. When the servers are started, four instances of nginx and four instances of uwsgi are spawned, with each nginx instance taking up ~18M of RAM, and each nginx instance taking up a couple of M. Accessing any part of the

Re: [web2py] Excessive memory usage with uwsgi/nginx

2013-06-03 Thread Lamps902
Thanks, Roberto. It was eventually growing to something in excess of 80M per uwsgi instance, then crashing when all are full. Will try the settings you suggested. On Monday, June 3, 2013 9:32:10 AM UTC-5, Roberto De Ioris wrote: 30-40 MB per worker is pretty normal. To gain memory you can

Re: [web2py] Excessive memory usage with uwsgi/nginx

2013-06-03 Thread Lamps902
perplexing, as it seems to undermine the whole notion of the MVC framework). On Monday, June 3, 2013 11:55:02 AM UTC-5, Massimo Di Pierro wrote: Mind that caching too much stuff will do that to you. On Monday, 3 June 2013 10:04:25 UTC-5, Lamps902 wrote: Thanks, Roberto. It was eventually growing

Re: [web2py] Excessive memory usage with uwsgi/nginx

2013-06-03 Thread Lamps902
, Lamps902 wrote: Hi, Massimo. I didn't cache much at first, and to make sure that caching isn't the source of the problem, I tried removing all caching. No noticeable improvement there. Right now, I'm focused on moving a lot of the model db and global var/settings stuff to modules (but I find

[web2py] Re: After update web2py version, invalid login.

2013-05-31 Thread Lamps902
Did you perform an sqlite - postgresql migration which left a bunch of trailing whitespace in various fields? On Sunday, May 26, 2013 3:02:02 AM UTC-5, toni campins wrote: Hi, Why after update web2py i have to edit all passwords for invalid login? Thanks -- --- You received this

[web2py] Re: Making RSS feed auto-detectable?

2013-05-29 Thread Lamps902
Anyone knowledgeable in RSS care to take a crack at this one? -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more

[web2py] Re: Making RSS feed auto-detectable?

2013-05-29 Thread Lamps902
it's not working in a page that has some broken HTML where Sage parser's life is harder). Il giorno mercoledì 29 maggio 2013 14:09:45 UTC+2, Lamps902 ha scritto: Anyone knowledgeable in RSS care to take a crack at this one? -- --- You received this message because you are subscribed

[web2py] Making RSS feed auto-detectable?

2013-05-23 Thread Lamps902
I've added the following RSS feed function to my default controller: def updatefeed(): list_of_rss_entry_dicts = [ dict(title = data_set.f_headline, link = 'http://' + settings.domain_name, description =

[web2py] Twitter post function producing HTTP 401 error

2013-05-23 Thread Lamps902
I've added the Twitter posting function to my app, in the form in which it's presented in the book - http://www.web2py.com/books/default/chapter/29/14?search=twitter#Twitter-API. When calling this function with the username supplied in the Twitter Account menu's username field, my twitter

[web2py] Re: Twitter post function producing HTTP 401 error

2013-05-23 Thread Lamps902
Thanks, Anthony. Are you aware of any viable web2py solutions to making Twitter posts? Would it be a good idea just to use some python Twitter module? -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and

[web2py] Re: Twitter post function producing HTTP 401 error

2013-05-23 Thread Lamps902
On Thursday, May 23, 2013 10:24:04 AM UTC-4, Lamps902 wrote: Thanks, Anthony. Are you aware of any viable web2py solutions to making Twitter posts? Would it be a good idea just to use some python Twitter module? -- --- You received this message because you are subscribed to the Google Groups

[web2py] Re: Send registration email directly from local server?

2013-05-21 Thread Lamps902
into account. So a completely new account might get locked up much faster than on that is years old. Lamps902, one can customize from, reply-to etc. regardless of the SMTP server used - so no need to actually use your domain with gmail, for example. You just need a working SMTP... A little

[web2py] Send registration email directly from local server?

2013-05-20 Thread Lamps902
At the moment, my custom domain is associated with Outlook, and my page's email settings are configured this way: settings.email_server = 'smtp.live.com:587' settings.email_sender = '[sender_name]@[mydomain.com]' settings.email_login = '[username]:[pass]' It seems that every few emails I send,

[web2py] Re: Send registration email directly from local server?

2013-05-20 Thread Lamps902
Is it necessary to have an SMTP server available on your system? I guess I was wondering if there is some kind of ad-hoc email server-like functionality that comes with web2py - for example, something like this: http://www.tutorialspoint.com/python/python_sending_email.htm - that can be

[web2py] Re: Send registration email directly from local server?

2013-05-20 Thread Lamps902
correctly identified (reverse dns, mx, etc), so you don't get included in a blacklist as soon as you start using it ^_^ Ironically, it happened with my Outlook account, although it seems to have been configured correctly (with a bit of assistance from my registrar's tech support)! In

[web2py] Re: Send registration email directly from local server?

2013-05-20 Thread Lamps902
On Monday, May 20, 2013 10:31:41 AM UTC-5, Niphlod wrote: I really don't think that smtp.live.com accepts happily more than a few emails per day (same thing goes for google's SMTPs using a personal account). They're not meant to be used by servers :P Which is exactly why I'm looking

[web2py] Dynamically loaded pages not found when link clicked from 'user' function/pages

2013-05-20 Thread Lamps902
I have a few pages (about, FAQ, terms of service) that are loaded from text files in the static folder. The setup is basically like this: content_files = Storage() file_handler = open(os.path.join(request.folder,static,content,about.txt),'r') content_files['about'] = file_handler.read()

[web2py] Re: Dynamically loaded pages not found when link clicked from 'user' function/pages

2013-05-20 Thread Lamps902
to load them, it's quite impossible to figure out why it doesn't work. On Monday, May 20, 2013 8:53:06 PM UTC+2, Lamps902 wrote: I have a few pages (about, FAQ, terms of service) that are loaded from text files in the static folder. The setup is basically like this: content_files = Storage

[web2py] Re: Dynamically loaded pages not found when link clicked from 'user' function/pages

2013-05-20 Thread Lamps902
the current page is a 'user' page? On Monday, May 20, 2013 11:53:06 AM UTC-7, Lamps902 wrote: I have a few pages (about, FAQ, terms of service) that are loaded from text files in the static folder. The setup is basically like this: content_files = Storage() file_handler = open(os.path.join

[web2py] Re: Dynamically loaded pages not found when link clicked from 'user' function/pages

2013-05-20 Thread Lamps902
when the current page is a 'user' page? On Monday, May 20, 2013 11:53:06 AM UTC-7, Lamps902 wrote: I have a few pages (about, FAQ, terms of service) that are loaded from text files in the static folder. The setup is basically like this: content_files = Storage() file_handler = open

[web2py] Re: Dynamically loaded pages not found when link clicked from 'user' function/pages

2013-05-20 Thread Lamps902
, Niphlod wrote: always generate your urls with URL().. On Monday, May 20, 2013 9:19:17 PM UTC+2, Lamps902 wrote: Oops. Just noticed something (sorry; gotten really out of practice lately, and I'm forgetting to check the obvious). If the current page is one of the 'user' pages, and I click

[web2py] Dynamically generating text file that isn't stored?

2013-05-03 Thread Lamps902
I would like to permit users to be able to download a text file of some data that's pulled up from certain fields of a DB table. This text file should be generated when the user clicks on a certain link, and should not be stored on the server's HD. Any ideas as to how to go about doing this?

[web2py] Finding performance bottlenecks

2013-04-15 Thread Lamps902
Hi, group. I'd like to ask a very general question, but one of great utility: what are some ways to go about finding performance bottlenecks in your web2py page? What are some specific resource hogs and sources of diminished performance that you've encountered in your web2py pages (I imagine

[web2py] Re: Finding performance bottlenecks

2013-04-15 Thread Lamps902
possible - etc that are all more or less on the book. Don't forget static asset serving, even if not managed by web2py a bad setting can slow down the page rendering quite a bit. On Monday, April 15, 2013 7:26:10 PM UTC+2, Lamps902 wrote: Hi, group. I'd like to ask a very general question

[web2py] Using field names stored as strings for db actions?

2013-04-03 Thread Lamps902
I'd like to do something to this effect: fields = db.table1.fields() table_rows = [ TR( TD(*[the label associated with the field]*), TD(db(*[the field]* 0).count()), _id = field + '__row') for field in fields ] Any suggestions? Thanks. -- --- You received this message because you are

[web2py] Re: new feature in trunk: pack custom

2013-04-03 Thread Lamps902
Thanks, Massimo - great feature! I was going to ask for something like this, as it's extremely useful for cases when you have a large upload folder, and would like to quickly back up the code, but not the user-uploaded files. On Tuesday, April 2, 2013 3:22:50 PM UTC-5, Massimo Di Pierro wrote:

[web2py] Re: Using field names stored as strings for db actions?

2013-04-03 Thread Lamps902
inside TD's. Anthony On Wednesday, April 3, 2013 12:12:33 PM UTC-4, Lamps902 wrote: I'd like to do something to this effect: fields = db.table1.fields() table_rows = [ TR( TD(*[the label associated with the field]*), TD(db(*[the field]* 0).count()), _id = field + '__row') for field

[web2py] File uploads from different tables wih SQLFORM.factory - table name issue

2013-04-01 Thread Lamps902
If you have something like the following: form = SQLFORM.factory(db.table1, db.table2) and table1 has an 'upload' field named 'file1', with table2 containing an 'upload' field named 'file2', the filenames stored in the tables will end up as

[web2py] Re: File uploads from different tables wih SQLFORM.factory - table name issue

2013-04-01 Thread Lamps902
out of it You can use _filter_fields() to see which table belongs the input name, as long as your input names are distinct. On Monday, April 1, 2013 4:31:47 PM UTC+2, Lamps902 wrote: If you have something like the following: form = SQLFORM.factory(db.table1, db.table2) and table1

[web2py] Re: File uploads from different tables wih SQLFORM.factory - table name issue

2013-04-01 Thread Lamps902
, request.post_vars is cleared so the files will not be re-saved when the factory form is processed in the next line. Anthony On Monday, April 1, 2013 12:04:09 PM UTC-4, Lamps902 wrote: Just realized a possible issue. It's simple enough to rename the strings that will become the database

[web2py] Re: Can file/upload field value be retained when form has errors/is not accepted?

2013-03-29 Thread Lamps902
, 2013 5:48:35 PM UTC+1, Lamps902 wrote: Thanks, niphlod and Anthony - some good suggestions and considerations mentioned there. niphlod - can you clarify why you recommend using separate tables specifically for large files (to prevent users from having to re-upload large files when forms aren't

[web2py] Re: using a representation of an absolute URL to update a db?

2013-03-28 Thread Lamps902
Thanks to both of you guys! After a much needed rest, I got it working with a solution comparable to what you guys specified/described. Anthony - I noticed the book's section on using the *host* and *scheme*parameters for URL(), but was a bit thrown off - is there a way to use URL() to point

[web2py] Re: using a representation of an absolute URL to update a db?

2013-03-28 Thread Lamps902
request). Anthony On Thursday, March 28, 2013 10:36:15 AM UTC-4, Lamps902 wrote: Thanks to both of you guys! After a much needed rest, I got it working with a solution comparable to what you guys specified/described. Anthony - I noticed the book's section on using the *host

[web2py] Can file/upload field value be retained when form has errors/is not accepted?

2013-03-28 Thread Lamps902
When a form has errors, the value of an upload field is reset upon submission. Is there a way to retain this value, or does this pretty much have to be handled manually (i.e. by storing the value of the upload field or by prompting the user to specify the file again)? -- --- You received

[web2py] Re: Can file/upload field value be retained when form has errors/is not accepted?

2013-03-28 Thread Lamps902
, March 28, 2013 5:08:24 PM UTC+1, Lamps902 wrote: When a form has errors, the value of an upload field is reset upon submission. Is there a way to retain this value, or does this pretty much have to be handled manually (i.e. by storing the value of the upload field or by prompting the user

[web2py] using a representation of an absolute URL to update a db?

2013-03-27 Thread Lamps902
Let's say you have an SQL grid generated from a db with field *my_url*, which stores the value of an absolute URL, and has a representation defined in this way: db.my_db.my_url.represent = lambda the_url, row: A(generate_link_image(), _href=the_url, _target='_blank') What would be a good way

[web2py] using the IS_URL validator with complex URLs

2013-03-27 Thread Lamps902
It seems that every once in a while, the IS_URL validator doesn't want to accept a URL that's valid. For example, I believe the ^ character prevents IS_URL from accepting something like http://finance.yahoo.com/q/hp?s=^IXIC+Historical+Prices. Is there a parameter to permit IS_URL to accept

Re: [web2py] using the IS_URL validator with complex URLs

2013-03-27 Thread Lamps902
Thank you! On Wednesday, March 27, 2013 1:44:08 PM UTC-5, Jonathan Lundell wrote: On 27 Mar 2013, at 11:25 AM, Lamps902 dhea...@gmail.com javascript: wrote: It seems that every once in a while, the IS_URL validator doesn't want to accept a URL that's valid. For example, I believe

[web2py] Re: using a representation of an absolute URL to update a db?

2013-03-27 Thread Lamps902
7:15:12 PM UTC+1, Lamps902 wrote: Let's say you have an SQL grid generated from a db with field *my_url*, which stores the value of an absolute URL, and has a representation defined in this way: db.my_db.my_url.represent = lambda the_url, row: A(generate_link_image(), _href=the_url

[web2py] Re: using a representation of an absolute URL to update a db?

2013-03-27 Thread Lamps902
Thanks, Niphlod. It may require some digression/elaboration, so do you mind if I get in touch with you about this tomorrow? Hopefully, after I get some rest, I'll be able to articulate the issue a bit better... On Wednesday, March 27, 2013 4:08:46 PM UTC-5, Niphlod wrote: uhm... I didn't

[web2py] Rendering HTML code and {{...}}-delimited code stored in a variable?

2013-03-20 Thread Lamps902
It's possible to render HTML code stored in a variable with the XML() function. However, let's say you have something like the following scenario: a href='{{=request.vars.the_link}}'{{=request.vars.the_link}}/a or something like stored_code = a

[web2py] Re: Rendering HTML code and {{...}}-delimited code stored in a variable?

2013-03-20 Thread Lamps902
:16:14 PM UTC+2, Lamps902 wrote: It's possible to render HTML code stored in a variable with the XML() function (i.e. if your variable is stored_code, do XML(stored_code) to render). However, let's say you have something like the following scenario: stored_code = a href

[web2py] Re: Rendering HTML code and {{...}}-delimited code stored in a variable?

2013-03-20 Thread Lamps902
Thanks, Anthony. I think this is exactly what I was asking about. I'll try it out now. On Wednesday, March 20, 2013 1:39:21 PM UTC-5, Anthony wrote: stored_code = a href='{{=request.vars.the_link}}'{{=request.vars. the_link}}/a It sounds like there might be better options, but if for some

[web2py] auth_event table not updating

2013-03-18 Thread Lamps902
Looking at my application's databases, it seems that the auth_event table was last updated quite some time ago. I'm not sure what changes I made to the code which could have caused the application to stop logging events to auth_event. Is there anything I should check in my database

[web2py] enable_record_versioning() - possible to update archive only after deletion?

2013-03-13 Thread Lamps902
At present, auth._enable_record_versioning and db.table._enable_record_versioning update a record every time something is modified or deleted (including the flipping of the *is_active* field). Is there a way to use the functionality provided by these functions to update an archive only upon

[web2py] Re: enable_record_versioning() - possible to update archive only after deletion?

2013-03-13 Thread Lamps902
/chapter/29/06#before-and-after-callbacks On Wednesday, March 13, 2013 7:27:16 PM UTC+1, Lamps902 wrote: At present, auth._enable_record_versioning and db.table._enable_record_versioning update a record every time something is modified or deleted (including the flipping of the *is_active

[web2py] Automated IP logging?

2013-03-13 Thread Lamps902
Is there an automated way to log the IPs associated with the initiatialization and clearing of each session (i.e. when a user logs in/logs out), or does this have to be accomplished manually through the use of request.client and some auth.settings variable (i.e. auth.settings.login_onaccept)?

[web2py] Creating a DB that mirrors the structure of an existing DB for archiving purposes?

2013-03-12 Thread Lamps902
Hi, group. For each database in a subset of my project's databases, I would like to have a corresponding database that (almost) clones the structure of the original database. The mirror databases will be used to archive records that have been deleted from the original databases. For example,

[web2py] Re: Creating a DB that mirrors the structure of an existing DB for archiving purposes?

2013-03-12 Thread Lamps902
Thanks, guys - this appears to be exactly what I needed! Is it generally a good idea, as far as performance goes, to store the archived entries in a separate database, as opposed to the original *db*? -- --- You received this message because you are subscribed to the Google Groups

[web2py] Re: Real-Time Scanning of File Upload Sizes Possible?

2013-03-01 Thread Lamps902
I've found this tip from Massimo on checking file upload progress: In the upload form add input type='hidden' name='X-Progress-ID' value='test'/ def upload_page(): ... length_bytes = cache.ram('X-Progress-ID:test:length',None,0) uploaded_bytes =

[web2py] Real-Time Scanning of File Upload Sizes Possible?

2013-02-28 Thread Lamps902
Hi, group. Is there a way to scan file uploads in real-time, and cut off the file upload if it exceeds a certain size? Thank you. -Lamps -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving

[web2py] Re: How do you check user-uploaded files for malware?

2013-02-01 Thread Lamps902
Thanks, Massimo, I'll check it out. -Lamps On Friday, February 1, 2013 11:19:12 AM UTC-5, Massimo Di Pierro wrote: Look into the IS_IMAGE validator. You can do something like that and search for specific strings into the uploaded file. On Thursday, 31 January 2013 06:50:05 UTC-6, Lamps902

[web2py] Preferred method for banning email domains from registering?

2013-01-31 Thread Lamps902
Hi, web2py users. Is there a preferred method for banning a set of email domains from registering? I know that the IS_EMAIL() validator has a banned parameter, but is this the best way to go about this task? If so, is there a way to pass multiple domains to the banned parameter (I don't think

[web2py] How do you check user-uploaded files for malware?

2013-01-31 Thread Lamps902
Has anybody had success using a malware/virus-scanning module/tool to scan user-uploaded files on their web2py page? Any suggestions as to how to go about doing this? Thanks! -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe

[web2py] Re: Redirect from inside a component

2013-01-31 Thread Lamps902
Why not use the process() method's next parameter? http://web2py.com/books/default/chapter/29/07?search=.accepted#The-process-and-validate-methods Otherwise, there's redirect() - http://web2py.com/books/default/chapter/29/07?search=redirect%28#Forms-and-redirection On Thursday, January 31,

[web2py] Re: Preferred method for banning email domains from registering?

2013-01-31 Thread Lamps902
python, so you could build up the regex string from a list or external source before passing it to as a parameter. regards, Andy. On Thursday, January 31, 2013 12:29:18 PM UTC, Lamps902 wrote: Hi, web2py users. Is there a preferred method for banning a set of email domains from

[web2py] Re: Can I change a boolean field widget to a button?

2013-01-30 Thread Lamps902
Jim - a much nicer solution came to mind that would be useful if you don't need those fields to be checkboxes at any other point in your program. You can probably do this in the model: Field('rebates_tiered', represent=INPUT(_type='button'), ...) Sorry not to think of it sooner. Probably an

[web2py] Re: Is it possible to use IS_IN_SET() in combination with other validators to validate a list?

2013-01-29 Thread Lamps902
Thank you for the replies, guys! I think my abstract/trivial example may have obfuscated things a bit. I'm trying to use the IS_IN_SET() validator in combination with a custom validator (yet to be fully written) to make it so that all the elements of a dropdown menu/select are taken from a

[web2py] Re: Is it possible to use IS_IN_SET() in combination with other validators to validate a list?

2013-01-29 Thread Lamps902
On Tuesday, January 29, 2013 5:39:59 AM UTC-5, Lamps902 wrote: Thank you for the replies, guys! I think my abstract/trivial example may have obfuscated things a bit. I'm trying to use the IS_IN_SET() validator in combination with a custom validator (yet to be fully written) to make it so

[web2py] Re: Can I change a boolean field widget to a button?

2013-01-29 Thread Lamps902
Hi, Jim. What about doing the following: form.elements('input',_id='checkbox_field_n')[0]['_type'] = 'button' I imagine the value can then be toggled with, for example, javascript's 'onclick' functionality, and stored in the db as usual. On Tuesday, January 29, 2013 11:46:55 AM UTC-5, Jim S

[web2py] Re: Can I change a boolean field widget to a button?

2013-01-29 Thread Lamps902
to generate it as a type=button from the start. The bootstrap example also shows this as a button element and not an input. Not sure if that is relevant though. -Jim On Tuesday, January 29, 2013 12:53:50 PM UTC-6, Lamps902 wrote: Hi, Jim. What about doing the following: form.elements

Re: [web2py] Re: Can I change a boolean field widget to a button?

2013-01-29 Thread Lamps902
. Not sure if that is relevant though. -Jim On Tuesday, January 29, 2013 12:53:50 PM UTC-6, Lamps902 wrote: Hi, Jim. What about doing the following: form.elements('input',_id='**checkbox_field_n')[0]['_type'] = 'button' I imagine the value can then be toggled with, for example, javascript's

Re: [web2py] Re: Can I change a boolean field widget to a button?

2013-01-29 Thread Lamps902
this was javascript code. Sorry I missed that, it's been a long day... On Tue, Jan 29, 2013 at 7:59 PM, Lamps902 dhea...@gmail.comjavascript: wrote: It looks like you might be sort of conflating javascript and python code there. Before you do anything with javascript, modify the checkbox element

[web2py] Re: Is it possible to use IS_IN_SET() in combination with other validators to validate a list?

2013-01-29 Thread Lamps902
on widgets, see http://web2py.com/books/default/chapter/29/07#Widgets. Anthony On Tuesday, January 29, 2013 1:36:24 PM UTC-5, Lamps902 wrote: Thanks, Anthony. I was under the impression that list:string is the convention if you want the field to render as a selector with SQLFORM(). You're right

[web2py] Is it possible to use IS_IN_SET() in combination with other validators to validate a list?

2013-01-28 Thread Lamps902
Hi, web2py users. In my model, I've got a field of type list:string which I'm trying to validate. The field is defined as follows: Field('f_field_name', type='list:string', requires=IS_IN_SET(theset=list_of_acceptable_options,zero=T(message), error_message=T(some_error_message)))

[web2py] List items not loading in profile form

2013-01-10 Thread Lamps902
Hi, group. My user_auth model includes list fields such as the user's home country and home state, which are declared thus: Field http://127.0.0.1:8000/examples/global/vars/Field('home_state',type=list:string,length=2, label=T http://127.0.0.1:8000/examples/global/vars/T('Home State'),

[web2py] Modifying auth.navbar

2012-12-27 Thread Lamps902
Hi, group. Is there a straightforward way to modify web2py's navbar? I would like to customize the default navbar so that it redirects to a custom 'register' function when that option is selected, keeping all other functionality as it is. Thanks! --

[web2py] Re: Modifying auth.navbar

2012-12-27 Thread Lamps902
the server-side DOMhttp://web2py.com/books/default/chapter/29/05#Server-side-DOM-and-parsing . Anthony On Thursday, December 27, 2012 9:32:30 AM UTC-5, Lamps902 wrote: Hi, group. Is there a straightforward way to modify web2py's navbar? I would like to customize the default navbar so

[web2py] Re: web2py forum solutions

2012-11-27 Thread Lamps902
, there is a forum written in web2py. Take a look - http://pyforum.org/ I haven't used it for more than to test it out, perhaps someone else will have additional feedback. Regards, Ales On Monday, November 26, 2012 8:16:51 PM UTC+1, Lamps902 wrote: Hi, group. What are some options for forums

[web2py] web2py forum solutions

2012-11-26 Thread Lamps902
Hi, group. What are some options for forums/message boards that can be readily integrated into a web2py page (i.e. forum solutions that can be wholly contained within your page's content window, maintain the integrity of your page's theme, and have access to the page's DB - preferably with

[web2py] Preventing 'back' button from clearing session

2012-11-12 Thread Lamps902
Sorry to ask something so seemingly basic, but it's posing quite an issue at the moment. I've got a back button that is set to appear when a DB query doesn't result in any items being returned (i.e. a grid is blank). The button is implemented like this: back_button_form =

[web2py] Re: Is it possible to submit multiple forms with one submit button?

2012-11-04 Thread Lamps902
it to the server in one or more AJAX calls - sure you can create one large form, but you'll need to carefully name all the input fields so that you know what is what. On Saturday, November 3, 2012 7:44:06 AM UTC-7, Lamps902 wrote: I have a grid in which I'd like to put a form between each column

[web2py] Is it possible to submit multiple forms with one submit button?

2012-11-03 Thread Lamps902
I have a grid in which I'd like to put a form between each column header/label. Is it possible to submit and pass the data from all of these forms with a single submit button? Tried a couple of jquery solutions, but it wasn't quite working out. Alternatively, is it possible to make a single

Re: [web2py] How to implement multiple filter for grid?

2012-11-01 Thread Lamps902
search example. You'll have to provide your own data to get it running. It worked with my test data. Let me know if you have troubles and I'll be glad to work through them with you. -Jim On Wed, Oct 31, 2012 at 8:53 AM, Lamps902 dhea...@gmail.com javascript: wrote: Hi, Jim. It would

Re: [web2py] How to implement multiple filter for grid?

2012-11-01 Thread Lamps902
there to implement. 3. I think you could probably do this. If it were me doing it I'd look into the suggest_widget plugin available from http://dev.s-cubism.com/plugin_suggest_widget. Best of luck! Sorry I couldn't be more helpful. -Jim On Thu, Nov 1, 2012 at 11:35 AM, Lamps902 dhea

[web2py] Is there a way to put a grid's search form beneath the column headers of a grid?

2012-11-01 Thread Lamps902
In a previous threadhttps://groups.google.com/forum/#!searchin/web2py/filter/web2py/oH7eMYNHt6Y/Izss3tRfTOkJ, we discussed how to implement multiple search filter fields for a grid. That being done, I'm curious if there's a reasonable way to put the filters (all currently part of a single

Re: [web2py] How to implement multiple filter for grid?

2012-11-01 Thread Lamps902
that distinct, the db scans only the index and not the million rows table On Thursday, November 1, 2012 8:18:50 PM UTC+1, Lamps902 wrote: Regarding the first point, the concern is not that the selector (as defined in the DB model) is instantiated with a huge variety of fields. If I'm

  1   2   >