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: -

[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 --

[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

[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-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

[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

[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

[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] 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 =

[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

[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 =

[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

[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: 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) -

[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

[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

[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

[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) -

[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

[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) -

[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=1297=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 + ' already

[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

[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] 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] 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) -

[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

[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"),

[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: -

[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 --

[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(

[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

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] 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: -

[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

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

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 -

[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',

[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

[web2py] Re: How to update multiple records

2016-09-27 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

[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,

[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

[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

[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

[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] 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

[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",

[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 =

[web2py] Re: .belongs problem

2016-06-27 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] 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: -

[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:

[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',

[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) -

[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:

[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,

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

[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',

Re: [web2py] SQL query to web2py code

2016-06-10 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

[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

[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

[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] 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 =

[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: 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))\

<    1   2