[web2py] Re: Select from auth_user with auth.has_membership condition

2016-12-21 Thread antonella . mauri
On Thursday, December 22, 2016 at 5:13:17 AM UTC+1, antonel...@yottacle.com wrote: > > Hi, > in my model I have users who have membership to more groups. > I am trying to perform a query of users who DO NOT belong to a group; > something along these lines: > > query = db ((db.auth_user !=

[web2py] Re: Layout design with angular material and web2py

2016-12-21 Thread Biplov Bhandari
Update. I am able to load the auth/_login.html but the form is not included. The div id='body' looks like this now: {{=response.title or app_settings["system_name"]}} {{block content_form}} {{include}} {{end content_form}}

Re: [web2py] Re: custom form default value

2016-12-21 Thread Tom Schuerlein
Thank you, I was completely unaware that this syntax was needed. I will never get those 2 hrs of my life back, but thanks to you I will sleep well tonight!!! You are THE BOSS. On Wed, Dec 21, 2016 at 5:52 AM, Anthony wrote: > > id="sample_sample_name"

[web2py] Re: Select from auth_user with auth.has_membership condition

2016-12-21 Thread Anthony
auth.has_membership is not used to construct DAL queries -- it is for checking whether a given user actually has a given membership (it returns True or False). Also, its second argument should not be a DAL Field object. You need to construct a query based on the db.auth_membership table.

[web2py] Re: why you should upgrade to web2py 2.13.4

2016-12-21 Thread Anthony
On Wednesday, December 21, 2016 at 11:13:17 PM UTC-5, Rodrigo attique santana wrote: > > > Hello, I recently upgraded my version of web2py to 2.13, however I am > having compatibility issues on projects created in version 2.11, which do > not run in this version. The same is true for projects

[web2py] Re: Linking Auth with another table to store additional info about user

2016-12-21 Thread Anthony
Think about how many users and how much extra space those fields will really take in the auth_user table vs. both the complexity and inefficiency of having to do joins whenever you need the extra fields if you keep them in a separate table. You might also consider keeping some of the extra data

[web2py] Re: Linking Auth with another table to store additional info about user

2016-12-21 Thread 黄祥
why not create a new table for that and reference it to auth_user table? *e.g.* *models/db.py* db.define_table('employee', Field('is_auth', 'boolean'), * Field('auth_user', 'reference auth_user'), * Field('first_name'), Field('last_name'), Field('email', 'list:string'), Field('occupation'),

[web2py] How to install GitPython into webp2y app modules directory?

2016-12-21 Thread Manohar Ramarao
Hi, I need to do operations with git repository from my web app built on web2py. I can't add this into python's site-packages. I need to ship it along with the web app. Thanks, Manohar -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py

[web2py] Issues with record versioning

2016-12-21 Thread Ricardo Oliveira
Hi, I'm having a couple of issues with record versioning: 1) I had to directly "force" versioning for tables (db.mytable._enable_record_versioning() for each table), although I have: auth.define_tables(username=True, signature=True) auth.enable_record_versioning(db,

[web2py] MSSQL connection

2016-12-21 Thread Steve Lyle
Hi guys. Newbie (of sorts) here. 20+ years in programming including Python but not for a couple of years now. But now I have the first time opportunity to build my application in web2py ~ so not a newbie but yes a web2py newbie. Any quick start guides/guide for dummys style for adapting the

[web2py] Modular application recipes

2016-12-21 Thread Andrea Fae'
Why this line {{=LOAD('default', 'list_items', ajax = True, target ='showitems')}} doens't work in the recipe Modular application in the cookbook web2py? Do you have the same problem? It's not showing the list of items. DO you know some easier tutorial og web2py, otherwise the Di Pierro book

[web2py] Select from auth_user with auth.has_membership condition

2016-12-21 Thread antonella . mauri
Hi, in my model I have users who have membership to more groups. I am trying to perform a query of users who DO NOT belong to a group; something along these lines: query = db ((db.auth_user != auth.user.id) & (~(auth.has_membership ("admin", db.auth_user.id))).select (db.auth_user.first_name,

[web2py] Layout design with angular material and web2py

2016-12-21 Thread Biplov Bhandari
Hi All, I am trying to use angular material with web2py. My layout.html using angular material looks like this: http://pastebin.com/Fydxwb8w. The layout looks like this when loaded in browser: [image: AP4XDAk.png (1823×1041)] I am trying to create login form. My form style looks like this:

[web2py] Re: why you should upgrade to web2py 2.13.4

2016-12-21 Thread Rodrigo attique santana
Hello, I recently upgraded my version of web2py to 2.13, however I am having compatibility issues on projects created in version 2.11, which do not run in this version. The same is true for projects created in version 2.13. Em sábado, 26 de dezembro de 2015 06:22:27 UTC-2, Massimo Di Pierro

Re: [web2py] How to run web2py on Linux Shared Hosting With No Shell, or SSH access

2016-12-21 Thread Muhammad Hashim Malik
Because PythonAnywhere does not allow PostgreSQL on Free account. Using PostgreSQL cost more than $10 a month Hashim On Wednesday, 11 February 2015 02:06:13 UTC+5, Massimo Di Pierro wrote: > > I do not understand why anybody would use shared hosting in 2015 when you > can have PythonAnywere

[web2py] portalocker import error

2016-12-21 Thread Avinash Kachhy
Hello On installing web2py and an application named Sahana Eden and trying to run the app, I get an error indicating that portalocker cannot be imported in pydal.py. I see a note that this is fixed on Sept 27. What do I need to do it so that I get the update? I had installed web2py using the

[web2py] Linking Auth with another table to store additional info about user

2016-12-21 Thread Andrew Toole
I am quite new to web2py. I am attempting to build an app that will use Auth to control log-in and membership for access to various parts of the app. I will have different types of users. Some will just come to get info and leave and we don't need to know much about them. Others will be

Re: [web2py] Re: How to check if expression is Aggregate?

2016-12-21 Thread Anthony
What version of web2py, and are you sure it includes the proper version of PyDAL? What is the object type of db._adapter (a) immediately after db is created in db.py and (b) when db is assigned from current.db in the module? Your traceback shows object type "SQLite", but the adapter is not of

[web2py] Re: learning cache

2016-12-21 Thread 黄祥
thanks a lot for detail explaination, anthony lesson learned about cache for now : - start from simple first, don't use the cache on top of the controllers, use it for each function in controllers that need to be cached (no form in that function because of the form hidden field unique id) -

[web2py] Re: how to have field data display without letter "L"

2016-12-21 Thread Anthony
I suggest you read this thread: https://groups.google.com/forum/#!topic/web2py/Wcq0ZuxJWRE Though if you are using the str() function, you shouldn't be getting the trailing "L". Anthony On Wednesday, December 21, 2016 at 4:29:14 PM UTC-5, Alex Glaros wrote: > > FK field data is expressed with

[web2py] Re: Add record button disappears when using groupby argument for SQLFORM.grid()

2016-12-21 Thread Anthony
Yes, it is intended behavior, but I think it wouldn't be a bad idea to at least allow the option of a create button in this case. See my response here regarding the rationale: https://groups.google.com/d/msg/web2py/QLN6HzItpS8/mcQfNaOgBwAJ. Feel free to open a Github issue. Anthony On

[web2py] Re: learning cache

2016-12-21 Thread Anthony
On Wednesday, December 21, 2016 at 8:13:02 PM UTC-5, Anthony wrote: > > *so my question is :* >> 1 the cache automatically clear after the expire time met or not? if not, >> so we must cleared it manually by using cache.ram.clear() or >> cache.disk.clear(), so that the size of cache didn't grow

[web2py] Re: learning cache

2016-12-21 Thread Anthony
> > *so my question is :* > 1 the cache automatically clear after the expire time met or not? if not, > so we must cleared it manually by using cache.ram.clear() or > cache.disk.clear(), so that the size of cache didn't grow isn't it? > Yes, you must clear any keys no longer in use. But if you

[web2py] Re: learning cache

2016-12-21 Thread Anthony
On Wednesday, December 21, 2016 at 5:09:53 PM UTC-5, 黄祥 wrote: > > thanks anthony, for detail explaination. > 1. in controllers usually contain more than 1 function so i think it'll be > efficient to put it on top of the controllers like i usually do with > auth.requires_login(), i've tested

[web2py] Re: learning cache

2016-12-21 Thread 黄祥
here is the code i used to learn cache *models/db0.py* # -*- coding: utf-8 -*- db.define_table('test_0', Field('name'), format = lambda r: '%s' % (r.name) ) db.define_table('test_1', Field('test_0', 'reference test_0'), Field('name'), format = lambda r: '%s' % (r.name) )

[web2py] Add record button disappears when using groupby argument for SQLFORM.grid()

2016-12-21 Thread H. Das
Hello everyone, the add record button disappears when using groupby argument for SQLFORM.grid(). Is this normal behavior? How can I work around this without implementing my own add record feature? I'd really like to stay within vanilla grid as much as possible. Please advise. -- Resources: -

[web2py] Re: how to have field data display without letter "L"

2016-12-21 Thread Alex Glaros
It's not actually displayed, it's a data element for a json list json_list.append(dict(title = db.SuperObject(a1.member_super_object_FK).object_display_name, id = '"' + str(int(a1.member_super_object_FK)) + '"', parent = '"' + str(thisParent) + '"', alexLink = 'https://dca.ca.gov',

[web2py] Re: Column export to txt

2016-12-21 Thread Dave S
On Wednesday, December 21, 2016 at 7:05:57 AM UTC-8, yarecki wr wrote: > > I have a table defined where I would need to export one column to SMB > share as a txt file automatically when a new row gets added? How can this > be achieved? Hope it's clear from the question I'm beggining with web2py

[web2py] Re: learning cache

2016-12-21 Thread Dave S
On Wednesday, December 21, 2016 at 2:09:53 PM UTC-8, 黄祥 wrote something confusing. Normally, your posts are understandable, but I'm really struggling with this thread. Can you include a code sample or attach a minimal app? Also, don't Python decorators take a function as an argument? Do

[web2py] Re: how to have field data display without letter "L"

2016-12-21 Thread Dave S
On Wednesday, December 21, 2016 at 1:29:14 PM UTC-8, Alex Glaros wrote: > > FK field data is expressed with letter "L". E.g, value is 370, display > is 370L > > I have to strip off letter "L" with reg ex: > import re > preParent = db.Role(newSpecificRoleID).object_super_object_FK >

[web2py] Re: learning cache

2016-12-21 Thread 黄祥
thanks anthony, for detail explaination. 1. in controllers usually contain more than 1 function so i think it'll be efficient to put it on top of the controllers like i usually do with auth.requires_login(), i've tested both no errors occured : e.g. #cache.action(time_expire = 300, cache_model =

[web2py] how to have field data display without letter "L"

2016-12-21 Thread Alex Glaros
FK field data is expressed with letter "L". E.g, value is 370, display is 370L I have to strip off letter "L" with reg ex: import re preParent = db.Role(newSpecificRoleID).object_super_object_FK thisParent = re.sub("[^0-9]", "", str(preParent)) Is there way to make data

[web2py] Re: Error background task with Redis

2016-12-21 Thread Jose de Soto
Hi Fabiano, Maybe to late. Here you have a full app based in python-rq: https://github.com/josedesoto/web2py-rq-dashboard On Tuesday, 16 June 2015 19:15:03 UTC+2, Fabiano Faver wrote: > > Failed to copy the 2 error. The full traceback of the second error: > Traceback (most recent call last): >

Re: [web2py] Re: How to check if expression is Aggregate?

2016-12-21 Thread Jurgis Pralgauskis
> That's odd. Hard to say what's going on without seeing the code. Maybe attach a minimal app that reproduces the problem. https://github.com/dz0/web2py_grand_helpers/blob/master/app/modules/plugin_search_form/search_form.py#L188 you can toggle comment with next line to see the non/working

[web2py] Re: Issues with changing date format

2016-12-21 Thread David
I found the issue, I had another vailidator in the controller for testing that I had forgotten about. Once this was removed everything worked. Sorry for the confusion. David On Tuesday, December 20, 2016 at 4:19:02 PM UTC-5, David wrote: > > Hello, > > I am trying to change the display of

[web2py] Re: Issues with changing date format

2016-12-21 Thread David
In doing some additional testing I am able to update the field in the database administration page. The ajax calendar renders the date in mm/dd/ and then the data is stored as -mm-dd. I am not sure what would cause this to work in one place but not the other. David On Tuesday,

[web2py] Column export to txt

2016-12-21 Thread yarecki wr
I have a table defined where I would need to export one column to SMB share as a txt file automatically when a new row gets added? How can this be achieved? Hope it's clear from the question I'm beggining with web2py and python for that matter :) -- Resources: - http://web2py.com -

[web2py] Re: learning cache

2016-12-21 Thread Anthony
On Wednesday, December 21, 2016 at 1:12:26 AM UTC-5, 黄祥 wrote: > > learned about cache from the book, but got confused : > > 1. when tried to put cache affected for all functions in controller, the > cache.action have a strange behaviour > First, it doesn't make sense to put cache.action at the

[web2py] Re: table cells truncation

2016-12-21 Thread Pierre
thanks Anthony my tables look better now. there was a big mistake in my css. almost everything is in order :) -- 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

[web2py] Re: custom form default value

2016-12-21 Thread Anthony
> > id="sample_sample_name" class="text" value={{=row.sample_name}}/> > It's always a good idea to check the returned HTML source in the browser. In this case, you will see you forgot the quotes around the value -- should be: value="{{=row.sample_name}}" You're getting:

Re: [web2py] Re: How to check if expression is Aggregate?

2016-12-21 Thread Anthony
That's odd. Hard to say what's going on without seeing the code. Maybe attach a minimal app that reproduces the problem. Anthony On Wednesday, December 21, 2016 at 4:26:19 AM UTC-5, Jurgis Pralgauskis wrote: > > > dir(db._adapter) > > ['POOLS', 'REGEX_TABLE_DOT_FIELD', '__class__',

[web2py] Re: register redirect

2016-12-21 Thread Anthony
> > return response.render('templates/RNA.html',context) > The above is not a redirect, it is simply returning a value. The .register() method doesn't do anything with the return value of the onaccept callback. You should instead use the redirect() function to redirect to another page

[web2py] Re: Can't import plugin module

2016-12-21 Thread Anthony
There is no __init__.py file in your /modules folder, nor in the app folder (should also be one in the /applications folder). Anthony On Wednesday, December 21, 2016 at 8:29:25 AM UTC-5, Jurgis Pralgauskis wrote: > > Hi, > > I am trying to make plugin, but ran into > > > > Version

[web2py] Can't import plugin module

2016-12-21 Thread Jurgis Pralgauskis
Hi, I am trying to make plugin, but ran into Version 2.14.6-stable+timestamp.2016.05.09.19.18.48 Traceback 1. 2. 3. 4. 5. 6. 7. 8. Traceback (most recent call last): File "/home/jurgis/dev/web2py_git/gluon/restricted.py", line 216, in restricted exec(ccode, environment) File

[web2py] IS_IN_DB show fields from related tables (how to )

2016-12-21 Thread icodk
I have 4 tables with relations (see below ) and I want to show a dropdown list that shows a string with one field from each table by using something like: db.customer.price.requires=IS_IN_DB(?) I tried : query=((db.price.product== db.product.id)&(db.price.cust_type== db.cust_type.id))

[web2py] register redirect

2016-12-21 Thread António Ramos
Hello i want to redirect users to a warning page to make sure they understand taht they need to validate the acount by clicking the link they receive by email. The standard flash message is not the solution for my users. so i did this def register_w(form): context={'detail':"Please check

[web2py] Re: distinct keyword for SQLFORM.grid

2016-12-21 Thread H. Das
Ok I think I solved my problem by using grid's groupby argument, thanks to this post and this post.

Re: [web2py] Re: How to check if expression is Aggregate?

2016-12-21 Thread Jurgis Pralgauskis
> dir(db._adapter) ['POOLS', 'REGEX_TABLE_DOT_FIELD', '__class__', '__delattr__', '__dict__', '__doc__', '__format__', '__getattribute__', '__hash__', '__init__', '__module__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__',

[web2py] Re: distinct keyword for SQLFORM.grid

2016-12-21 Thread H. Das
Hi Massimo, I think this still hasn't been added yet. I too am doing several inner joins with grid and I'm getting some rows that I consider duplicates and would like to get rid of them. The most straightforward way to remove these duplicates is perhaps calling select() on the Set object with