[web2py] Re: jquery ajax strange respond on second time

2014-06-02 Thread Piotr Ring
I see this but why its work on the first time. I tray use a async: true but this doesn't work . W dniu niedziela, 1 czerwca 2014 23:23:43 UTC+2 użytkownik Joe Barnhart napisał: I did see a warning in the jQuery docs about using async = False with the deferred jqXHR object (i.e. when

[web2py] Re: Restore missing web2py.socket

2014-06-02 Thread Niphlod
uhm, I see. This script doesn't use host:port but a socket file for the interaction between nginx and uwsgi. The first thing to do is be sure that uwsgi can create the file. You can check it with /etc/init.d/uwsgi start This should start the uwsgi process and report if any errors occurred.

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

2014-06-02 Thread Niphlod
it seems that you were loading sites before inside a specific directory (controlies) while now those are in the root. The first 303 points to */controlies/init/default/user/login?_next=/controlies/init/default/index* while the second to */init/default/user/login?_next=/init/default/index* The

[web2py] Re: best method to check for auth membership (with no DB IO)

2014-06-02 Thread Niphlod
I use often this form @auth.requires(lambda: auth.user_id and 'admin' in auth.user_groups.values()) There's really nothing one can't do with requires() . The problem with why doesn't web2py use cached values is that they're depending on the session, that can very well be not there (rest API,

[web2py] user roles

2014-06-02 Thread Yebach
Hello I am trying to get user's role looking into membership table etc. Following all the codes on majority of forums my code does not work. this is my controller from gluon.tools import Auth database = request.cookies['mycookie'].value db =

[web2py] How to update the stored original filename for upload field using smartgrid edit form?

2014-06-02 Thread Michael Beller
I'm trying to store the original filename, filetype, and filesize for an upload field using a smartgrid. I can add these fields during the insert (by setting the field defaults) but not update the fields if you update the uploaded file. The edit form does upload the new file but I don't know

[web2py] Re: user roles

2014-06-02 Thread Michael Beller
If the user is logged in, then auth.user_groups contains a dictionary of the user's roles. You can also use auth.has_membership('role name') to check membership. You can search auth.user_groups for a role, e.g., if any (role in ['customer_service', 'admin'] for role in auth.user_groups.

Re: [web2py] Re: Is web2py compatible with bootstrap 3.1.1

2014-06-02 Thread Massimo Di Pierro
This commit 666a389718bf19ed114db9485767c684630177e9 had bs3. It was removed because the developers have not reached agreement on how to do this. We cannot break bs2 apps and we do not want to make web2py too css specific. The MENU, the navbar, the grid and forms all depend on css classes and

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

2014-06-02 Thread Spokes
I have a table that contains the following field: Field('images', 'list:reference t_image'), I'd like to do the following: -make it so that the input for that field cannot be empty upon submission, and the number of references the user must select is in some range of numbers, (n_min, n_max)

[web2py] any upcoming web2py get together?

2014-06-02 Thread dlypka
I would like to visit the Chicago area and meet the web2py team (Massimo and co.). I have a very interesting (even inspiring) web2py story to tell. I will then bring other (major corporate) associates on a follow up trip. Is it possible? When, where? -- Resources: - http://web2py.com -

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

2014-06-02 Thread Anthony
Field('images', 'list:reference t_image'), I'd like to do the following: -make it so that the input for that field cannot be empty upon submission, and the number of references the user must select is in some range of numbers, (n_min, n_max) The IS_IN_DB validator takes a multiple

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

2014-06-02 Thread Spokes
Thanks, Anthony. I'm trying the following: Model: query_list = [(db.t_image.created_by == None)] if session.auth: query_list.append((db.t_image.created_by == session.auth.user.id)) query = reduce_db_queries(query_list, 'or') set = db.t_image.id.belongs(db(query)._select(limitby=(0,48)))

Re: [web2py] web2py CMS

2014-06-02 Thread Fabiano Almeida
Hi Andrey, So do you need a rich text editor? From web2py Examples (http://www.web2py.com/init/default/examples) Example 13 In controller: simple_examples.py def makertf(): import gluon.contrib.pyrtf as q doc=q.Document() section=q.Section() doc.Sections.append(section)

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

2014-06-02 Thread Anthony
Not sure if this is the only problem, but when you d do nested select, you should select only one column: set = db.t_image.id.belongs(db(query)._select(db.t_image.id, limitby=(0,48 ))) Anthony On Monday, June 2, 2014 1:56:30 PM UTC-4, Spokes wrote: Thanks, Anthony. I'm trying the following:

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

2014-06-02 Thread Spokes
I made the modification, and it's still producing the same error message. I get the impression that it has to do with the* db.t_image*'s format field. Do you think that this may be the case? Any other suggestions on how to go about resolving the issue? On Monday, June 2, 2014 1:43:33 PM

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

2014-06-02 Thread Anthony
You forgot the second argument to IS_IN_DB: IS_IN_DB(set, 't_image.id', db.t_image._format, multiple=(1,24))) Anthony On Monday, June 2, 2014 2:50:53 PM UTC-4, Spokes wrote: I made the modification, and it's still producing the same error message. I get the impression that it has to do with

[web2py] SQLFORM option fields

2014-06-02 Thread Fabiano Almeida
Hi, Can I use fileds option in normal SQLFORM ? How? I tried: form = SQLFORM(Solicitacao, fields=[Solicitacao.almoxarifado_id]) And has error. thanks, Fabiano. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code)

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

2014-06-02 Thread Spokes
Thanks! I removed that while doing some debugging, and forgot to bring it back in - it seems to have fixed the error originating in the model. Now that that's resolved, I'm a bit confused about how to use the gallery table with SQLFORM(). If I do the usual thing, as in the following line, there

[web2py] Re: problem with cyrillic in rest url

2014-06-02 Thread Derek
You have to put a 'u' in front of strings if you want unicode strings. Otherwise you are getting utf-8 strings. so, prefix your quoted strings with a u like so: patterns = [ u/name/{user.username}, u/email/{user.email}, ] On Friday, May 30, 2014 7:56:50 PM

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

2014-06-02 Thread Anthony
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 UTC-4, Spokes wrote: Thanks! I removed that while doing some debugging, and forgot to bring it back in -

[web2py] Re: SQLFORM option fields

2014-06-02 Thread Anthony
Should be db.Solicitacao.almoxarifado_id. Anthony On Monday, June 2, 2014 5:11:18 PM UTC-4, Fabiano Almeida wrote: Hi, Can I use fileds option in normal SQLFORM ? How? I tried: form = SQLFORM(Solicitacao, fields=[Solicitacao.almoxarifado_id]) And has error. thanks, Fabiano.

Re: [web2py] Re: SQLFORM option fields

2014-06-02 Thread Fabiano Almeida
Hi, Showing my code: Solicitacao = db.define_table(solicitacao, SQLField(solicitante_id, db.auth_user, default=me), SQLField(responsavel_id, db.auth_user, label='Responsável'), SQLField(almoxarifado_id, db.almoxarifado, notnull=True, label='Almoxarifado'),

Re: [web2py] Re: SQLFORM option fields

2014-06-02 Thread Fabiano Almeida
I just discovered the problem, the fields in the attribute fields should be quoted without the table name: form = SQLFORM(Solicitacao, fields=['almoxarifado_id']) Thanks, Fabiano 2014-06-02 20:15 GMT-03:00 Fabiano Almeida fabi...@techno7.com.br: Hi, Showing my code: Solicitacao =

[web2py] URL arguments problem

2014-06-02 Thread Júlia Rizza
Hello, My app have a controller that shows a project, since it receives the project owner username and the project id by the URL arguments. It would be like: myapp.com/projects/juliarizza/1234 But, I would like this URL to be myapp.com/juliarizza/1234, not showing the controller name. It

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

2014-06-02 Thread Shubham Sinha
So I am writing an app that allows users and employees to chat with each other in some sort of an instant messenger interface. I am using the web2py authentication for users and I added extra fields for the employees and created a separated authentication system for both of them however they

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

2014-06-02 Thread 黄祥
My question is, to integrate it with a chat application to work for the users and employees would I need to have the users and employees stored in separate tables? Should I create a separate table for the employees? It depends on how you designed your model, in the past i've walking in the

[web2py] Re: web2py CMS

2014-06-02 Thread Carlos A. Armenta Castro
Hi Andrey, I recommend you a new CMS named pynukedev: https://bitbucket.org/pynukedev According to RochacBruno the creator of Movuca - If you want a stable CMS for web2py take a look at PyNUke http://www.pynuke.net/ Regards El viernes, 30 de mayo de 2014 07:21:04 UTC-7, Andrey K

[web2py] Email attachment size limit

2014-06-02 Thread Guilherme Rosa
What is the email attachment size limit for any one file and as a whole? 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 received this

[web2py] Re: how to modify form input before validation and insert into database?

2014-06-02 Thread chuan137
Sorry for the late reply, but I just want to say thank you for the answer, I do not know how to create custom validator yet, but request.post_vars does the trick. On Tuesday, May 27, 2014 3:01:53 PM UTC+2, Anthony wrote: You could modify request.post_vars before creating the form, or create a

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

2014-06-02 Thread Shubham Sinha
Alright the only problem is that since I am not using web2py's built in user authentication for the employees wouldn't I need to write separate views for logout,login etc? I want the employee registration to be exactly like the user but with different fields On Monday, June 2, 2014 5:58:24 PM