[web2py] nginx and uploads

2016-05-28 Thread 'Annet' via web2py-users
I installed Web2py at Webfaction. In Web2py I have an application dbmodel that contains my models, static files and uploads. I created two static only applications one two serve the content of static and one to serve the content form uploads. So any request starting with http://www.domain.com/d

[web2py] SQL query to web2py code

2016-06-09 Thread 'Annet' via web2py-users
I have the following SQL query (in Postgresql): SELECT ntw_edge.outid, ntw_edge.inid, ntw_edge.label, alias_edge.inid, alias_edge.outid, alias_edge.label FROM ntw_edge LEFT OUTER JOIN ntw_edge AS alias_edge ON ntw_edge.inid=alias_edge.outid WHERE ntw_edge.outid=1147; In web2py I have: def ret

Re: [web2py] SQL query to web2py code

2016-06-09 Thread 'Annet' via web2py-users
Hi Massimiliano, Thanks for your helpful reply. print db(db.ntw_edge.outID==1147)._select(left=db.ntw_edge.on(db. > ntw_edge.inID==alias_edge.outID)) > Web2py generates: SELECT alias_edge.outid, alias_edge.inid, alias_edge.label, ntw_edge.outid, ntw_edge.inid, ntw_edge.label FROM ntw_edge AS

[web2py] Problem with custom upload

2016-06-17 Thread 'Annet' via web2py-users
I have the following function: def logo(): vertexID = get_vertexID(auth, session) folder = 'vertexID' + str(vertexID) table.image.uploadfolder = os.path.join(request.env.applications_parent, 'applications', 'dbmodel', 'static', 'uploads', f

Re: [web2py] Problem with custom upload

2016-06-17 Thread 'Annet' via web2py-users
Hi Richard, Thanks for your reply, renaming the application did not solve the problem. However, having a closer look at my code, I found that in: upload=URL('dbmodel', 'static', 'uploads', folder, args=request.vars.image)) 'static', 'uploads' should be 'static/uploads' I am sorry for bothering

[web2py] Custom auth.register()

2016-06-19 Thread 'Annet' via web2py-users
I have an auth_user table to which I added some extra fields. I use form=auth.register() and a custom form to register users. I want some users to provide me with some more data, so I created an auth_dummy table to store these data. When in this case I use: form = SQLFORM.factory(db_auth_user, db

[web2py] auth.register()

2016-06-21 Thread 'Annet' via web2py-users
I have a custom register function: def myregister(): response.view = 'default/myregister.html' form = auth.register() if form.validate(): # my custom code elif form.errors: get_flash(response, None, 'danger', 'error') elif not response.flash: get_flash

[web2py] Re: I am unable to change the hover background color in my menu. How do I do it?

2016-06-21 Thread 'Annet' via web2py-users
Just overwrite the Bootstrap css in your applications css: .navbar-default .navbar-nav > li > a:hover {background-color: #1f2f3f;} Kind regards, Annet -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.goog

[web2py] Re: auth.register()

2016-06-21 Thread 'Annet' via web2py-users
Hi Anthony, Thanks for your reply. .register already calls .validate - you cannot call it twice (by design, > the CSRF token survives only one validation). I solved it by replacing form = auth.register() with: form = SQLFORM.factory(db.auth_user, Field('password_two', type='

[web2py] .belongs problem

2016-06-26 Thread 'Annet' via web2py-users
I have the following table definition db.define_table('ntw_edge', Field('outID', 'reference vtx_vertex', default='', requires=[IS_IN_DB(db, 'vtx_vertex.id', '%(name)s')], ondelete='CASCADE', notnull=True, label='Out *', represent=lambda outID, row: db(db.vtx_vertex.id==outID).select().firs

[web2py] Re: .belongs problem

2016-06-26 Thread 'Annet' via web2py-users
I just tried vertices = db(db.ntw_edge.outID==1151). select(db.ntw_edge.inID, distinct=db.ntw_edge.inID).as_list() events = db(db.event_list.vertexID. belongs(vertices)).select() but that gives the following error: unhashable type: 'dict' Kind regards, Annet -- Resources: - http://web2py.

[web2py] Re: .belongs problem

2016-06-26 Thread 'Annet' via web2py-users
Hi Anthony, Thanks for your reply. ._select() works. I have not been able to figure out the 'one nested select' solution. I have a table with network edges, I need the ids of the edges to which a vertex connects. for example out = 1153 connects to in = (6, 28, 496, 1024) Then I want to use in

[web2py] custom register and verify_email

2016-07-20 Thread 'Annet' via web2py-users
I have this settings: auth.settings.actions_disabled = ['register', 'impersonate', 'groups'] auth.settings.registration_requires_verification = False auth.settings.registration_requires_approval = False and a custom register function in the default controller: def register(): form = SQLFORM

[web2py] tootip in menu

2016-07-20 Thread 'Annet' via web2py-users
I have the following menu: response.app_menu = [(CAT(SPAN('Connect', _class="btn btn-default", _target="_blank")), False, URL())] I want to add a Bootstrap tooltip to the button, I tried: response.app_menu = [(CAT(SPAN('Connect', _class="btn btn-default", _target="_blank", _data-placement="top

[web2py] Re: tootip in menu

2016-07-21 Thread 'Annet' via web2py-users
Hi Niphold, Thanks for your reply and explanation, problem solved. Kind regards, Annet -- 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 th

[web2py] Re: How to ensure that the upload field only accepts .jpg or .png files?

2016-08-20 Thread 'Annet' via web2py-users
Use the IS_IMAGE() validator http://web2py.com/books/default/chapter/29/07/forms-and-validators#IS_IMAGE requires = IS_IMAGE(extensions=('jpg', 'png')) Kind regards, Annet -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source

[web2py] Recaptcha2 in custom form

2016-08-28 Thread 'Annet' via web2py-users
In my controller I have the following code: form = SQLFORM.factory(db.auth_user, db.auth_dummy, extra_fields=extra_fields) form.append(Recaptcha2(public_key = '...', private_key = '')) When I have a view with {{=form}} the recaptcha displays correctly, I changed the view to display a custom

[web2py] Re: Recaptcha2 in custom form

2016-08-29 Thread 'Annet' via web2py-users
Hi Massimo, Thanks for your reply, problem solved nicely. Kind regards, Annet -- 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 messag

[web2py] as_list AttributeError: 'dict' object has no attribute 'myLabel'

2016-09-12 Thread 'Annet' via web2py-users
I have the following query: rows = db(db.ntw_edge_label_set.vertexID==vertexID).select(db.ntw_edge_label_set.myLabel).as_list() which returns: [{'myLabel': 'NASM Personal Trainers'}, {'myLabel': 'Traineeship'}] when I try: labelList = [row.myLabel for row in rows] I get the following error:

[web2py] How to update multiple records

2016-09-25 Thread 'Annet' via web2py-users
In a table I defined a field: Field('customLabel', length=128, requires=[IS_LENGTH(32), IS_NOT_EMPTY()]), When the user updates this field I need the update to cascade to a field label in another table: Field('label', length=128, default='', requires=IS_IN_DB(db, 'ntw_edge_label_set.customLabe

[web2py] Re: How to update multiple records

2016-09-26 Thread 'Annet' via web2py-users
Hi Anthony, Thanks for your reply. Problem solved. Best regards, Annet -- 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 becau

[web2py] lastName, firstName in form

2016-11-15 Thread 'Annet' via web2py-users
I have a form in which the user enter his name, for example: 'Thompson, Brian' When I execute the following query: rowset = db(db.vtx_vertex.name.ilike(nameform.vars.name)) This query return the correct result. However, when db.vtx_vertex.name is 'Thompson, Brian ' (a space after Brian) and na

[web2py] 'str' object has no attribute 'year'

2016-11-16 Thread 'Annet' via web2py-users
In a table I defined the following field: Field('birthday', writable=False, readable=False, **isemptyorisdate), isemptyorisdate has been defined like this: isemptyorisdate = dict(type='date', default='', requires=IS_EMPTY_OR(IS_DATE(format='%d-%m-%Y', error_message

Re: [web2py] lastName, firstName in form

2016-11-20 Thread 'Annet' via web2py-users
Hi Anthony and Richard, Thank you both for your replies It's probably a good idea to strip any leading/trailing whitespace before > the names are ever inserted in the database. > To solve the issue I use .strip() Kind regards, Annet -- Resources: - http://web2py.com - http://web2py.com/bo

Re: [web2py] 'str' object has no attribute 'year'

2016-11-20 Thread 'Annet' via web2py-users
Hi Richard, Thanks for your reply, you are right, setting default to None solves the problem. Kind regards, Annet -- 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] auth_membership validator

2016-11-29 Thread 'Annet' via web2py-users
I wonder whether there is a validator on auth_membership user_id and group_id I found that I can add the same membership multiple times which is not what I want. Kind regards, Annet -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py

[web2py] admin interface

2016-12-02 Thread 'Annet' via web2py-users
I have an application with limited functionality in which I want to access web2py's admin interface. I have 3 application in the same web2py installation in which I want to disable the admin interface. Is this possible and how would I do this. Kind regards, Annet -- Resources: - http://web2p

[web2py] Re: admin interface

2016-12-02 Thread 'Annet' via web2py-users
Hi, Thanks for your reply. You mean an empty .py file named DISABLED What does ATM stand for? Kind regards, Annet -- 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: admin interface

2016-12-04 Thread 'Annet' via web2py-users
Hi Anthony, Thanks for your reply. I apologize for not being clear enough, I have one installation of web2py and 4 applications each being referenced by their own domain. dbadmin by admin.mydomain.com init by www.mydomain,com etc. I only want acces the web2py interface via admin.mydomain.com

[web2py] Re: admin interface

2017-01-02 Thread 'Annet' via web2py-users
Hi, Thanks for your reply. I went for the short circuit option: if request.application == 'admin': redirect('https://ldc.leonexus.nl') What would the routes.py solution look like? I have a parametric routes.py which amongst others contains the following lines of code: routers = dict( B

[web2py] URL in flash

2017-01-03 Thread 'Annet' via web2py-users
I want to add a link to a flash message, something like: response.flash = 'Please contact admin to report the issue using the ' + A('contact form', _href=URL('init', 'util', 'contactform')) This does not work for you cannot concatenate a string with the A helper. KInd regards, Annet -- Reso

[web2py] Re: URL in flash

2017-01-03 Thread 'Annet' via web2py-users
Hi Dave, Thanks for your reply. > Wrap the A() with a CAT() ? > > I had to wrap the whole message in CAT() response.flash = CAT('Please contact admin to report the issue using the ', A('contact form', _href=URL('init', 'util', 'contactform'))) Kind regards, Annet -- Resources: - http://

[web2py] Re: Query for mutually linked id's

2016-02-10 Thread 'Annet' via web2py-users
Hi Niphlod, Thanks for your reply. I have been trying to get the self-refrence and alias to work, but I got stuck. What i've got sofar is: vertexfrom = db.edg_edge.with_alias('vertexfrom') rows = db((db.edg_edge.toID==8) & (db.edg_edge.fromID==db.vtx_vertex.id))\ .select(db.edg_edge.fromID,

[web2py] name 'T' is not defined

2016-04-05 Thread 'Annet' via web2py-users
I have a module containing text constants which I would like to translate. T('Yes, I accept the Terms and Conditions * ') When I save the module I get the following error flash: failed to reload module because; name 'T' is not defined Is it possible to use T() in a module, if so, what files do

[web2py] Re: define custom style by class using SQLFORM

2016-04-10 Thread 'Annet' via web2py-users
Hi, I am not sure I understand your question correctly How do I change the style of a form using SQLFORM? > In appconfig.ini you can set: ; form styling [forms] formstyle = bootstrap3_stacked separator = and then in the db.py file: ## choose a style for forms response.formstyle = myconf.take(

[web2py] routes.py

2016-04-28 Thread 'Annet' via web2py-users
I have a routes.py file in web2py's home directory which contains the follwing code: routes_onerror = [ (r'init/*', r'/error/default/index') ,(r'org/*', r'/error/default/index') ,(r'*/404', r'/error/default/index') ,(r'*/*', r'/error/default/index') ] # specify action in charge of

[web2py] INNER JOIN and WHERE clause in web2py

2018-02-18 Thread 'Annet' via web2py-users
I defined the following table: db.define_table('ntw_edge', Field('outID', 'reference vtx_vertex'), Field('inID', 'reference vtx_vertex'), Field('labelID', 'reference ntw_edge_label_set'), Field('networkkey', type='integer', default=1), migrate = False) The database contains a

[web2py] Re: INNER JOIN and WHERE clause in web2py

2018-02-19 Thread 'Annet' via web2py-users
Hi Anthony, Thanks for your reply. I get the results I want. Two more questions, using this syntax, how would I join ntw_edge_inID on vtx_vertex.id and ntw_edge_labelID on ntw_edge_label_set.id without ending up with more records than I have now. Second, up to now I have been writing joins

[web2py] Re: INNER JOIN and WHERE clause in web2py

2018-02-20 Thread 'Annet' via web2py-users
HI Anthony, Thanks for your reply. > What is the SQL you are trying to produce? > SELECT ... FROM ntw_edge INNER JOIN ntw_edge_alias ON ntw_edge.inID=alias_edge.outID INNER JOIN vtx_vertex ON ntw_edge.inID=vtx_vertex.id INNER JOIN ntw_edge_label_set ON ntw_edge.labelID=ntw_edge_label_set.id

[web2py] Re: INNER JOIN and WHERE clause in web2py

2018-02-21 Thread 'Annet' via web2py-users
Hi Anthony, Thanks for helping me solve this problem, I very much appreciate your help. Annet -- 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 receiv

[web2py] _href to URL()

2018-02-24 Thread 'Annet' via web2py-users
I have the following link in a view: {{=A('TaC', _href='https://static.domain.com/files/Terms_and_Conditions.pdf', _target="_blank", vars=dict(attachment=True))}} I want to convert it to a menu item ('TaC', False, URL(???)) How do I convert the _href to a URL() Kind regards Annet -- Reso

Re: [web2py] _href to URL()

2018-02-25 Thread 'Annet' via web2py-users
Hi Joel, Thanks for your reply. This works: ('', False, A('TaC', _href='https://static.domain.com/files/Terms_and_Conditions.pdf', _target="_blank", vars=dict(attachment=True))) For some reason the first attribute is not used as the link text. Kind regards, Annet -- Resources: - http://w

Re: [web2py] _href to URL()

2018-02-26 Thread 'Annet' via web2py-users
Hi Anthony, Thanks for your reply and explanation, I changed my code to the code you provided. Kind regards, Annet -- 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] LOAD an routes_onerror

2018-03-06 Thread 'Annet' via web2py-users
In my application I have a view containing a header, main and footer component. In the index function of a controller I have the following code: maincomponent = LOAD('home', 'base', args=[vertexID, viewtypeID, groupID, plural], ajax=True, target='main-component', content

[web2py] Re: LOAD an routes_onerror

2018-03-16 Thread 'Annet' via web2py-users
Hi Anthony, Thanks for your reply. Have you tried redirect(..., client_side=True) in your error handler? > The error handler error/default/index contains the following lines of code: def index(): session.forget(response) response.title = 'Leonexus - Error handler' return dict(

[web2py] join and count()

2018-04-13 Thread 'Annet' via web2py-users
In a function I have the following query: labels = db(db.vtx_label.vertexID==vertexID)._select(db.vtx_label.label) join = db.vtx_vertex.on((db.vtx_label.vertexID==db.vtx_vertex.id) & (db.vtx_vertex.typeID==IOTHINGID)) rowset = db((db.vtx_label.label.belongs(labels)) & (db.vtx_label.vertexID!=

[web2py] Re: join and count()

2018-04-14 Thread 'Annet' via web2py-users
Hi Anthony, Thanks for your reply. Does this work: > > label_count = db.vtx_label.id.count() > count = rowset.select(label_count, join=join).first()[label_count] > > Yes, that works, but I don't understand why it works, could you please explain how your solution works? The table vtx_labels cont

[web2py] raise HTTP(503, "")

2018-05-15 Thread 'Annet' via web2py-users
I have the following line of code in 00_db.py raise HTTP(503, "Maintenance") Is it possible to replace the code between "" with a view name, as in response.view = '503_handler.html' Kind regards, Annet -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github

[web2py] Re: raise HTTP(503, "")

2018-05-16 Thread 'Annet' via web2py-users
Hi Stifan, Thanks for your helpful reply. Anthony's solution solves the issue. Best, Annet -- 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

[web2py] grouping and counting

2018-05-24 Thread 'Annet' via web2py-users
In a table definition I have the following field: db.define_table('app_settings', ... Field('viewtypeID', type='integer', requires=IS_IN_SET(viewtype_list)), ... migrate = False) This is the viewtype_list: viewtype_list = [(1, 'zero'), (2, 'thing'), (3, 'client'), ..., (8, 'hub')]

[web2py] Re: response menu

2018-07-22 Thread 'Annet' via web2py-users
Hi Stavros, I think this'll solve your problem: {{=MENU(response.menu, _class='web2py-menu', li_class='dropdown', ul_class='dropdown-menu')}} Best, Annet -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code

[web2py] Re: Autocomplete widget match middle of word

2018-09-17 Thread 'Annet' via web2py-users
Hi Anders, In the query use .contains() Something lijke: rows = db(db.table.field.contains(request.get_vars.term, case_sensitive=False)).select().as_list() Best, Annet -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code)

[web2py] Issue between 2.14.5 and 2.17.2

2018-10-25 Thread 'Annet' via web2py-users
After upgrading from web2py 2.14.5 to 2.17.2 and editing a model file I got the following error: Traceback (most recent call last): File "/Users/iannet/web2py/gluon/restricted.py", line 219, in restricted exec(ccode, environment) File "/Users/iannet/web2py/applications/adminmodel/models/

[web2py] Re: Issue between 2.14.5 and 2.17.2

2018-10-26 Thread 'Annet' via web2py-users
Thank you both for your replies. Are you on the same filesystem/OS? Is it possible your OS sort order is now > different, so "_" sorts after the digits instead of before? Try changing > 0_imports.py to 00_imports.py. > I tried, but it did not solve the issue. Like Carlos said I had add the imp

[web2py] auth.settings user_url

2019-02-26 Thread 'Annet' via web2py-users
I have one application that takes car of all the auth stuff. In the init application I have a couple of functions that require login,. I added this line of code session.connect(request, response, masterapp="controlpanel") and decorated the functions with @auth.requires_login() and set auth.sett

[web2py] IS_IN_SET instead of IS_IN_DB

2019-03-21 Thread 'Annet' via web2py-users
I needed a IS_IN_DB() validator based on joined tables with the id coming from one table and the label coming from both tables, since I did not get this to work I tried: table.labelIDs.requires = IS_EMPTY_OR(IS_IN_SET([(r.ntw_edge_label_set.id, '%s' %str(r.vtx_vertex.name + ' - ' + r.ntw_edge_

[web2py] session.connect()

2019-03-27 Thread 'Annet' via web2py-users
I have two applications one init and one cms. In init I have a few functions for which the user needs to be logged in. These functions only read from the database they do not write to the database. I thought I could use session.connect(request, response, masterapp="cms") to share the fact that a

[web2py] Re: session.connect()

2019-03-28 Thread 'Annet' via web2py-users
Hi Anthony, Thanks for your reply. I added response.cookies['session_id_cms']['domain'] = '.yourdomain.com ' to a model file in the cms app. And in the init app I have session.conne

[web2py] Re: CSS button alignment

2019-04-06 Thread 'Annet' via web2py-users
I think Bootstrap's float-right and float-left will solve this issue. https://getbootstrap.com/docs/4.1/utilities/float/ -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Repo

[web2py] Don't allow textarea to contain html tags

2019-04-23 Thread 'Annet' via web2py-users
My application has a contact form which is inserted into a database. I am using Google's CAPTCHA, however, sometimes a contact form is being submitted with a malicious link. To prevent this from happening I wonder wether it is possible to validate the textarea and only submit the form when it do

[web2py] Re: compile error : Exception: name 'session' is not defined in views

2017-02-15 Thread 'Annet' via web2py-users
Hi Anthony, I just read: Any Python code in the template directives (i.e., "include", "exclude", > "block") is evaluated at compile time, as the directives are needed to > create the compiled views. However, in this case you include an object that > is only available at run time ("session"), w

[web2py] Re: compile error : Exception: name 'session' is not defined in views

2017-02-16 Thread 'Annet' via web2py-users
Hi Anthony, Thanks for your reply. Glad my code is not a problem. Kind regards, Annet > Your code is not a problem, as it is all Python code that gets executed at > run time. The problem is with Python code within the "include", "extend", > and "block" statements, which are part of the templ

[web2py] user profile

2017-05-02 Thread 'Annet' via web2py-users
When a user updates his profile I want to use the form data to update data in another table, what is the best way to do so? Kind regards, Annet -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p

[web2py] osTicket

2017-05-02 Thread 'Annet' via web2py-users
I am hosting my Web2py applications at Webfaction. I asked support the folIowing question: am developing sort of a network application, to keep track of the communication with my customers I am looking for an application like WebFaction's ticketing system. They recommend installing osTicket,

[web2py] Re: user profile

2017-05-02 Thread 'Annet' via web2py-users
Thank you both for your replies. In the default/user function I have form=auth() which calls accepts by itself. Your reference to the book was helpful, I think something like: auth.settings.profile_onaccept = lambda form: __on_profile() def __on_profile() row = db.table_name(ID=form.ID)

[web2py] row.update_record()

2017-05-22 Thread 'Annet' via web2py-users
I have the following query and form: user = db.auth_user(vertexID=vertexID) form = SQLFORM.factory(db.auth_user, db.auth_dummy, extra_fields=extra_fields) If the form validates I want to update user with data I selected from other tables and with data from the form. I have the following code;

[web2py] request.vars list object

2017-06-05 Thread 'Annet' via web2py-users
I have the following URL: http://127.0.0.1:8000/com/shortcut/target/1349?edge=34&inID=1297&label=NASM+Certified+Personal+Trainer&_signature=9c33ff589c78426ce3fcdf2f53f4408028189128 In de target function I have these lines of code: label = request.vars.label get_flash(response, invertex.name +

[web2py] Re: request.vars list object

2017-06-06 Thread 'Annet' via web2py-users
Hi Kiran and Anthony, Thanks for your replies. Indeed I have a form with field 'label' and a var 'label in the URL. Changing request.vars to request.get_vars solved the issue. Kind regards, Annet -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/w

[web2py] CAS in case of existing applications

2017-08-07 Thread 'Annet' via web2py-users
I have one application (adminmodel) containing models, modules and static files and three other applications using these models, modules and static files. Two of the three applications have been developed independently of each other, and have their own register and login functions. All applicat

[web2py] Enter a valid URL

2017-11-14 Thread 'Annet' via web2py-users
I have a user complaining that my application does not accept his URL ending on .online doesn't Web2py validate this kind of URL? Kind regards, Annet -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.

[web2py] Re: Enter a valid URL

2017-12-02 Thread 'Annet' via web2py-users
Hi Leonel, Thanks for your reply. I did as you did, I updated the list. Kind regards, Annet -- 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 receiv

[web2py] menu li > a padding in case of button

2017-12-02 Thread 'Annet' via web2py-users
I have the following menu: response.application_menu = [ (CAT(I(_class="fa fa-search")), False, URL('default', 'search')), (CAT(SPAN('Log in', _class="btn btn-primary")), False, URL('com', 'default', 'user', args='login', scheme=SECURESCHEME, host=COMDOMAIN)), (CAT(SPAN('Open account'

[web2py] Re: menu li > a padding in case of button

2017-12-05 Thread 'Annet' via web2py-users
Hi Paolo, Thanks for your reply. The problem is that the padding is on the item not the btn one. My menu is rendered as follows: class="fa fa-search" Log in >Open account The padding is on the second item which does not have a class I can reference in my css. Removing the paddin

[web2py] Re: menu li > a padding in case of button

2017-12-07 Thread 'Annet' via web2py-users
Hi Paolo, Maybe > > .web2py-menu li:nth-of-type(2) {padding:0;} > > Yes, that solves the problem, thank you for your help. Kind regards, Annet -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/

[web2py] uploadfolder outside web2py

2018-01-12 Thread 'Annet' via web2py-users
In web2py I have an init application and an adminmod application containing the model, module and static files. To manage images I have the following code in a function: table.image.uploadfolder = os.path.join(request.env.applications_parent, 'applications',

[web2py] Re: uploadfolder outside web2py

2018-01-14 Thread 'Annet' via web2py-users
Thank you all for your replies, This works : table.image.uploadfolder = '/home/webapps/uploads' to upload the images into separate folders I made the following adjustment: folder = 'vertexID' + str(vertexID) table.image.uploadfolder = os.path.join('/home/webapps/uploads/' + folder) The proble

[web2py] Re: uploadfolder outside web2py

2018-01-15 Thread 'Annet' via web2py-users
Hi Anthony, Thanks for your reply. After reading the parts on download() in chapter 7 and 9 I wrote the following functions: def logo(): vertexID = session.vertexID table.vertexID.default = vertexID folder = 'vertexID' + str(vertexID) table.image.uploadfolder = os.path.join('/U

[web2py] Re: uploadfolder outside web2py

2018-01-17 Thread 'Annet' via web2py-users
Hi Anthony, Thanks for helping me solve the issue, I very much appreciate your help. @richard. Thanks for your reply, I had a look at bindfs, I work with Linux and had a symbolic link on myapp/static/uploads I am not sure bindfs let me upload files to myapp/static/uploads and store them in a di

[web2py] form.validate()

2018-01-29 Thread 'Annet' via web2py-users
I have the following function: def app_settings(): vertexID = session.vertexID record = table(vertexID=vertexID) form = SQLFORM(table, record, showid=False) if form.validate(): if form.deleted: ... else: viewtypeID = int(form.vars.v

[web2py] Re: form.validate()

2018-01-30 Thread 'Annet' via web2py-users
Hi Anthony, Thanks for your reply and clear explanation of what happens. I have no further questions. Kind regards, Annet -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (

[web2py] Re: left join (Attribute Error)

2018-02-11 Thread 'Annet' via web2py-users
Hi, I think it should be: left=db.requestlist.on(db.procedures.id == db.requestlist.proceduresid) Regards, Annet -- 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 I

Re: [web2py] Re: setting up pscycopg2

2019-06-12 Thread 'Annet' via web2py-users
Hi Dave, I work both on Mac OS X and Linux and have Postgres databases. On Mac OS X I located the pg_config file and added its location to the .bash_profile file: export PATH=/usr/local/bin:$PATH export PATH=$PATH:/Applications/Postgres.app/Contents/Versions/9.3/bin Then I got pip and install

Re: [web2py] Re: setting up pscycopg2

2019-06-13 Thread 'Annet' via web2py-users
> This isn't done as sudo? > With these lines I installed psycopg2 in my hosting environment, no sudo needed. | The trick seems to letting web2py know it is installed in its local environment. I installed psycopg2 in the site-packages folder of the python version I am using same folder pi

[web2py] Re: intercepting login & logout events

2019-06-17 Thread 'Annet' via web2py-users
Web2py has auth.settings I used them to solve your problem auth.settings.login_onaccept = lambda form: __on_login() auth.settings.logout_onlogout = lambda user: __on_logout() and then in the functions the task you want to perform, in my case some set up things and messages, something like: de

[web2py] Re: sqlform grid to show a field entirely, without cutting off the text

2019-06-18 Thread 'Annet' via web2py-users
I think Anthony answered this question in this post: https://groups.google.com/forum/?fromgroups=#!topic/web2py/okMVqyQPKV8 hope he did ;-) Regards, Annet -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://cod

[web2py] default/user/profile 404 NOT FOUND

2019-07-04 Thread 'Annet' via web2py-users
All of a sudden this link http://127.0.0.1:8000/controlpanel/default/user/profile no longer works, instead of returning the form it returns a 404 NOT FOUND. I didn't change anything in the user function, so I have no idea why this happens. Kind regards, Annet -- Resources: - http://web2py.

[web2py] Re: web3py -> py4web

2019-08-21 Thread 'Annet' via web2py-users
> python3 setup.py install > I installed py4web from source: git clone https://github.com/web2py/py4web.gitcd py4web python3 -m pip install -r requirements.txt python3 setup.py install Running the last statement gives the following errors: byte-compiling build/bdist.macosx-10.9-x86_64/egg/p

[web2py] Re: How to stopped redirection to user/login.html

2019-08-21 Thread 'Annet' via web2py-users
What about: auth.settings.on_failed_authentication = lambda url: redirect(url) That is what the book says changing the default behaviour. Kind regards, Annet -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https:

[web2py] Re: Custom form errors style

2019-08-23 Thread 'Annet' via web2py-users
To diasble it: if form.accepts(..., hideerror=False): to restyle it, restyle: .error Kind regards, Annet -- 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

[web2py] Re: Can't connect to MySQL

2019-09-09 Thread 'Annet' via web2py-users
According to the book the connection string for MySql is: mysql://username:password@localhost/test?set_encoding=utf8mb4 Maybe adding the TCP port solves the issue: mysql://username:password@localhost:13306/test?set_encoding=utf8mb4 Kind regards, Annet -- Resources: - http://web2py.com - htt

[web2py] Re: auth_membership grid with both, group id and group roles displayed when adding a new record

2019-10-07 Thread 'Annet' via web2py-users
Use IS_IN_DB() ids = [1,3,5] > db.auth_membership.group_id.requires = IS_IN_DB(db(db.auth_group.id.belongs(ids)), 'auth_group.id', '%(role)s') Best, Annet -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https:/

[web2py] Re: auth_membership grid with both, group id and group roles displayed when adding a new record

2019-10-07 Thread 'Annet' via web2py-users
Hi Villas, Will your solution still work when you change the value of role in the auth_membership table? In your mygroupdict you define the role values again, so that there is no single point of definition. I may be wrong but isn't that something to keep in mind when using your solution? Be

[web2py] Re: Validator IS_NOT_IN_DB not working | web2py

2019-10-18 Thread 'Annet' via web2py-users
What about form = SQLFORM() if form.process(...).accepted instead of form = SQLFORM().process() if form.accepted: Best, Annet -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issue

[web2py] Illegal instruction 4

2019-12-05 Thread 'Annet' via web2py-users
Last week I upgraded my development environment from Mac OS X Mavericks - Python 2.7 - Web2py 2.14.5 to Mac OS X Catalina - Python 2.7 - Web2py 2.14.5, since then I have the following issue: Created by Massimo Di Pierro, Copyright 2007-2019 Version 2.14.5-stable+timestamp.2016.04.14.03.26.16 Dat

[web2py] Re: Illegal instruction 4

2019-12-06 Thread 'Annet' via web2py-users
Hi Leonel, Thanks for your reply. I am already running Web2py from source and I am using PostgreSQL 12. Seems like more people are having the same problem both on Windows and Mac. so far I haven't read a plausible solution. Kind regards, Annet -- Resources: - http://web2py.com - http://web2py

[web2py] Re: Is it possible to load older web2py binaries for Mac?

2019-12-19 Thread 'Annet' via web2py-users
Hi Jarrod, I also have an issue after upgrading to Mac OS X Catalina see this post for Massimo's answer: https://groups.google.com/forum/?fromgroups=#!topic/web2py/431xgrgLkn0 Best, Annet -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/w

[web2py] Database drivers available does not show psycopg2

2019-12-20 Thread 'Annet' via web2py-users
On Mac OS X Catalina with psycopg2 installed in the /Python/2.7/site-packages web2py does not find the psycopg2 driver: Database drivers available: sqlite3, imaplib, pyodbc, pymysql, pg8000 It did on lower versions of Mac OS X, is there a way to solve this issue? Best, Annet -- Resources: -

[web2py] No driver of supported ones ('psycopg2',) is available

2020-01-20 Thread 'Annet' via web2py-users
Last week I upgraded my development environment from Mac OS X Mavericks - Python 2.7 - Web2py 2.14.5 to Mac OS X Catalina - Python 2.7 - Web2py 2.18.5, since then I have the following issue: Failure to connect, tried 5 times: Traceback (most recent call last): File "/web2py/gluon/packages/da

[web2py] raspberry pi starting browser xdg-open issue and error ticket postgreSQL

2020-02-06 Thread 'Annet' via web2py-users
Since I am not able to run web2py on mac os x Catalina I installed PostgreSQL and web2py on a raspberry pi 4. When I start web2py using the built in server I get the following error: Database drivers available: sqlite3, imaplib, pymysql, pg8000 please visit: http://127.0.0.1:8000/ starting

[web2py] Raspberry pi cannot connect to postgreSQL

2020-02-06 Thread 'Annet' via web2py-users
I just installed psycopg2 to connect to my PostgreSQl database on Raspberry Pi 4. When starting web2py I get the following error ticket: Traceback (most recent call last): File "/home/pi/web2py/gluon/restricted.py", line 227, in restricted exec ccode in environment File "/home/pi/web2py/a

  1   2   >