Re: [web2py] if statement always true in view

2014-05-04 Thread Marin Pranjić
You have a typo in there. funciton should be function. That's why it always returns None. Marin On Sat, May 3, 2014 at 5:15 PM, john smith lukaszbur...@gmail.com wrote: Hello! I have a problem with 'reddit-clone' app from this tutorial. I'm stuck at moment in 2:28:00. My problem is with

Re: [web2py] Querying Tables from Private Folder

2014-05-04 Thread Marin Pranjić
Tables are in there but if you don't call db.define_table(...) DAL will not know about them. How are you running the script in private? You can do something like this: python web2py.py -S appname -M -R applications/appname/private/scriptname.py This will run your models before running the

Re: [web2py] Virtual Field not working anymore?

2014-05-04 Thread Marin Pranjić
In general, Virtual field will try to calculate it's value. It can fail (for example, you didn't select all the fields that are needed to do the calculation, or your calculation is buggy). If it fails, it won't be there. Which database are you using? I suspect that .count() returns None and thus

Re: [web2py] Howto deploy web2py on a shared host?

2014-05-04 Thread Marin Pranjić
Hi, It's really hard to tell. You should ask them. How do they setup python websites? You have to upload web2py but the issue is how to configure web server. You only need to configure to your virtual host file but I'm not sure if they allow that. Just email them and ask :) If they support

[web2py] Combining factory and grid forms

2014-05-04 Thread jarrodwilcox
Is it possible to use the form grid and smartgrid features on a table produced as with factory that has no corresponding database table? This would be very useful as my database storage is based on highly customized encrypted blobs. -- Resources: - http://web2py.com - http://web2py.com/book

[web2py] Re: SQLFORM.grid pagination problem

2014-05-04 Thread Elcimar
I will keep testing it for sure. I also was wondering if a wrong implementation of cache would cause this. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues)

Re: [web2py] Re: Create a copy record button in SQLFORM?

2014-05-04 Thread Richard Vézina
Sorry for miss leading, Niphold is true... So, for f, v in request.vars.iteritmes(): db.table[f].default = v On Sat, May 3, 2014 at 8:47 AM, Niphlod niph...@gmail.com wrote: request.vars is like a dict. Surely you're hitting that issue :-P test = dict(a=1,b=2) for k,v in test: ...

[web2py] strange problem with DAL

2014-05-04 Thread Marin Pranjić
Hi. I have application hosted on EC2. It is a testing server. It's like production environment except it uses SQLite. I have a table called message_receiver. When I fetch records (for ex. in appadmin) it works, but when I try to insert something (appadmin or in-app) i get the following error:

Re: [web2py] strange problem with DAL

2014-05-04 Thread Marin Pranjić
To confirm... https://github.com/web2py/web2py/blob/master/gluon/dal.py#L1262 This gets executed on every request. However I still don't understand why sqlite fails on insert. It fails on testing server but it works on my local instance. Marin On Sun, May 4, 2014 at 3:13 PM, Marin Pranjić

[web2py] Strange ajax problem

2014-05-04 Thread John Drake
I've created a simple ajax form to update a post database. For some strange reason when I post a new message, the button greys out. Here is the model: db.define_table('t_post', Field('f_post', type='text', label=T('Post')), auth.signature, format='%(f_post)s') Here are

[web2py] Does Web2py Postgres Adapter support JSON as native type ?

2014-05-04 Thread Mandar Vaze
I looked at the gluon/dla.py - and it seems native_json is set to true only for MongoDBAdapter (Default value in BaseAdapter is False) Postgres supports native datatype JSON since 9.3 (9.2?) But PostgresAdapter maps JSON DAL type to TEXT for PostgresAdapter 1. What am I missing (if anything)

[web2py] extract file from blob/bytea to store it on file system

2014-05-04 Thread Richard
Hello, I try to extract file from upload field of type blob to store my files on file system instead. I get there so far : rows = db().select(db.mytable.id, db.mytable.filename_field, db.mytable.blob_field) for i, row in enumerate(rows): if row.filename_field != '' and row.filename_field

Re: [web2py] extract file from blob/bytea to store it on file system

2014-05-04 Thread Niphlod
not sure what you want to accomplish but http://web2py.readthedocs.org/en/latest/dal.html#gluon.dal.DAL.Field.retrieve you're using nameonly, that explicitely doesn't return any content. On Sunday, May 4, 2014 7:58:03 PM UTC+2, Richard wrote: Hello, I try to extract file from upload

[web2py] Re: Does Web2py Postgres Adapter support JSON as native type ?

2014-05-04 Thread Niphlod
the postgres2 adapter is a proof of concept for working with arrays, it's not stable nor tested. stick to postgres. the default adapter for postgres first checks the version of the backend and then updates the mappings to the proper type is json native support is available. On Sunday, May 4,

Re: [web2py] strange problem with DAL

2014-05-04 Thread Niphlod
how are your table defined ? the fact that 'main.message' gets into the error seems a little weird for a table named message_receiver. Also, that success repeated into sql.log means that something really strange is going on with your migrations. On Sunday, May 4, 2014 3:22:19 PM UTC+2, Marin

[web2py] Re: SQLFORM.grid pagination problem

2014-05-04 Thread Niphlod
what do you mean by a wrong implementation of cache ? On Sunday, May 4, 2014 2:14:40 PM UTC+2, Elcimar wrote: I will keep testing it for sure. I also was wondering if a wrong implementation of cache would cause this. -- Resources: - http://web2py.com - http://web2py.com/book

Re: [web2py] extract file from blob/bytea to store it on file system

2014-05-04 Thread Richard Vézina
I saw the StringIO content of the blob. I had write a file manually with that blob content... I may have not look carefully... I will have another look. Richard On Sun, May 4, 2014 at 2:51 PM, Niphlod niph...@gmail.com wrote: not sure what you want to accomplish but

Re: [web2py] extract file from blob/bytea to store it on file system

2014-05-04 Thread Richard Vézina
In [16]: db.mytable.fieldname_field.retrieve(row.fieldname_field, nameonly=True)[1] Out[16]: cStringIO.StringI at 0x48cf9f0 In [17]: db.mytable.fieldname_field.retrieve(row.fieldname_field)[1] Out[17]: cStringIO.StringI at 0x48cf9f0 Idem :( Richard On Sun, May 4, 2014 at 3:49 PM, Richard

Re: [web2py] Re: Web2py gevent-socketio

2014-05-04 Thread Jesse Ferguson
Thank you Ricardo, I watched videos and read into the docs of everything you listed, Only thing I am bit unclear on is WSGI, If Im understanding correctly its really just a Middleware that sits between a Sever and a python Framework. However Im a bit confused How the stack works when

[web2py] Re: Howto deploy web2py on a shared host?

2014-05-04 Thread NeoToren
I would suggest you consider going with PythonAnywhere https://www.pythonanywhere.com/ 1. They have many tiers to offer, beginning with a basic ...FREE hosting option 2. The familiar interface of W2P is already installed on the hosting server, so if you have played with W2P locally on your

[web2py] Display table as dictionary

2014-05-04 Thread Greg Vaughan
The following code fields = db(db.address.business==4L).select().as_dict() returns a dictionary of dictionaries {1L: {'street_name': 'Another', 'postcode': '4888', 'id': 1L, 'unit': False, 'building_name': '', 'city': 'Deadsville', 'lot_section': None, 'sub_building': '', 'street_suffix':

[web2py] Can I simulate multiple user logins to web2py from a single computer?

2014-05-04 Thread Rufus
Web2py'ers: I am trying to create a back end for a multiple user game, including, for instance, a chat room function. However, when I try to do this locally, all windows change over to the most recent login. That is to say, I open up another window to the app, sign in with a different user

[web2py] Re: Can I simulate multiple user logins to web2py from a single computer?

2014-05-04 Thread Anthony
In Chrome, you can go to Settings, and in the Users section add multiple users to create different profiles. I think in that case each profile will get different browser session and therefore different session cookies, so you can maintain separate logins. For Firefox, there is

[web2py] Translate inside javascript function with javascript variable

2014-05-04 Thread lula bad
Hi, i have the following problem. I have a javascript funktion inside a script Tag inside the index.html Function is: var set_info_text = function (txt) { $('#info_text').innerHTML = '{{=T(txt)}}'; }; usage is: set_info_text('number peers online'); I get this errormessage:

Re: [web2py] Querying Tables from Private Folder

2014-05-04 Thread jawbax
Thanks Marin Is there any way to tun the script in isolation so that it can detect the tables? My current setup is that I have the web2py.py server already running and then running each Private script in isolation (general web scraping). On Sunday, 4 May 2014 09:58:38 UTC+2, Marin Pranjić

[web2py] Pages that only their author can view

2014-05-04 Thread Sidney Rubidge
I am trying to create a site where users can create pages. The user has a wall which lists all the pages that they have created. They can then view any of the pages that they have created. I am trying to set an authorisation so that only the page author can view the respective page. What I

Re: [web2py] if statement always true in view

2014-05-04 Thread john smith
Well, that was obvious:/ Thanks for help, works perfectly now. W dniu niedziela, 4 maja 2014 09:52:12 UTC+2 użytkownik Marin Pranjić napisał: You have a typo in there. funciton should be function. That's why it always returns None. Marin On Sat, May 3, 2014 at 5:15 PM, john smith

[web2py] Re: Display table as dictionary

2014-05-04 Thread Massimo Di Pierro
fields = db(db.address.business==4L).select().first().as_dict() On Sunday, 4 May 2014 16:59:34 UTC-5, Greg Vaughan wrote: The following code fields = db(db.address.business==4L).select().as_dict() returns a dictionary of dictionaries {1L: {'street_name': 'Another', 'postcode': '4888',

Re: [web2py] Re: Display table as dictionary

2014-05-04 Thread Jonathan Lundell
On 4 May 2014, at 9:46 PM, Massimo Di Pierro massimo.dipie...@gmail.com wrote: fields = db(db.address.business==4L).select().first().as_dict() AttributeError: 'NoneType' object has no attribute 'as_dict' (just sayin'...) On Sunday, 4 May 2014 16:59:34 UTC-5, Greg Vaughan wrote: The

Re: [web2py] Re: Web2py gevent-socketio

2014-05-04 Thread Anthony
Note, WSGI is not a piece of software -- it is just a specification for how the web server and the web app communicate with each other. Anthony On Sunday, May 4, 2014 5:01:21 PM UTC-4, Jesse Ferguson wrote: Thank you Ricardo, I watched videos and read into the docs of everything you listed,

Re: [web2py] Re: Web2py gevent-socketio

2014-05-04 Thread Jesse Ferguson
ah yes i keep forgetting that pep333 i believe -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to