[web2py] Re: FYI: css3 buttons outdated in web2py

2011-05-19 Thread Ross Peoples
The new CSS3 buttons look pretty sweet.

[web2py] Re: Changing columns for TEXTAREA

2011-05-19 Thread Ross Peoples
The order of CSS priority is (from least important to most important): Whichever CSS file gets called LAST is the one that takes priority. Then whatever is in the head HTML file's tags, then on the individual elements themselves (i.e. ). So if you link to your base.css, then to layout's style.

[web2py] Re: Ajax page update

2011-05-19 Thread Ross Peoples
Polling with JavaScript is the most common way. However, there is a way to use comet, which allows the server to push updates immediately to clients, but I've never used that, it's still experimental, and may be difficult to set up. Unless you need instant updates (like with an instant messaging

[web2py] Re: How to implement background processes elegantly..

2011-05-20 Thread Ross Peoples
If I am reading this properly, you want to create a new instance if db for each thread? I have never tried this before, but could you do something like this for each thread? db_thread = DAL(db._uri) for k, v in db.items(): db_thread[k] = v The idea being to using the existing db's URI strin

[web2py] Re: pythonanywhere

2011-05-20 Thread Ross Peoples
Now if we could just get a built-in web2py version that does the exact same thing. Massimo should be able to knock that out in a couple hours :) Just kidding, of course. Although it would be sweet.

[web2py] Re: jquery id using python variable

2011-05-23 Thread Ross Peoples
Whenever I have to pass variables from Python to JavaScript, I usually do it like this to avoid problems, and to make the code cleaner: var target = '#page-{{=page.id}}'; jQuery(target).click(function() { alert('clicked'); }); A quick note about this. ID, NAME, and CLASS HTML attributes need

[web2py] Re: Auth is now always a cas service

2011-05-23 Thread Ross Peoples
I am not that familiar with CAS, but it might be useful in some cases to know what groups the user is a member of in the remote web2py installation. For example, if there is an 'Administrators' group that should have access to everything, then you wouldn't have to set up groups and permissions f

[web2py] Re: Auth is now always a cas service

2011-05-23 Thread Ross Peoples
That would be nice. It has all the information required, plus group membership. Would this work with custom auth_user tables as well?

[web2py] Re: Auth is now always a cas service

2011-05-23 Thread Ross Peoples
Should it transfer all fields in auth_user, or should the application provide its own service to get more information if it needs to?

[web2py] Re: script to clone a database

2011-05-23 Thread Ross Peoples
This is fantastic. I was going to have to do something like this in the future. Glad to know that web2py makes it easy :)

[web2py] Problem storing Storage objects in sessions

2011-05-24 Thread Ross Peoples
For whatever reason, after running for 24 hours, web2py throws an exception when trying to log in. I have to stop web2py, and restart it, then the error goes away and my application starts working again. Any ideas? Traceback (most recent call last): File "/media/psf/Python/web2py/gluon/main.py

[web2py] Re: Strange Flashing of Elements

2011-05-24 Thread Ross Peoples
Some elements are set to display: none, like the .flash and .hidden CSS classs. The reason for this is to prevent exactly what you are describing. You don't want those elements to be displayed before JavaScript has a chance to load. Once the page is fully loaded, then JavaScript makes these elem

[web2py] Trouble updating with SQLFORM.factory and two tables

2011-05-24 Thread Ross Peoples
I am trying to make a user editor and running into trouble. I have the standard auth_user table, and I also have an auth_user_extended table that stores a bunch of other information, using auth_user as the reference between the two tables. I set my controller up like this: def update(): id

Re: [web2py] Trouble updating with SQLFORM.factory and two tables

2011-05-24 Thread Ross Peoples
So you basically do: form = SQLFORM(db.auth_user, id) form2 = SQLFORM(db.auth_user_extended, row.auth_user_extended.id) form.append(form2) Interesting. I'll have to give this a shot...thanks!

Re: [web2py] Trouble updating with SQLFORM.factory and two tables

2011-05-24 Thread Ross Peoples
This is the code I have: form = SQLFORM(db.auth_user, row.auth_user) form.append(SQLFORM(db.auth_user_extended, row.auth_user_extended)) My view requires that I manually build the form, and for some reason, when I look at the resulting form object via PDB, the form object has two

Re: [web2py] Trouble updating with SQLFORM.factory and two tables

2011-05-24 Thread Ross Peoples
I've gotten much closer with this, however, I am still hitting a snag: One of the fields in my auth_user_extended is set to requires=IS_NOT_IN_DB(). And when form.accepts is called, I'm still getting a "value already in database" error.

[web2py] Re: Problem storing Storage objects in sessions

2011-05-25 Thread Ross Peoples
I do have a script that runs every day, but I don't think that is the problem because it doesn't touch sessions. In the application itself, one of the things I store in is a list of URL objects in the session. Every time a user logs in, the menu is generated based on that user's permissions an

[web2py] Re: Trouble updating with SQLFORM.factory and two tables

2011-05-25 Thread Ross Peoples
You were right, that was a stupid mistake on my part. However, it still isn't working. This is the new select() command, but I still get the previous error: row = db((db.auth_user_extended.auth_user==db.auth_user.id) & (db.auth_user.id==id)).select().first() The model for the field that is giv

[web2py] Re: Trouble updating with SQLFORM.factory and two tables

2011-05-25 Thread Ross Peoples
If I remove the requires, then the record updates properly, but the idea is that the barcode id should be unique. So is this a bug? I mean I could do custom validation on the form to ensure the barcode id is unique, but that kind of defeats the purpose of requires.

[web2py] Re: 1.96.0 -> stable 1.96.1?

2011-05-25 Thread Ross Peoples
The current trunk version is pretty stable for me. I know there are a few people out there looking forward to the new import functionality. Plus, it's been about a month since the last stable release, so it's probably time :) Though you may want to make a note that it will not work with Python 2

Re: [web2py] Re: 1.96.0 -> stable 1.96.1?

2011-05-25 Thread Ross Peoples
Jose, I learned the hard way that Python 2.4 is no longer supported by web2py and a lot of the new stuff in the trunk requires Python 2.5 or higher. I had submitted several patches to support Python 2.4, but they were rejected because maintaining Python 2.4 support really is a pain, which is wh

[web2py] Re: request.files.append syntax

2011-05-25 Thread Ross Peoples
response.file is what you are looking for, not request. And response.files is simply a list, and append just appends another item to the list. The web2py_ajax.html view is what loops through the list and writes the and

Re: [web2py] Re: 1.96.0 -> stable 1.96.1?

2011-05-25 Thread Ross Peoples
Jose, That is understandable. The two incompatibilities with Python 2.4 that I am aware of are: http://code.google.com/p/web2py/issues/detail?id=269&can=1&q=python%202.4 and http://code.google.com/p/web2py/issues/detail?id=267&can=1&q=python%202.4 This basically means that using "from gluon imp

Re: [web2py] Re: request.files.append syntax

2011-05-25 Thread Ross Peoples
You could always do something like this in your layout.html: {{if 'extra_css_files' in response:}} {{for file, media in response.extra_css_files:}} {{pass}} {{pass}} Then in your menu.py, you would want to put this in: response.extra_css_files = {} And anywhere you want to include your

[web2py] Re: How do I check if a user account is blocked/disabled?

2011-05-27 Thread Ross Peoples
That is how I do it. As far as I know, setting registration_key to 'disabled' is the only way for web2py to deny a log in for someone using Auth. When I need to set this or check it, I just wrap the code into a generic is_disabled() method to do the checking in case a better way presents it sel

Re: [web2py] Re: web2py rpc

2011-06-01 Thread Ross Peoples
I am actually using web2py as a JSON-RPC service now. Using RPC, you can make a web2py application act like you are running functions on the local machine. This is most commonly used to provide a desktop application that can interface with your web service. Right now, I have a web2py installatio

Re: [web2py] Re: web2py rpc

2011-06-01 Thread Ross Peoples
All the communication is done on the local network, so security isn't a huge issue, however, I still require the JSON-RPC service to communicate over HTTPS so that when I pass username/password combinations to it, it's all encrypted. And I use a custom controller that checks authentication. Alt

[web2py] Re: jquery effect

2011-06-01 Thread Ross Peoples
I'm not exactly sure what's going here, but at first glance, this is what I see: I think you are using attr() wrong. In the first section of code, you are checking the 'Protected' attribute, but in the second block of code, you are setting an 'onchange' attribute to the value of 'Protected', Ma

[web2py] Re: Bug in MSSQLAdapter.EXTRACT

2011-06-02 Thread Ross Peoples
This patch that was added to the trunk breaks my application which runs on MSSQL. Whenever I try to read a datetime from MSSQL now, I get a syntax error about not being able to parse the date time from a string. Reverting my web2py installation to to R-1.96.1 fixes the problem.

[web2py] Re: Bug in MSSQLAdapter.EXTRACT

2011-06-02 Thread Ross Peoples
Doing a little more research on this: This happens when doing an INSERT. And the exact error I get: DataError: ('22007', '[22007] [FreeTDS][SQL Server]Syntax error converting datetime from character string. (241) (SQLExecDirectW)') What's happening is my application is importing data from a leg

[web2py] Re: Bug in MSSQLAdapter.EXTRACT

2011-06-02 Thread Ross Peoples
AHAH! I figured out what it was. I will post in a new thread since it actually has nothing to do with the DAL at all, but rather the new behavior of the Storage() object.

[web2py] New Storage() Object Breaks Backwards Compatibility

2011-06-02 Thread Ross Peoples
I just updated my trunk only to find several scripts not working properly and acting strangely. I thought it was a change made to MSSQL, but I have narrowed down the problem to revision 1980 titled, 'many semplifications'. A change made to storage.py's __getattr__() function is causing the probl

[web2py] Re: New Storage() Object Breaks Backwards Compatibility

2011-06-02 Thread Ross Peoples
It still returns an empty Storage instance instead of None.

[web2py] Re: New Storage() Object Breaks Backwards Compatibility

2011-06-02 Thread Ross Peoples
I just tried this in a web2py shell: >>> from gluon.storage import Storage >>> data = Storage() >>> data.foo = 'bar' >>> data.foo 'bar' >>>data.test

[web2py] Re: New Storage() Object Breaks Backwards Compatibility

2011-06-02 Thread Ross Peoples
Having the two Storage and MultiStorage objects would be nice, as Storage would require explicit initialization (just like request.vars does). Then if you want to use recursive Storage objects (data.a.b.c = 1), that's where MultiStorage comes in. Nice suggestion, because I do like this new func

[web2py] Re: Inserting records using DAL outside of web2py

2011-06-03 Thread Ross Peoples
Setting requires only performs validation with CRUD and SQLFORM. Doing a direct insert does not cause validation to be checked. Try using validate_and_insert() instead of insert().

[web2py] Re: How to not show the "delete file" checkbox

2011-06-06 Thread Ross Peoples
In your SQLFORM call, you should be able to set deletable=False http://web2py.com/book/default/chapter/07#SQLFORM

[web2py] Re: Small toolbar bug in 1.96.3

2011-06-08 Thread Ross Peoples
I just got hit by this change. I think the original reason why it never showed the toolbar for a single returned item was to make web2py easier to use. I'll give a use case: You want to create a simple form, so in a controller you do the following: form = SQLFORM(db.table) return dict(form=form

[web2py] Re: PyCharm is going to support web2py

2011-06-08 Thread Ross Peoples
It says "I bet the PyCharm team will step up to the task". I hope this is their way of secretly saying, "It's now on our todo list". I use Komodo IDE for development right now, which is a decent editor with autocomplete, but no debugging (and no remote debugging either). So I hope PyCharm does a

[web2py] Re: Small toolbar bug in 1.96.3

2011-06-08 Thread Ross Peoples
I thought this change meant that regardless of the number of variables passed, it shows the toolbar anyways if is_local. My application that was created before back in 1.94.1 does not check for is_local, because I see the toolbar on a remote machine, when all I pass is form=form. This change is

[web2py] Re: Small toolbar bug in 1.96.3

2011-06-09 Thread Ross Peoples
No proxy, just default Ubuntu Server 10.04.2 with web2py trunk, plus pyodbc. No web server is installed on the machine and I am running it using python web2py.py -i 0.0.0.0 -a password -c cert.crt -k key.key, so I wonder if it has something to do with SSL? And the generic views have not been mod

[web2py] Re: PyCharm is going to support web2py

2011-06-09 Thread Ross Peoples
Not to start a holy war or anything, but I hear people talking all the time about how emacs or vim is the best code editor ever. Why is that? Does it do code completion or have some other really helpful feature that I just missed? I've used vim to edit text files, but editing code in a tiny cons

[web2py] Re: Web2Py & RoR performances

2011-06-09 Thread Ross Peoples
This was a while ago, and I cannot find my source at the moment, but I recall reading a benchmark done that put RoR faster than PHP, but slower than Python by a large margin (without server-side caching and other performance tweaks). If I find the original article or maybe a more recent one on

[web2py] Re: Web2Py & RoR performances

2011-06-09 Thread Ross Peoples
Good point. The last thing we want is another Python vs RoR vs whatever war. I know that I helped test performance and ran my own benchmarks when Massimo was working performance improvements with regards to session files back in March, since sessions can slow down response times. My own testing

Re: [web2py] Re: vars vs. kwargs

2011-06-09 Thread Ross Peoples
web2py makes extensive use of these. Take the A, DIV, or TABLE as examples, you can pass HTML attributes (e.g. _class, _id, _style) to these, but if you look at the code, you will notice that these things are not in the signature of these methods. They allow you to provide an unknown number of p

[web2py] Re: Project: pydev extension for web2py in Eclipse

2011-06-09 Thread Ross Peoples
That would be awesome. I tried using Eclipse + PyDev once, but it just felt too big and complicated, especially since it didn't know anything about web2py and couldn't do autocomplete. If this works, I may have to reevaluate Eclipse + PyDev again.

[web2py] Re: IS_IN_SET validator not working as expected

2011-06-10 Thread Ross Peoples
I'm sure you've already considered this, but maybe use a checkbox instead, as it's specifically designed to handle true/false. The SELECT widget and associated IS_IN_SET is designed to return a string value. So If you really want to use a select box for this instead of a checkbox, then you need

[web2py] Anyone interested in an AJAX version of CRUD?

2011-06-10 Thread Ross Peoples
For the last month or so, I have been working on a plugin that does something similar to CRUD, except that it's all AJAX and provides a couple of nice features for editing things. Obviously, it doesn't work exactly like CRUD, since I've never really looked at the code for it, but I wanted somet

[web2py] Re: Anyone interested in an AJAX version of CRUD?

2011-06-10 Thread Ross Peoples
That would be something if it actually went into the trunk :) Thanks for offering to help to. I'll send you over what I have. It is a somewhat large and complicated plugin, so maybe you will find a better way to do some of the things in there and simplify it a bit.

[web2py] Re: Anyone interested in an AJAX version of CRUD?

2011-06-10 Thread Ross Peoples
I sent everything to you before I got this message, so now I'm looking at either using BitBucket or Google Code (because that's what web2py uses). That is unless Massimo wants to give me a named branch or something ;)

[web2py] Re: Anyone interested in an AJAX version of CRUD?

2011-06-10 Thread Ross Peoples
Ok, I made a repository on BitBucket, so anyone that wants to help with with this, please do. https://bitbucket.org/PhreeStyle/web2py_crud/src

[web2py] Re: Anyone interested in an AJAX version of CRUD?

2011-06-10 Thread Ross Peoples
I chose to go with a locally installed jQuery UI since my original project was designed to replace an internal enterprise application which may not have internet access once it goes into production. I suppose I could make it pull from the CDN by default to lower the barrier to entry. But I want

[web2py] Discussion: Thoughts about including jQuery UI in core web2py?

2011-06-12 Thread Ross Peoples
The more I get in to working with web2py and writing applications, I always seem to end up including jQuery UI in my applications, if for no other reason than it's easy to theme elements of my application using ThemeRoller. For example, the menu is usually the first thing I change by using the

[web2py] Re: Python and Web2py dictionary behavior

2011-06-13 Thread Ross Peoples
I make heavy use of Storage in my apps because dot notation is so much easier and faster. It is completely backwards compatible with Python's dictionary. I usually end up putting this at the top of all my controllers and modules: from gluon.storage import Storage Then instead of using a dictio

[web2py] Re: Discussion: Thoughts about including jQuery UI in core web2py?

2011-06-13 Thread Ross Peoples
True about plugin_wiki, but not everyone uses it. I know I don't, just because I am mostly developing internal enterprise applications that do CRUD operations on a database. Also, there are other plugins that require jQuery UI, so having those plugins include their own version of it is a bad ide

[web2py] Re: generating free domain validated ssl certificates

2011-06-13 Thread Ross Peoples
I've been using StartSSL for a couple years now. I generate S/MIME certs, SSL certs, and one for our Jabber server. Works great and never had a problem and it was all FREE. Their paid certs are very competitively priced too. The class 1 certs are about half the price of GoDaddy's and allow for

[web2py] Re: Import from another application in 1.96.x

2011-06-13 Thread Ross Peoples
Jim, You could try doing: import sys sys.path.append('/path/to/web2py/applications/another_app/modules') from mymodule import MyClass Alternatively, you could also add mymodule to a location that already exists in sys.path.

[web2py] Strange Error: Field does not belong to the table

2011-06-13 Thread Ross Peoples
I am trying to provide an editor for auth_user using SQLFORM. I also am trying to add a checkbox to the bottom of the form to set whether or not the user is an administrator. If so, then the user gets added to an Administrators group when calling form.accepts(). The strange part is, the code wo

[web2py] Re: send raw POST data/ form fields to web2py controller

2011-06-14 Thread Ross Peoples
With jQuery, I think you just have to do something like the following (but check the docs first http://api.jquery.com/jQuery.post/ ): var form_vars = jQuery('#myform').serialize(); jQuery.post(url, form_vars, function() { alert('POST was successful'); });

[web2py] Re: Import from another application in 1.96.x

2011-06-15 Thread Ross Peoples
When talking across applications like that, you might be better off putting your core functionality in its own app, then having all of your other apps make XML-RPC or JSON-RPC calls to it. This gives you a good level separation and means that you can break up your apps and run each of them on a

[web2py] Re: Strange Error: Field does not belong to the table

2011-06-17 Thread Ross Peoples
I tried it in a multitude of ways, (using SQLFORM and SQLFORM.factory) and none of them worked. I did not try setting dbio=False and doing it myself, however. Perhaps that's what I should have done. Instead, I turned is_administrator into something that gets set separately. Not optimal, but may

[web2py] Apache Subdomain Configuration

2011-06-23 Thread Ross Peoples
This is the first time I have really tried to deploy web2py to a production server, so I'm going to need some help. What I want to do is run my web2py app through Apache using a subdomain. Right now, I've got the server configured as a LAMP server using the default Ubuntu configuration because

Re: [web2py] Apache Subdomain Configuration

2011-06-23 Thread Ross Peoples
I copied the web2py folder over from the trunk, since that's the version I developed the app from. I cannot find the file you describe in the trunk version of web2py. A lot of the config files I see around the web involve putting web2py at the root of the server. What I wanted to do (and I don't

Re: [web2py] web2py in dropbox folder

2011-06-27 Thread Ross Peoples
I probably overuse DropBox using this method. I actually have my code on DropBox AND have the web2py server using those files running on two different machines at the same time. I have never had the problem you describe. The only problem I have is conflicting cron files from the two machines wr

[web2py] Re: The multi-tenant feature and validators ...

2011-06-27 Thread Ross Peoples
Did this ever get resolved? I tried looking for a ticket on this but only found one related to setting unique=True. I have to convert my app to support multiple tenants and IS_IN_DB() and IS_NOT_IN_DB() are going to be used in several places to make sure that a tenant cannot have duplicate rows

[web2py] Re: The multi-tenant feature and validators ...

2011-06-27 Thread Ross Peoples
Ok, thanks Massimo. I know that unique=True will never work because there's no way to tell the database about multi-tenancy, I just wanted to make sure the validators were working properly.

[web2py] Re: web2py connection pooling and database server reboot

2011-06-27 Thread Ross Peoples
I have a similar set up, but do not use connection pooling. When the MSSQL server is rebooting, any requests by web2py will predictably return an error about not being able to connect, but when the MSSQL server becomes available again, web2py starts working again, no restart required. So I suspe

[web2py] Re: Empty database default values?

2011-06-29 Thread Ross Peoples
The default, if not specified is always None (NULL). Some DBAs will argue for and against storing NULL values in a database, but I personally use NULLs simply because they allow more flexibility. For example, say you have a text field in one of your tables. This text field should be set by the

[web2py] Re: Disabling Input Validation/Output Incoding

2011-06-30 Thread Ross Peoples
I did something similar to demonstrate common vulnerabilities, such as SQL injection and changing hidden values in forms before submission. It was really tough to make this app with web2py, as I had to skirt around most of the framework to make it happen. This is a GOOD THING though. I learned a

[web2py] Forcing SSL/HTTPS

2011-07-01 Thread Ross Peoples
Since I want to make sure that my application is as secure as possible, I wanted to force all traffic to use HTTPS. At the bottom of my db.py, I have this: FORCED SSL # session.secure() if not request.is_https: redirect('https://%s/%s' % (request.env.http_host, reque

[web2py] Re: looks familiar, could be useful

2011-07-01 Thread Ross Peoples
a jQuery version of web2py's HTML helpersvery nice. I use jQuery heavily, but I rarely ever "create" DOM elements using JavaScript. Either I wrap hidden elements for later with "display: none;" or I just replace with HTML from an AJAX callback. But if creating DOM elements in JavaScript on-

Re: [web2py] Forcing SSL/HTTPS

2011-07-01 Thread Ross Peoples
I just tried the following by running web2py -S app -M -R my_script.py (since this is how I run the script from cron): from gluon.settings import global_settings print global_settings The cronjob value seems to always be False and I can't figure out how this actually gets set to True. Any ideas

Re: [web2py] Forcing SSL/HTTPS

2011-07-01 Thread Ross Peoples
I'm calling from external cron, which is why this option is not getting set. So all I have to do is add --cronjob to my cron line and it's all set. Alternatively, while trying to figure this problem out, I noticed that global_settings.cmd_options.shell will return a string if run from the shell

[web2py] Re: Forcing SSL/HTTPS

2011-07-01 Thread Ross Peoples
oogle Groups is giving me a lot of trouble. This is the 3rd time I've tried to post this, so I apologize if this shows up several times. On Jul 1, 11:46 am, Ross Peoples wrote: > I'm calling from external cron, which is why this option is not getting set. > So all I have to do is add

[web2py] Re: estore

2011-07-05 Thread Ross Peoples
Apple, When dealing with Google Code, it is expected that you use Mercurial to get the code rather than waiting on the author to provide a direct download link. You should use: hg clone https://web2py-estore.googlecode.com/hg/ web2py-estore Or if you just want to browse the code: https://code

[web2py] Re: OffTopic Google+

2011-07-06 Thread Ross Peoples
I have tried it. I like it better than Facebook, especially because of its commitment to privacy. The circles feature is great. I think most people don't friend their bosses, coworkers, and business acquaintances of Facebook because they don't want their personal lives to be exposed to those peo

Re: [web2py] Re: OffTopic Google+

2011-07-06 Thread Ross Peoples
Free, unlimited storage of photos as large as 2048x2048 and videos under 15 in length is pretty awesome. This will be more than enough for most people. @sebastian: The point of the circles is so that you can share information with only certain groups if you want. So you could be "friends" with

[web2py] Re: Passing JavaScript variable to web2py session variable?

2011-07-08 Thread Ross Peoples
You're doing it right, but there are a couple of things to keep in mind. Using $.post(url, {input_n: input_number}); is easier than using $.ajax, but that's merely preference. The other thing you should know is that if a web2py ticket is generated during an AJAX call, you will not know about it.

[web2py] Re: Passing JavaScript variable to web2py session variable?

2011-07-08 Thread Ross Peoples
Going from web2py -> JavaScript is easy: {{=var}} However, going from JavaScript -> web2py requires an AJAX call. Since JavaScript is run on the user's machine and not the web server, the two machines have to communicate somehow, which is where AJAX comes in. You should also know that things i

[web2py] New Plugin: plugin_ckeditor

2011-07-08 Thread Ross Peoples
This will be my second public plugin release. I will put it up on BitBucket soon, but for now, I thought I would introduce a new plugin I've been working on. Sometimes you just need a WYSIWYG editor. This plugin integrates CKEditor into web2py. It acts much like the Auth object in its usage. For

Re: [web2py] New Plugin: plugin_ckeditor

2011-07-08 Thread Ross Peoples
Ok, I have posted the source code on BitBucket. I don't have time to put any documentation up there yet other than what's here in this thread. I will update with more documentation hopefully this weekend when I have time. Until then, enjoy! https://bitbucket.org/PhreeStyle/web2py_ckeditor

[web2py] Re: Datatables, jqgrid

2011-07-11 Thread Ross Peoples
I think because when a table is hidden behind a tab that it can't resize what's not visible. So if you listen for the tab change event and force datatables to refresh after a tab change, that should solve the problem.

[web2py] Re: ssl for sending mail

2011-07-11 Thread Ross Peoples
I'm pretty sure you have to set mail.settings.tls = True for web2py to start a secured connection with a mail server.

[web2py] Re: ssl for sending mail

2011-07-11 Thread Ross Peoples
Oh, and looking at the code, it doesn't want to start a secured session unless mail.settings.login is set. Not sure why this is. Maybe because mail servers typically don't allow anonymous logins anymore.

[web2py] Re: Python 3 and the future of web2py

2011-07-11 Thread Ross Peoples
I know it's on the radar, but I don't know to what extent. I am guessing that it won't be an immediate priority until operating systems like Mac OS X, Ubuntu, and RHEL/CentOS start shipping Python3 by default. Python3, being the next-generation of Python as it were, is still new and these operat

[web2py] Re: How web2py works - performance

2011-07-11 Thread Ross Peoples
The less your models do, the better in general. When a page comes in, web2py does it's thing, then executes ALL models, then executes the appropriate controller->function, then the function executes the view. However, with newer versions of web2py, there are conditional models, so in your model

Re: [web2py] Re: ssl for sending mail

2011-07-11 Thread Ross Peoples
Quick correction, set: mail.settings.login = None Setting this to False will probably cause an error, as it specifically checks for None, and assumes the value is a string otherwise.

[web2py] Re: load restricted errors

2011-07-11 Thread Ross Peoples
I see this a lot when there is a problem in the view. If this is the case, then you'll see a line number on the error, which if you scroll all the way down to the bottom on the ticket, you will see the view code converted to Python code and you will see which line it is talking about in the view

[web2py] Re: Python 3 and the future of web2py

2011-07-11 Thread Ross Peoples
I'd be interested to see what something like 2to3 would say about web2py's compatibility with Python3: http://docs.python.org/library/2to3.html http://diveintopython3.org/porting-code-to-python-3-with-2to3.html

Re: [web2py] Python 3 and the future of web2py

2011-07-12 Thread Ross Peoples
I know that Python 2.5 is the officially supported Python version of web2py, but I've been coding all of my stuff with the assumption that this will eventually change to Python 2.6, or even 2.7. I have applications running on both 2.6 and 2.7 in production. But since I'm using Ubuntu 10.04 Serve

[web2py] Re: Admin security: https vs localhost

2011-07-12 Thread Ross Peoples
After so many attempts, admin should block the IP address attempting to gain access. Further, an invalid password, should require a 5 second timeout. After maybe 5 attempts, block the IP. The DenyHosts script that is used to prevent SSH brute force attacks does the same thing basically.

[web2py] Re: Admin security: https vs localhost

2011-07-12 Thread Ross Peoples
And maybe we should require some level of complexity on the admin passwords. The other day I set my dev machine's password to a single letter. I think that could be a potential security problem :)

[web2py] Re: default function of a controller

2011-07-12 Thread Ross Peoples
If your controller doesn't have an index function at all, you could add something like this to one of your models: if request.controller = 'mycontroller' and request.function == 'index': request.function = 'myfunction' So that if someone tries to go to /mycontroller or /mycontroller/index, t

[web2py] Re: Admin security: https vs localhost

2011-07-12 Thread Ross Peoples
Well, as far as the delay and the blocking of the IP, I put this together, which would go somewhere in the /admin/models/access.py file, but I'd like to get some comments, as I've never coded this type of thing before so I'd like to know if there's a better way to code it, and what problems it m

[web2py] Re: Admin security: https vs localhost

2011-07-12 Thread Ross Peoples
One quick change: In failed_login(), the line: times_denied = 0 Should really be: times_denied = 1

[web2py] JSON-RPC Client

2011-07-12 Thread Ross Peoples
I know that web2py has a nice JSON-RPC Server built into it, but if I wanted two web2py applications to talk to each other, first would JSON-RPC be a good choice? And if so, does web2py have a built-in JSON-RPC client, or would I have to easy_install python-cjson and jsonrpclib?

[web2py] Re: Admin security: https vs localhost

2011-07-12 Thread Ross Peoples
Well, support for Python 2.4 was officially dropped with version 1.96.1, so I don't think 'with' will be a problem. You're right about the cache invalidation. Nice catch!

Re: [web2py] Multiple Domains, Subdomains, and Applications with SSL. Single web2py Instance on Apache

2011-07-13 Thread Ross Peoples
it looks correct, and shouldn't make any difference as long as indentation is correct. Maybe try lowercasing the domain names. Also, do you have any other routing options besides this one?

[web2py] Re: Admin security: https vs localhost

2011-07-13 Thread Ross Peoples
I have created Issue 336 with a patch that adds brute-force attack protection to the admin application using the input gathered from everyone: http://code.google.com/p/web2py/issues/detail?id=336 This does NOT add a password complexity requirement, as it seems this is a touchy issue at the mome

[web2py] Re: Python 3 and the future of web2py

2011-07-13 Thread Ross Peoples
Very true, we would need to create another branch of web2py, do the initial conversion to Python 3, then try to maintain it, coding updates and new features twice: once for Python 2.x and once again for Python 3.x, since the two have different coding requirements. Then both would need to be test

<    1   2   3   4   5   6   >