[web2py] Re: how to insert dynamic record id into field in form

2015-03-11 Thread Gray Kanarek
You can probably use the compute keyword to the particular field. http://www.web2py.com/books/default/chapter/29/06/the-database-abstraction-layer#Computed-fields On Tuesday, March 10, 2015 at 3:49:05 PM UTC-4, Alex Glaros wrote: > > I want to insert the record id into one of its fields during r

[web2py] web2py in-browser editor failing to load on Chrome

2015-03-11 Thread Gray Kanarek
Hi all, I've been using web2py for a couple weeks now and I think it's amazing! However, today when I tried to work on my app, via the in-browser editor, the editor doesn't load. The admin interface is fine, the design page works fine, but the editor itself is mostly blank. This happens only

[web2py] Re: web2py in-browser editor failing to load on Chrome

2015-03-11 Thread Gray Kanarek
For some reason this isn't happening today... I don't really understand (didn't quit browser or reboot computer...), but it's fixed, anyway. On Wednesday, March 11, 2015 at 2:07:02 PM UTC-4, Gray Kanarek wrote: > > Hi all, > > I've been using web2py fo

[web2py] integrating materialize.css

2015-03-12 Thread Gray Kanarek
Someone recommended materialize.css as a great css resource. Does anyone have suggestions with how to integrate this with a web2py app? In general, a tutorial for using 3rd-party css packages would be great... at the very least, maybe some guidelines on how to creat

[web2py] accessing current.variable from a module

2015-03-12 Thread Gray Kanarek
I'm defining a variable in one of my modules: from gluon import * def initialize(): current.output_buffer = deque(maxlen=100) The problem is, when I try to access the same variable in a different routine in the same module, I get: def parse_command(command): pre_buffer = current.outp

[web2py] Re: IMPORTANT - DROPPING SUPPORT FOR PYTHON 2.5?

2015-03-12 Thread Gray Kanarek
OSX earlier than 10.7 isn't supported by Apple anymore (and so is a pain to use), and even 10.6.8 shipped with 2.6. On Wednesday, March 11, 2015 at 7:41:33 PM UTC-4, LightDot wrote: > > RHEL 5 (and naturally CentOS 5 etc.) ship with python 2.4.3, that's > already water under the bridge as far ar

[web2py] Re: SQLFORM refresh

2015-03-12 Thread Gray Kanarek
Is the alteration done automatically? Or is it something that's applied later? Due to user input? If this alteration is automatic, you can use the represent keyword to Field(). On Thursday, March 12, 2015 at 10:35:57 AM UTC-4, horridohobbyist wrote: > > If I use SQLFORM to update an existing re

[web2py] Re: Can we disable moderation in the group?

2015-03-12 Thread Gray Kanarek
I've been moderated for more than the first post... On Tuesday, March 10, 2015 at 10:39:46 AM UTC-4, Massimo Di Pierro wrote: > > We only moderate the first post. We get lots of spam. > > On Friday, 6 March 2015 20:12:30 UTC-6, Jack Kuan wrote: >> >> I don't see the need and think it can be off pu

[web2py] Re: accessing current.variable from a module

2015-03-13 Thread Gray Kanarek
in the same thread while calling BOTH initialize and > parse_command() ? > > On Thursday, March 12, 2015 at 7:46:16 PM UTC+1, Gray Kanarek wrote: >> >> I'm defining a variable in one of my modules: >> >> from gluon import * >> >> >>

[web2py] storing user-defined classes across sessions

2015-03-13 Thread Gray Kanarek
I'm working on a website for a game, the engine of which involves a heirarchy of custom classes. I need to find some way to store the gamestate between sessions, so that logged-in users can pick up a game from one of their associated characters from where they last saved. My original idea was t

[web2py] action when leaving a page

2015-03-16 Thread Gray Kanarek
Is it possible to have something happen when leaving a page? I have a variable stored in session that I want to only exist while on a particular page; at the moment I have other pages removing that variable, but then if the user opens another page in a new tab it causes an error. Is there a way

[web2py] Re: Adding id to URL in HTML helper callback

2015-03-16 Thread Gray Kanarek
You could also do URL('results', vars={id:row.id}) On Sunday, March 15, 2015 at 6:19:54 PM UTC-4, Garry Smith wrote: > > I've found a solution using the following:- > > > {{ > for row in rows: > a =results?id= > b = str(row.id) > c = a + b > > }} > > {{=A('click' , callback=URL(c), target="flash")

[web2py] Re: storing user-defined classes across sessions

2015-03-16 Thread Gray Kanarek
gt; classes are you pickling? > > On Friday, 13 March 2015 16:30:39 UTC-5, Gray Kanarek wrote: >> >> I'm working on a website for a game, the engine of which involves a >> heirarchy of custom classes. I need to find some way to store the gamestate >> between ses

[web2py] Re: action when leaving a page

2015-03-17 Thread Gray Kanarek
The variables I'm trying to store are the gamestate and character information for a game. If I do this, it exposes that information in the source of the page, and could theoretically be editable by the user (correct?). Even if it's not editable, it's a sizable amount of code, and it also change

[web2py] Re: action when leaving a page

2015-03-17 Thread Gray Kanarek
Ah, sure. The game is a text adventure that I wrote as a command-line python game (actually, originally it ran via a bot in irc), which is why I wanted to use a python web framework to design the web interface. The gamestate is a jsonpickle of the game engine object heirarchy, and the character

[web2py] Re: Wrong installed apps list in admin

2015-03-17 Thread Gray Kanarek
I also saw all of those when I installed a fresh mac web2py a couple weeks ago... but when I installed via pythonanywhere, they were not included. On Tuesday, March 17, 2015 at 10:35:55 AM UTC-4, Massimo Di Pierro wrote: > > ca you get a directory listing under web2py/applications? I think you ha

[web2py] Re: action when leaving a page

2015-03-18 Thread Gray Kanarek
I wasn't clearing the session itself, just those two variables (setting session.char_dict = {}, session.gamestate = ""), but your point is taken, especially with how poorly my current solution is working. I can't pass around just the id (which was a previous implementation that I tried) because

[web2py] Re: Problems with authentication Linkedin.

2015-03-18 Thread Gray Kanarek
If the folder is in "modules", it won't be in gluon.contrib... you'd need to put it in web2py/gluon/contrib, I would guess, though that didn't work for me either. The best solution I found was to put external packages (in my case jsonpickle) in web2py/site-packages, at which point it can be imp

[web2py] Re: Printing data on web2py view page is different from python shell

2015-03-18 Thread Gray Kanarek
Could also try BEAUTIFY(), which will accept a list and print it out as a table. On Wednesday, March 18, 2015 at 8:53:13 AM UTC-4, Leonel Câmara wrote: > > This is just how HTML works. You may want to study HTML a bit more but > here's a quick n' dirty solution. > > {{extend.layout.html}} > Answ

[web2py] Dropbox in the book

2015-03-21 Thread Gray Kanarek
The book has the following instructions for integrating Dropbox: from gluon.contrib.login_methods.dropbox_account import use_dropbox use_janrain(auth,filename='private/dropbox.key') mydropbox = auth.settings.login_form Should that be use_dropbox in L2 instead of use_janrain (since you imported

[web2py] storing variables between modules

2015-03-22 Thread Gray Kanarek
I'm working on an app which involves analysis of numpy arrays. I intend for the arrays to be stored in files in the user's dropbox (and the app links to dropbox), so as not to clutter my app's storage with hundreds of (possibly large) files. When a user selects a file, the data is read and then

[web2py] Re: Dropbox in the book

2015-03-23 Thread Gray Kanarek
gt; > On Sunday, 22 March 2015 00:36:25 UTC-5, Gray Kanarek wrote: >> >> The book has the following instructions for integrating Dropbox: >> >> from gluon.contrib.login_methods.dropbox_account import use_dropbox >> use_janrain(auth,filename='private/dropbox.key&

[web2py] Re: Web2py security questions

2015-03-28 Thread Gray Kanarek
This might help with the second question: http://stackoverflow.com/questions/32369/disable-browser-save-password-functionality This (and included links) might help with the first. On Friday, March 27, 2015 at 7:12:02 PM UTC-4, Scott Hunter wrote: > > 1. Does web2py employ, allow or support any

[web2py] Re: fields strings to variable for fields=fields

2015-03-28 Thread Gray Kanarek
With the information here http://www.web2py.com/books/default/chapter/29/06/the-database-abstraction-layer#Run-time-field-and-table-modification you can do db['mytable']['field1']. So you'd want something like: field_list_split = [i.split(.) for i in field_list] fields = [db[table][field] for d

[web2py] Re: Write dynamic query in DAL without extra nested parentheses

2015-03-31 Thread Gray Kanarek
You want belongs, I think: query = db.product.id.belongs((selected_ids)) On Saturday, March 28, 2015 at 12:14:44 PM UTC-4, gb wrote: > > What is the DAL Code to generate a query like this: > SELECT * FROM product WHERE product.id=1 OR product.id=2 OR product.id=3 > OR product.id product.id=4 O