[web2py] Re: user roles

2014-06-03 Thread Yebach
If I use your if statement in my controller, this is the error I get type 'exceptions.AttributeError' 'Auth' object has no attribute 'user_groups' why?? On Monday, June 2, 2014 3:13:26 PM UTC+2, Michael Beller wrote: If the user is logged in, then auth.user_groups contains a dictionary of

[web2py] How to handle \t \r in text area

2014-06-03 Thread LoveWeb2py
I have a large file that starts a new line at every \r I want users to be able to copy and paste their data into the web2py textarea field. When I check the form.vars it does show the \t \r's in the text, but when I check form.vars.fieldname it strips the r's. How can I iterate through their

[web2py] select only one table in a joined select

2014-06-03 Thread Robin Manoli
Hey, I have a many-to-manyrelation, such as: *db.define_table('product_tag',Field('product', 'reference product'),Field('tag', 'reference tag'),)* Now when I would like to select the tags for a product with the id row.product.id, I came up

[web2py] web2py function import not working well

2014-06-03 Thread Maurice Waka
from applications.Folders1.modules.myfolder1.main import mainfrom applications.Folders1.modules.myfolder1.list1 import GAMES0 code.if id == name3: result = location return result else: while True: class

[web2py] Re: Modifying select element created from a list:reference field

2014-06-03 Thread Spokes
Yep - that took care of it. Thanks, Anthony! On Monday, June 2, 2014 5:17:02 PM UTC-5, Anthony wrote: Your set object is actually a Query, not a Set -- should be: set = db(db.t_image.id.belongs(db(query)._select(db.t_image.id, limitby=(0 ,48 Anthony On Monday, June 2, 2014 5:27:12 PM

[web2py] Re: Apache-wep2py error when upgrading to Debian Wheezy

2014-06-03 Thread Alfonso Pastor Sierra
Hello The apache setup is the same for both servers. I don't have routes.py files. With the URL http://ldap/controlies/init/default/user/login?_next=/controlies/init/default/index runs ok on both servers (Squeeze and Wheezy), but with http://ldap/controlies fails on the Debian Wheezy

[web2py] TABLE and aggregate fields

2014-06-03 Thread Massimiliano
Hello, I've an application in production with 2.5.1-stable+timestamp.2013.06.06.15.39.19, and I would like to update at the newest web2py 2.9.5-stable+timestamp.2014.03.16.02.35.39, but I could a problem with aggregate fields. That is what's happen: If I print my Rows var I get: print rows:

[web2py] Is it easy to create a grid data entry form using web2py?

2014-06-03 Thread cl
This may be trying to run before I can walk but never mind! :-) Is it easy to create a grid type table editing form in web2py? I just want an easy way to edit an existing table, edit existing fields and add new rows. It's just simple data, text and numeric fields in a sqlite3 database. I want

[web2py] Re: user roles

2014-06-03 Thread Michael Beller
confirm that you have a logged in user first On Tuesday, June 3, 2014 3:00:18 AM UTC-4, Yebach wrote: If I use your if statement in my controller, this is the error I get type 'exceptions.AttributeError' 'Auth' object has no attribute 'user_groups' why?? On Monday, June 2, 2014

[web2py] Re: Problems with multiple forms and SQLFORM.grid

2014-06-03 Thread john smith
Can anybody help me? I still can't figure it out on my own... W dniu niedziela, 1 czerwca 2014 16:10:07 UTC+2 użytkownik john smith napisał: I want to create a page that will display user data, with additional controls. I want librarian to be able to add user to 'readers' and remove group,

[web2py] How to change SQLFORM smartgrid title

2014-06-03 Thread LoveWeb2py
Noob question -- I searched around and couldn't find an answer on how to change the SQLFORM.smartgrid label which displays the name of the database. I know you can set fields in a table by typing label='newName', but how can I change the table name itself so it doesn't display the table name in

[web2py] Re: Problems with multiple forms and SQLFORM.grid

2014-06-03 Thread LaDarrius Stewart
1) Use SQLFORM factory. 2) Name your forms example below. (changes in red do this to them all with different names of course) 3) Not sure whats going on can you explain a bit more? form2=FORM('Your name:', INPUT(_name='grupa', _type='text'), INPUT(_type='submit')) if

[web2py] Re: Is it easy to create a grid data entry form using web2py?

2014-06-03 Thread LaDarrius Stewart
Like this? http://www.web2pyslices.com/slice/show/1928/basic-inline-editing-in-sqlformgrid-no-plugin-no-javascript On Tuesday, June 3, 2014 7:25:19 AM UTC-5, c...@isbd.net wrote: This may be trying to run before I can walk but never mind! :-) Is it easy to create a grid type table editing

[web2py] Re: select only one table in a joined select

2014-06-03 Thread LaDarrius Stewart
The join is making that happen. Why not just do *dbTags = db(db.product_tag.product==row.product.id http://row.product.id/).select(db.product_tag.tag)* *Whats the point in the join on a m2m table?* On Tuesday, June 3, 2014 3:54:52 AM UTC-5, Robin Manoli wrote: Hey, I have a

Re: [web2py] Re: web2py CMS

2014-06-03 Thread Michele Comitini
+1 pynuke while in beta is very good already and actively developed. 2014-06-02 4:51 GMT+02:00 Carlos A. Armenta Castro carlos.armen...@gmail.com: Hi Andrey, I recommend you a new CMS named pynukedev: https://bitbucket.org/pynukedev According to RochacBruno the creator of Movuca - If

[web2py] show_if belongs condition.second is set()

2014-06-03 Thread sunny
The following show_if condition gives me an Not Implemented Error: auth_table_user.position.show_if = auth_table_user.employee_type.belongs(('employee', 'external')) I fixed it for me, with the following change in sqlhtml.py if cond.op.__name__ == 'BELONGS' and

[web2py] Re: Is it easy to create a grid data entry form using web2py?

2014-06-03 Thread cl
LaDarrius Stewart ladarrius.stew...@gadgroup.com wrote: [-- text/plain, encoding quoted-printable, charset: UTF-8, 52 lines --] Like this? http://www.web2pyslices.com/slice/show/1928/basic-inline-editing-in-sqlformgrid-no-plugin-no-javascript Yes, that's pretty much what I'm after. Just

[web2py] Re: Problems with multiple forms and SQLFORM.grid

2014-06-03 Thread john smith
Thanks, naming forms works as expected. Regarding grid, when I try to access show_readers function as admin, I get redirected to readers function with flash message saying: 'not authorized'. Librarian can access it, but not if I move the grid code outside of if statement, then librarian gets

[web2py] Re: How to organize the model for a chat application?

2014-06-03 Thread Rufus
If you don't want to create group authentication, and playing with a single registration view different types of users. I wonder if you could have the users log into to a completely different app, if all it was for was for the chat. It is possible to share databases between web2py

[web2py] Re: Problems with multiple forms and SQLFORM.grid

2014-06-03 Thread Niphlod
the easiest (and eastethically pleasing) method is to use components: controllers/default.py def index(): form1 = LOAD('default', 'form1.load', ajax=True) form2 = LOAD('default', 'form2.load', ajax=True) form3 = LOAD('default', 'form3.load', ajax=True) def form1(): grid =

[web2py] Re: TABLE and aggregate fields

2014-06-03 Thread Niphlod
it's not a problem. we just changed the way a Rows class gets represented (printing resultsets with 1k rows was kynda lame ^_^) if you do print rows things change, but for row in rows: print row doesn't change a bit. On Tuesday, June 3, 2014 12:53:08 PM UTC+2, Massimiliano wrote:

[web2py] Re: Email attachment size limit

2014-06-03 Thread Niphlod
there are not hardcoded limits. those are usually smtp dependant (you'd get an error with mail.send()) or dependant on receivers capacity (in which case you'd receive a bounced email) On Monday, June 2, 2014 9:21:10 PM UTC+2, Guilherme Rosa wrote: What is the email attachment size limit for

[web2py] Re: Problems with multiple forms and SQLFORM.grid

2014-06-03 Thread LaDarrius Stewart
As far as I could replace it with SQLFORM but then I need to know how to hide user_id field and set it to user.id value What do you mean are you just trying to hide the id value? like this - db.table.id.readable=False ? On Sunday, June 1, 2014 9:10:07 AM UTC-5, john smith wrote: I want to

[web2py] Re: user roles

2014-06-03 Thread Michael Beller
I just tested and reread your original post. auth.user_groups is a dict containing the id and role for each auth_group for the logged in user auth.user_group is a method of auth from the book: auth.user_groups contains a dictionary where each key is the id of a group of with the current

[web2py] Re: How to handle \t \r in text area

2014-06-03 Thread LoveWeb2py
I figured out when I type form.vars.fieldname.file it maintains the \r \n, but I haven't tested it on the text area yet. Going to give that a try and hope for the best. Thanks guys On Tuesday, June 3, 2014 4:44:23 AM UTC-4, LoveWeb2py wrote: I have a large file that starts a new line at every

[web2py] Re: Problems with multiple forms and SQLFORM.grid

2014-06-03 Thread john smith
Yes, it works if I add writable=False, but I still have to set user_id to user.id and I don't know how to do that. In regards to components, I'm not sure how does it solve my problem. Could you please elaborate? I will look into this to improve my project but I have deadline on Monday and need

[web2py] Re: How to change SQLFORM smartgrid title

2014-06-03 Thread Michael Beller
I believe smartgrid uses the table _plural attribute for the first item in the smarrgrid breadcrumb. If _plural is not set, it uses the table name and a pluralization function to create the name. You can set the attributes in the define table method, e.g., singular=Dog, plural=Dogs You can

[web2py] crud.create form does not show errors in iframe

2014-06-03 Thread Adam Filić
I have simple crud.update form which works as expected but when I embed the same form in iframe on another site id does not show the form input errors at all. It does not accept form if errors exists and that is OK but I don't know how to force it to show the errors to my users? Is it normal

[web2py] Re: How to migrate to UUID references in db without messing up reference fields

2014-06-03 Thread Ian W. Scott
Thanks very much Massimo and Philip. I had missed the fact that the id_map parameter triggered smart updating of the reference fields. That's great and for the moment is solves my problem. I'll keep thinking about a longer-term solution for syncing. Here's what I'm thinking would be desirable:

[web2py] plugin_dataTables

2014-06-03 Thread Manuele Pesenti
I'd like to share this plugin I prepared... maybe I'll produce a web2py slice recipe about how to use it but for the moment if you are interested in it you can browse the demo application or look the code of the plugin_examples files. I hope to collect contributions and comments :)

[web2py] Re: select only one table in a joined select

2014-06-03 Thread Annet
Hi Robin Assuming your product_tag table contains product Ids and tag Ids and you want a list of tags for a given product id This should work : tags = db((db.product_tag.product==row.product.id)(db.product_tag==db.tag.id)).select(db.tag.name).as_list() Regards, Annet -- Resources: -

[web2py] Re: How to change SQLFORM smartgrid title

2014-06-03 Thread LoveWeb2py
Thanks, Michael! On Tuesday, June 3, 2014 12:21:39 PM UTC-4, Michael Beller wrote: I believe smartgrid uses the table _plural attribute for the first item in the smarrgrid breadcrumb. If _plural is not set, it uses the table name and a pluralization function to create the name. You can

Re: [web2py] Re: how to determine the server (name) ?

2014-06-03 Thread Dave S
On Saturday, May 31, 2014 12:31:57 PM UTC-7, aapaap wrote: thanks Leonel and Michael. forgot to tell there are 2 programs running at least on one of those servers, a web2py application and another application polling a solar system. So I don't always have the request variable. Not

[web2py] Re: web2py CMS

2014-06-03 Thread Derek
I would recommend Plone (http://plone.org/). It's a very good Python CMS with a 13 year history. There's also Tactic (http://community.southpawtech.com/get-started) which is good, if you handle digital assets like video files. On Friday, May 30, 2014 7:21:04 AM UTC-7, Andrey K wrote: I am

[web2py] Re: web2py function import not working well

2014-06-03 Thread Derek
Sorry, but it looks like it's doing what you are asking of it. Perhaps you should comment your code to make sure it's doing what you are thinking it's doing. you are instantiating a new filters class, giving it the name 'o', then you get a list of the contents of that class, run them if

[web2py] How to add button on SQLFORM.grid?

2014-06-03 Thread Fabiano Almeida
Hi, How to add button/field on SQLFORM.grid? I need create link to edit slave table with row id. Thanks, Fabiano -- 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

Re: [web2py] web2py function import not working well

2014-06-03 Thread Maurice Waka
When I work with the same module on python shell, its perfectly printing out. I dont know why it does not print on web2py. Basically I imported it without editing from python shell. Anyway since am new to web2py and python, you could help out On Tuesday, June 3, 2014, Derek sp1d...@gmail.com

Re: [web2py] Re: web2py CMS

2014-06-03 Thread Fabiano Almeida
Plone +1 2014-06-03 15:52 GMT-03:00 Derek sp1d...@gmail.com: I would recommend Plone (http://plone.org/). It's a very good Python CMS with a 13 year history. There's also Tactic ( http://community.southpawtech.com/get-started) which is good, if you handle digital assets like video files.

[web2py] Re: Restore missing web2py.socket

2014-06-03 Thread lesssugar
Did as you wrote, but there were no errors in uwsgi logs. In the next step nginx logged exactly the same error as described in my first post. I'm thinking of setting web2py up again, from scratch. Can you suggest a good .sh script for that purpose? I use CentOS 6.4. Thanks for help. On

Re: [web2py] web2py function import not working well

2014-06-03 Thread Michael Beller
Some of the code in the functions and classes not displayed in your original post may reference web2py globals and environment variables. I think (I'm still learning web2py also) that running your code in the shell then has access to the web2py environment. Modules do not have access

[web2py] Re: Alternative to SQLFORM for Angular

2014-06-03 Thread Trollkarlen
What happened to this? /R -- 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 the Google Groups

[web2py] nodejs and web2py

2014-06-03 Thread eric cuver
hello Is it possible to work web2py with nodejs and that somebody knows the procedure thank you -- 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

[web2py] Is it easy to create a grid data entry form using web2py?

2014-06-03 Thread Chris Green
This may be trying to run before I can walk but never mind! :-) Is it easy to create a grid type table editing form in web2py? I just want an easy way to edit an existing table, edit existing fields and add new rows. It's just simple data, text and numeric fields in a sqlite3 database. I want

[web2py] better way to find the updated or inserted record id

2014-06-03 Thread chuan137
Before I insert a record, I need to check whether the record is already in database. If true, then I need to know the id of the record. Below is my implementation, I first does the query, and check whether record exist or not query = db(db.groups.name == 'some_name').select() if

[web2py] Reading and extracting strings from a file

2014-06-03 Thread Akhila Reddy
I am a beginner.I want to extract some text from a file.Where do I upload the file and how can I extract the text?Please help me out.(Using python) -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) -

[web2py] Re: plugin_dataTables

2014-06-03 Thread Massimo Di Pierro
Could you post some screenshots? On Tuesday, 3 June 2014 12:08:03 UTC-5, Manuele wrote: I'd like to share this plugin I prepared... maybe I'll produce a web2py slice recipe about how to use it but for the moment if you are interested in it you can browse the demo application or look the

[web2py] Re: plugin_dataTables

2014-06-03 Thread Massimo Di Pierro
Thank you for sharing this. On Tuesday, 3 June 2014 12:08:03 UTC-5, Manuele wrote: I'd like to share this plugin I prepared... maybe I'll produce a web2py slice recipe about how to use it but for the moment if you are interested in it you can browse the demo application or look the code of

[web2py] Re: better way to find the updated or inserted record id

2014-06-03 Thread Massimo Di Pierro
You should not access query.records since it may go away. You can do: row = db.groups(name http://db.groups.name/='some_name') or db.groups.insert(...) It is still two queries but a little faster because db.groups(name http://db.groups.name/ = 'some_name') only looks for the first match. On

[web2py] Re: nodejs and web2py

2014-06-03 Thread Massimo Di Pierro
node.js assumes a server in JS, web2py is written in Python. I guess you can have a a node.js app and web2py app share a database but that is about it. On Tuesday, 3 June 2014 01:37:06 UTC-5, eric cuver wrote: hello Is it possible to work web2py with nodejs and that somebody knows the

[web2py] Re: Reading and extracting strings from a file

2014-06-03 Thread Massimo Di Pierro
def index(): form = FORM(INPUT(_type='file',_name='myfile'),INPUT(_type='submit',_value='upload')) if form.process().accepted and form.vars.myfile: text = form.vars.myfile.file.read() form = DIV(XML(text)) return dict(form = form) On Tuesday, 3 June 2014

[web2py] Re: nodejs and web2py

2014-06-03 Thread Anthony
You might be able to use something like ZeroRPC to communicate between the two on the server: http://zerorpc.dotcloud.com/ Anthony On Tuesday, June 3, 2014 4:17:05 PM UTC-4, Massimo Di Pierro wrote: node.js assumes a server in JS, web2py is written in Python. I guess you can have a a

[web2py] How to redirect a page after Google OAuth login?

2014-06-03 Thread Omar Meat Boy Gutiérrez
I am using Google OAuth to login in my app. In `default/index.html` I have some buttons (as a menu), each button have a link to specific controller. When I click on one of those buttons, my app go to 'default/user/login'. After login process I am being redirected to `default/index.html`.

[web2py] Re: Restore missing web2py.socket

2014-06-03 Thread Niphlod
uwsgi either creates the file, or it errors out and stops. It can't work otherwise if the script you used is that one. Look into /etc/uwsgi/web2py.ini to see the socket path. As a good script, sorry, I refrain from anything not Debian-related as nightmares although nginx+uwsgi+web2py is one

[web2py] Re: How to add button on SQLFORM.grid?

2014-06-03 Thread Niphlod
two simple steps: 1) read ALL this http://web2py.com/books/default/chapter/29/07/forms-and-validators#SQLFORM-grid-and-SQLFORM-smartgrid 2) if you don't know how to do it with the links argument, go to step 1) ^_^ On Tuesday, June 3, 2014 9:24:26 PM UTC+2, Fabiano Almeida wrote: Hi, How

[web2py] Re: How to redirect a page after Google OAuth login?

2014-06-03 Thread Omar Meat Boy Gutiérrez
I solved: vars={'_next':request.env.request_uri} (auth.user or request.args(0) == 'login') or\ redirect(URL('default', 'user', args='login', vars=vars)) On Tuesday, June 3, 2014 5:12:06 PM UTC-5, Omar Meat Boy Gutiérrez wrote: I am using Google OAuth to login

Re: [web2py] Re: How to add button on SQLFORM.grid?

2014-06-03 Thread Fabiano Almeida
Thanks Niphlod, Using links worked! Fabiano. 2014-06-03 19:21 GMT-03:00 Niphlod niph...@gmail.com: two simple steps: 1) read ALL this http://web2py.com/books/default/chapter/29/07/forms-and-validators#SQLFORM-grid-and-SQLFORM-smartgrid 2) if you don't know how to do it with the links

[web2py] How to use createargs in SQLFORM.grid?

2014-06-03 Thread Fabiano Almeida
Hi, How to use creatargs in SQLFORM.grid? Table: Objeto = db.define_table('objeto', SQLField('almoxarifado_id', db.almoxarifado, notnull=True, readable=True, writable=True, label='Almoxarifado'), SQLField('nome', 'string', length='50', notnull=True, label='Nome'),

[web2py] Re: How to use createargs in SQLFORM.grid?

2014-06-03 Thread Fabiano Almeida
In manual dont have example of createargs: while createargs, editargs and viewargs are passed only to the specific create, edit and details SQLFORMs this is the only reference manual Em quarta-feira, 4 de junho de 2014 00h43min27s UTC-3, Fabiano Almeida escreveu: Hi, How to use

Re: [web2py] Re: How to use createargs in SQLFORM.grid?

2014-06-03 Thread Kiran Subbaraman
You can create a dictionary that represents the arguments passed to the SQLFORM(), and pass it in createargs, editargs, viewargs. The code basically updates the SQLFORM (not the grid) with the appropriate create/edit/view args: