[web2py] grid reloading the page and outdated flash msgs? (strange behavior...)

2018-12-27 Thread Vlad
Here is a test function in my controller: def test(): id = 0 try: id = request.args(0, cast=int) session.flash = "Here is the id: " + str(id) except: session.flash = "ID is not valid!" pass if id==0: redirect(URL('home')) query =

[web2py] multiple grids per one page

2018-12-31 Thread Vlad
I just came across a warning that only one grid can be used per a controller. I wasn't aware of this before, and on one page I have 4 grids which work perfectly fine. Is it some specific functionality that doesn't work right with multiple grids? Also, if I specify a unique name (formname

[web2py] an error while trying to combine an inner and outer joins

2018-12-28 Thread Vlad
I am taking the table cofounder and making an inner join with auth_user and an outer join with cofounder_proposal: cofounders = db((db.cofounder.company==company_id)&(db.cofounder.created_by==auth.user)).select( fields=[db.auth_user.first_name.with_alias('first_name'),

[web2py] "... records found' on the default grid

2018-12-27 Thread Vlad
What would be the best way to get rid of "5 records found" on the upper right corner of the default grid view? -- 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.requires_signature() vs @auth.requires_login()

2018-12-27 Thread Vlad
I generally understand how to use both, @auth.requires_signature() and @auth.requires_login(), but from a practical point of view, when in real life would you prefer to use one vs. another? -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) -

[web2py] ajax controller loses formatting?

2019-01-02 Thread Vlad
I am sure I am missing something very basic here, but... googling didn't help... When I have a contoller which I use in ajax calls, it all works just perfect except that the view loses the formatting (for example, it does keep the links and bullets - yet loses bootstrap formatting of

[web2py] web2py apps & github

2019-01-06 Thread Vlad
I used to pack and unpack the app between my local computer and pythonanywhere - was going back and forth daily. worked like a charm. now got t github. Should I place the whole application/ folder in its entirety or I should skip some files? I am not sure how pack / unpack does it, i.e. if it

Re: [web2py] Re: web2py apps & github

2019-01-16 Thread Vlad
ted by w2p or... What did you mean by "sanitize" in this case? On Monday, January 7, 2019 at 7:21:55 PM UTC-5, Dave S wrote: > > > > On Sunday, January 6, 2019 at 12:45:27 PM UTC-8, Vlad wrote: >> >> Oh, I didn't express myself precisely: I am asking about Gith

[web2py] web2py dev env on chromebook?

2019-01-16 Thread Vlad
If anybody has succeeded in setting up the dev env on chromebook I would greatly appreciate some pointers. I was able to get into dev mode and install linux on it, so linux is sort of functional, but it's not complete. There is probably something specific about chromebook, but I didn't find

[web2py] installing web2py book from git

2019-01-19 Thread Vlad
I've cloned webpy book from git - looks perfectly fine - it created directory web2py-book under applications, with all the content, just like a few other applications over there, *but* the web2py admin interface doesn't see this book as an app. It sees all other apps located in the

Re: [web2py] installing web2py book from git

2019-01-20 Thread Vlad
e ones like dot or dash > For example, web2py-book or examples.20190110 have this problem. > > Rename the folder to 'book' or 'example' and the problem disappear ;-) > > Does someone have an idea of where this bug could be hidden in the code? > > Nico > > Il giorno dom 20 gen

[web2py] How can I customize "Not Authorized" page, the one that comes up on @requires_membership decorator?

2019-01-15 Thread Vlad
Not AuthorizedInsufficient privileges -- 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

[web2py] Re: How can I customize "Not Authorized" page, the one that comes up on @requires_membership decorator?

2019-01-15 Thread Vlad
is not authorized at the moment, but the resource is there - What am I missing? On Tuesday, January 15, 2019 at 11:56:57 AM UTC-5, Dave S wrote: > > > > On Tuesday, January 15, 2019 at 8:16:18 AM UTC-8, Vlad wrote: >> >> Not AuthorizedInsufficient privileges >&g

[web2py] default combobox for a db field in a form (SQLFORM) - question

2019-01-15 Thread Vlad
when I use SQLFORM to create a form where one of the fields is, for example, a user (db.auth_user) w2p gives me a nice combo-box to select a user. this is good, but only if there are few items. if there are thousands, the combo-box becomes awkward. does webpy have some convenient alternative

Re: [web2py] installing web2py book from git

2019-01-21 Thread Vlad
How do I get the latest w2p?? I mean, I just cloned one from https://github.com/web2py/web2py.git and it still has the earlier one: 2.17.2-stable+timestamp.2018.10.06.11.34.06 On Monday, January 21, 2019 at 12:30:31 AM UTC-5, Nico Zanferrari wrote: > > It indeed works fine... but you need a

[web2py] synchronizing / backing up my code between local web2py & PythonAnywhere web2py

2018-12-26 Thread Vlad
What do you guys generally do as far an syncing / backup? I mean, right now I am going back and forth local web2py <-> PythonAnywhere web2py So it's tedious to keep track what the latest thing is - I pack up my app locally and upload it to PA, and then pack up on PA and upload to local. Are

[web2py] Issue (or perhaps just a question) with routes.py (root folder vs app folder)

2018-12-26 Thread Vlad
I've created routes.py in Web2py root folder: default_application = 'app5' default_controller = 'home' default_function = 'main' this works just fine. However, if I only keep one line in this file: default_application = 'app5' ,and create one more routes.py in Web2py/applications/app5

[web2py] Using Email from inside of Web2py

2018-12-26 Thread Vlad
I've figured out how this works, but I am missing the following: I have a mail_settings() function in the default controller. It's setting up my smtp settings and other redirect settings (auth.settings.login_next and the like). All works like a charm, but it seems that I have to call this

[web2py] private functions

2019-01-03 Thread Vlad
Here is a quote from THE BOOK: "Functions that take arguments or start with a double underscore are not publicly exposed and can only be called by other functions." What about functions that take an argument which has a default value specified (i.e. can be called without an argument)? Would

[web2py] Customizing detail view (grid)

2019-01-04 Thread Vlad
How would I customize a details view which is brought up by the grid when "view/detail" button is clicked when the grid has "details=True" parameter set? (I just want to add more information there, but not straight from the table the grid is based on) -- Resources: - http://web2py.com -

[web2py] Load / no ajax / custom div

2019-01-10 Thread Vlad
I am using Load function (ajax=False) which creates a div it's using to load the context in. Is there an easy way to specify this div to be of a certain class? (I want to add "d-flex" class to it, to use flex in the html/container I am loading) -- Resources: - http://web2py.com -

[web2py] login_after_registration doesn't work?

2019-01-11 Thread Vlad
I am probably missing something simple: when I explicitly go to http://127.0.0.1:8000/app/default/user/register - I get auto-logged in after the registration. Same if I choose "register" on the menu. However, when the following gets executed: auth.settings.login_after_registration = True

[web2py] Re: login_after_registration doesn't work?

2019-01-13 Thread Vlad
ings, just not auth.settings.remember_me_form as it was setup correctly by default anyway). Thank you! On Friday, January 11, 2019 at 10:59:58 PM UTC-5, Anthony wrote: > > On Friday, January 11, 2019 at 11:44:27 AM UTC-5, Vlad wrote: >> >> I am probably missing something simple

Re: [web2py] Re: web2py apps & github

2019-01-13 Thread Vlad
Got it, thank you very much. Learning git now - it's so messy and unstructured as far as learning curve :) I guess once I get it, it becomes quick and easy... On Monday, January 7, 2019 at 7:21:55 PM UTC-5, Dave S wrote: > > > > On Sunday, January 6, 2019 at 12:45:27 PM UTC-8

[web2py] Re: strange footer...

2019-01-13 Thread Vlad
ly... Cost me a few hours of stress :) On Wednesday, January 9, 2019 at 1:09:58 PM UTC-5, Vlad wrote: > > I am observing very strange behavior of the footer in my project. > > on my local computer it's prefect - sticks where it has to be. > > Once I transfer it to PythonAnyw

[web2py] strange footer...

2019-01-09 Thread Vlad
I am observing very strange behavior of the footer in my project. on my local computer it's prefect - sticks where it has to be. Once I transfer it to PythonAnywhere - the footer looks like it "forgot" what absolute positioning means. It's initially located on the bottom of the screen, as if

[web2py] responsive collapsible menu

2019-01-09 Thread Vlad
Web2py menu is a perfect responsive collapsible menu. I am looking at the code - all makes sense, but I don't understand one thing: Where in web2py is it triggered that a larger view would hide the toggle button and make the menu visible, while the smaller view would do just the opposite?

[web2py] Re: New International Telegram Support Group

2019-03-25 Thread Vlad
Joined! Very nice & interactive - There is some beauty in messenger group interaction vs. traditionally organized groups... On Tuesday, March 19, 2019 at 2:49:34 PM UTC-4, Ari Lion BR Sp wrote: > > Oh, Great > > Now I see a new link to this group: > https://t.me/web2py_world > > > Great I

[web2py] Re: error while reading browser cookies

2019-02-25 Thread Vlad
Never mind... It's the difference between Python 2 and Python 3. The books needs to be updated with the latest. On Monday, February 25, 2019 at 12:45:02 PM UTC-5, Vlad wrote: > > This is the first time I am trying to use the cookies. Following the > appropriate section in the b

[web2py] error while reading browser cookies

2019-02-25 Thread Vlad
This is the first time I am trying to use the cookies. Following the appropriate section in the book, here is the line: *if request.cookies.has_key('test_cookie'):* it causes the following error: 'SimpleCookie' object has no attribute 'has_key' what am I missing? -- Resources: -

[web2py] customizing submit button in SQLFORM() - works partially

2019-02-24 Thread Vlad
I have the following line in the controller: form = SQLFORM(db.inquiry, submit_button = 'Explore').process() the view has the following: {{=form}} $('input:submit[value=Explore]').attr('style', "'width:400px; max-width:100%;'");

[web2py] creating a db table doesn't actually create a table (sqllite)

2019-02-24 Thread Vlad
When I define a table in db.py - it's just fine. But if I create a new file - the admin interface picks it up, i.e. tells me that this model is creating the table, but the table is not actually created. What would cause such a difference?? It's really strange, as in other projects I define

[web2py] Using lambda in Field constructor for default

2019-03-15 Thread Vlad
I am missing something very simple here, but can't unstuck myself: This is what I want to have in the Field constructor (though it's obviously incorrect): Field('link', default=lambda link, row: URL('podcast', 'episode/' + row.id, scheme=True, host=True)) I simply want one field to be

[web2py] A question about ajax function (passing a string parameter over)

2019-05-16 Thread Vlad
I have the following javascript in the view: var id = $('#CurrentCartId').text(); var description = $(this).text(); var url='{{=URL('cart','description')}}'; url += '/' + id + '/'; url += description; ajax(url,[],':eval');

[web2py] Re: A question about ajax function (passing a string parameter over)

2019-05-16 Thread Vlad
lass (instead of id), it doesn't work - doesn't touch the values: $(".EncodedDescriptionField").html(atob($(".EncodedDescriptionField").text())); I am sure I am missing something basic... Greatly appreciate suggestions - On Thursday, May 16, 2019 at 6:54:14 PM UTC-4, Vlad wr

[web2py] Re: A question about ajax function (passing a string parameter over)

2019-05-16 Thread Vlad
? (It doesn't change the values - they remain as they are, encrypted) On Thursday, May 16, 2019 at 5:35:39 PM UTC-4, João Matos wrote: > > Have you considered base64 encoding/decoding? > > quinta-feira, 16 de Maio de 2019 às 20:43:58 UTC+1, Vlad escreveu: >> >>

[web2py] accessing a function in another controller

2019-05-15 Thread Vlad
this must be a very basic question; I just don't have full clarity on how web2py handles this: can code in one controller somehow access a function in another controller? Or I have to move such a function to model code? -- Resources: - http://web2py.com - http://web2py.com/book

[web2py] Re: updating menu without reloading the page

2019-05-15 Thread Vlad
I didn't say it precisely. By web2py controlling it I meant that it's dynamic and changes all the time - it's not static that I could assign certain id to some item... On Wednesday, May 15, 2019 at 7:55:26 PM UTC-4, Vlad wrote: > > Sometimes I need to change the menu without reloading th

[web2py] Re: updating menu without reloading the page

2019-05-15 Thread Vlad
Never mind, Resolved... On Wednesday, May 15, 2019 at 8:43:44 PM UTC-4, Vlad wrote: > > I didn't say it precisely. By web2py controlling it I meant that it's > dynamic and changes all the time - it's not static that I could assign > certain id to some item... > > On Wedne

[web2py] updating menu without reloading the page

2019-05-15 Thread Vlad
Sometimes I need to change the menu without reloading the page. More specifically: response.menu = [ . . ('Cart (' + str(howManyItemsInCart()) + ")", False, URL('catalog','cart'), []), ] I do control the event when the cart content

[web2py] Re: A question about ajax function (passing a string parameter over)

2019-05-17 Thread Vlad
ou need to iterate through the class elements. See this: > > https://stackoverflow.com/questions/4735342/jquery-to-loop-through-elements-with-the-same-class > > > > On Thursday, 16 May 2019 23:58:28 UTC+1, Vlad wrote: >> >> Just to clarify: >> >> the fol

[web2py] Re: A question about ajax function (passing a string parameter over)

2019-05-17 Thread Vlad
console.error(decodedString); }); throws an exception, even for the same very value! Will simplify it all now, let's see what comes out... On Friday, May 17, 2019 at 12:20:37 PM UTC-4, Vlad wrote: > > It works almost, but not 100% :) > > with encodeURI

[web2py] Re: A question about ajax function (passing a string parameter over)

2019-05-17 Thread Vlad
atever they enter - In contrast, atob and btoa work just perfect, except that in one particular situation is gets messed up by that exception... On Friday, May 17, 2019 at 10:17:50 AM UTC-4, Anthony wrote: > > On Thursday, May 16, 2019 at 3:43:58 PM UTC-4, Vlad wrote: >> >> I have

[web2py] Stripe Elements don't display properly - because of some security issue in Web2py - (CSP?)

2019-05-27 Thread Vlad
I've got some security-related errors which cause Stripe elements not to display correctly. Some googling helped to understand that presumably web2py uses CSP (content security policy?) and some stripe resources need to be whitelisted somewhere (not sure if it's web2py-related or web

[web2py] Re: Stripe Elements don't display properly - because of some security issue in Web2py - (CSP?)

2019-05-27 Thread Vlad
After some googling I tried to add something like this definitely not safe, but in any case doesn't help at all - or like this same errors come back - and stripe elements don't show up right... On Monday, May 27, 2019 at 9:18:04 AM UTC-4, Vlad wrote: > > I've got some se

[web2py] string vs text db field question

2019-06-04 Thread Vlad
I've used a string field to keep certain info, and it works just fine, but I've just noticed that the strings I ended up saving in this field were around 1,000 characters long, sometimes even closer to 2,000. According to the docs, the default limit for a string field is 512. The limit doesn't

[web2py] the SQLFORM form inserting a record - how to access the new record's id??

2019-05-30 Thread Vlad
Oops, just found an answer here by Anthony from 8 years ago about form.vars.id :) Thank you, Anthony! -- 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] submitting a form from a LOAD component - request.post_vars is empty

2019-05-31 Thread Vlad
I am loading a component with LOAD. the component has the form on it. the form is submitting via post method. request.post_vars is empty. the variables don't go through. when I copy the same very code and pasting it in the view (i.e. instead of the LOAD component - while taking the LOAD line

[web2py] Re: submitting a form from a LOAD component - request.post_vars is empty

2019-05-31 Thread Vlad
sorry for keeping posting about this. I am just totally stuck. I am sure that I am missing something very basic. Here is the complete code: Submit

[web2py] Re: submitting a form from a LOAD component - request.post_vars is empty

2019-05-31 Thread Vlad
in input fields - are passed over correctly. Greatly appreciate some help... On Friday, May 31, 2019 at 2:38:06 PM UTC-4, Vlad wrote: > > I am loading a component with LOAD. the component has the form on it. the > form is submitting via post method. > > request.post_vars is empty

[web2py] the SQLFORM form inserting a record - how to access the new record's id??

2019-05-30 Thread Vlad
form = SQLFORM(db.person) if form.process().accepted: ... How can I access the id of the record inserted into the db by the form? -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source

[web2py] how safe is it to rely on a value stored as a session variable?

2019-06-06 Thread Vlad
I don't really understand how it works internally, so wondering if it's safe to rely on a value stored as a session storage variable. More specifically, I am authorizing one user to do certain actions on behalf of another user, and the currently assumed user is stored in session.user (even if

[web2py] sqlform grid search widget expression question

2019-06-05 Thread Vlad
How can I search for None values? For example, the search expression table.customer == "1" gives me records with customer equals 1. I can't figure out how to search for records with customer field equals None. Tried none,NONE, None, "none", etc. Nothing helped :) Is it possible at all?

[web2py] auth.settings.login_next doesn't redirect after login -

2019-06-06 Thread Vlad
What could be the reason the following code wouldn't redirect to the appropriate URL after login? (still brings to default/index page) def login_to_url(): auth.settings.login_next=URL(request.args(0),request.args(1)) logger.warning(auth.settings.login_next)

[web2py] 2 domains for 2 apps on 1 web2p

2019-06-14 Thread Vlad
I've had multiple apps in one web2py with no problems, of course, but only up to the point I've assigned different domains to different apps I am on PythonAnywhere, but presumably it's the same issue on any hosting. I am giving 2 cnames for 2 apps, and I pointed both cnames properly. BUT

[web2py] Re: 2 domains for 2 apps on 1 web2p

2019-06-14 Thread Vlad
irecting to /app1/cont1/func1, as per the only "/" entry in routes.py, as "/" doesn't distinguish between domains. What am I missing? How can I handle this properly?? On Friday, June 14, 2019 at 2:23:21 PM UTC-4, Vlad wrote: > > I've had multiple apps in one web2py with

Re: [web2py] switching to postgres [RuntimeError: No driver of supported ones ('psycopg2',) is available]

2019-06-16 Thread Vlad
tion. I am at loss on how to handle this gracefully. SQLite has served perfect up until now, when I have to get to a real db... On Sunday, June 16, 2019 at 10:41:22 AM UTC-4, Vlad wrote: > > Okay, I recreated it in a simplest form, to get rid of any extra > parameters. Can't make

[web2py] please help: sycopg2.OperationalError: FATAL: password authentication failed for user "test"

2019-06-16 Thread Vlad
I'm bringing this from another post, because I've narrowed down the problem considerably, and it no longer corresponds neither to the headline nor to the content of that post. the following works fine, creating a valid connection: connection = psycopg2.connect(database="test_db", user="test",

[web2py] Re: please help: sycopg2.OperationalError: FATAL: password authentication failed for user "test"

2019-06-16 Thread Vlad
in connector return self.driver.connect(**self.driver_args) File "/home/vladtseytkin/.local/lib/python3.7/site-packages/psycopg2/__init__.py", line 126, in connect conn = _connect(dsn, connection_factory=connection_factory, **kwasync) psycopg2.OperationalError: FATAL: password

Re: [web2py] switching to postgres [RuntimeError: No driver of supported ones ('psycopg2',) is available]

2019-06-16 Thread Vlad
Yes, it was a typo. There were quite a few things that went wrong and I missed this one even after looking at it dozens of times, checking each character... It's perfect now. Thank you very much -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) -

[web2py] Hiding grid's columns (SQLFORM.grid) for smaller screen sizes

2019-06-11 Thread Vlad
how would I hide certain fields of the grid generated by SQLFORM.grid() depending on a screen size? normally I would use media breakpoints, but I am not sure how to manage it with SQLFORM.grid, as grid doesn't seem to expose any widgets explicitly... -- Resources: - http://web2py.com -

[web2py] Re: managing users with no email

2019-06-11 Thread Vlad
auth_user.phone == > form.vars.phone).select(auth_user.email) > + and you can login user using auth.login_bare(email, password) > > On Tuesday, June 11, 2019 at 9:41:40 PM UTC+3, Vlad wrote: >> >> seems to me that the ideal solution would be to allow an email field in >> auth_

[web2py] Re: managing users with no email

2019-06-11 Thread Vlad
way to achieve this... On Tuesday, June 11, 2019 at 2:37:23 PM UTC-4, Vlad wrote: > > Trying to figure out how to manage the following: > > some users will manage themselves. this means that they have email and > they log into the system and do whatever they want. > >

[web2py] managing users with no email

2019-06-11 Thread Vlad
Trying to figure out how to manage the following: some users will manage themselves. this means that they have email and they log into the system and do whatever they want. other users don't use email (and generally aren't online altogether). so I want an admin to manage them, i.e. they

[web2py] intercepting login & logout events

2019-06-17 Thread Vlad
What would be the simplest way to intercept login and logout? (i.e. I'd like to perform some additional tasks when a user is logged in, and when a user is logged out.) web2py elegantly hides the functionality in default.user under form=auth() and {{=form}} and somehow I can't think of a simple

Re: [web2py] intercepting login & logout events

2019-06-17 Thread Vlad
will cause a redirect > (HTTP exception) and the user is effectively logged into the system. > > The same goes for the logout, but there is not a form in the middle. > > El lun., 17 jun. 2019 a las 9:57, Vlad (>) > escribió: > >> but isn't such a scenario catching a

Re: [web2py] intercepting login & logout events

2019-06-17 Thread Vlad
dict(form=form) > > > > El lun., 17 jun. 2019 a las 9:19, Vlad (>) > escribió: > >> What would be the simplest way to intercept login and logout? >> (i.e. I'd like to perform some additional tasks when a user is logged in, >> and when a user is logged out

[web2py] Re: orderby=['alias'] - works in sqlite, but not in postgres

2019-06-18 Thread Vlad
;DESC" is used to indicate descending order ("ASC" for ascending). > > So, you can do: > > orderby='shares DESC' > > Anthony > > On Monday, June 17, 2019 at 11:48:51 PM UTC-4, Vlad wrote: >> >> This works perfect in SQLite: &

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

2019-06-18 Thread Vlad
works like a charm!! thank you Annet!!! thank you Anthony!!! On Tuesday, June 18, 2019 at 3:11:08 PM UTC-4, Annet wrote: > > I think Anthony answered this question in this post: > > https://groups.google.com/forum/?fromgroups=#!topic/web2py/okMVqyQPKV8 > > hope he did ;-) > > > Regards, > >

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

2019-06-18 Thread Vlad
Is there an easy way to force the SQLFORM grid to show one specific column entirely, without cutting it off, even if the row would have to be extended vertically, just whatever it takes to see the full text content? -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) -

[web2py] orderby=['alias'] - works in sqlite, but not in postgres

2019-06-17 Thread Vlad
This works perfect in SQLite: rows = db(query).select(db.cart_sharing.created_by.with_alias('sharer'), db.cart_sharing.stats.count().with_alias('carts' ), db.cart_sharing.stats.sum().with_alias('shares'),

Re: [web2py] intercepting login & logout events

2019-06-17 Thread Vlad
thank you ! On Monday, June 17, 2019 at 11:02:13 AM UTC-4, Yoel Benitez Fonseca wrote: > > Vlad, in the book: > > > http://www.web2py.com/books/default/chapter/29/04/the-core#HTTP-and-redirect > > And i can comment out +/- the code: > > def user(): > > #

[web2py] emailing the content of the current page

2019-06-19 Thread Vlad
I'd like to send an email with html content - the current page: mail.send('y...@example.com', 'Message subject', 'html body') How do I make the html body available in python code? (i.e. how do I pass it from the view to the python code?) to get it in js easy -

[web2py] form's field having special characters transmitted via request.post_vars

2019-06-20 Thread Vlad
I have a form with an input text field. The form is submitted via POST. The vars value is read and passed over into response.js to run some action. All works perfect until that field has special characters, like " and the like. Javascript does't like it. It doesn't see that as a string, but

[web2py] redirecting domain

2019-06-20 Thread Vlad
what's the most efficient way to redirect domain to another domain entirely on a level of web2py? -- 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: emailing the content of the current page

2019-06-20 Thread Vlad
I couldn't figure out how this woks, so just rendered it again. Not a big deal - just a matter of convenience. The email requests come occasionally, so this extra render doesn't cause trouble. Thank you, Val! On Thursday, June 20, 2019 at 6:23:55 AM UTC-4, Val K wrote: > > I think you can try

[web2py] switching to postgres [RuntimeError: No driver of supported ones ('psycopg2',) is available]

2019-06-15 Thread Vlad
I am getting the following error: RuntimeError: No driver of supported ones ('psycopg2',) is available I used "pip3 install psycopg2" and pip now reports that psycopg2 is installed. What am I still missing? What's the best (quickest, easiest, and hassle-free) way to use postgres from web2py?

[web2py] making a secure db connection on top of already existing SSL for the site

2019-06-15 Thread Vlad
Here is a quote from the web2py docs: "Making a secure connection Sometimes it is necessary (and advised) to connect to your database using secure connection, especially if your database is not on the same server as your application. In this case you need to pass additional parameters to the

[web2py] Web2py/DAL equivalent of "not in [a table]"

2019-05-14 Thread Vlad
What would be an equivalent of the following? SELECT ID, Name FROM Table1 WHERE ID NOT IN (SELECT ID FROM Table2) -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list

Re: [web2py] Re: A question about ajax function (passing a string parameter over)

2019-05-18 Thread Vlad
UTC-4, Vlad wrote: > > Here is a test I've just run: > > def test(): > url = URL('cart','test2',args=['a b c 1 3 2 $ % ( ) > !'],vars={'oops':'1 3 5 a s i t ! @ # $ %'}) > redirect(url) > > def test2(): > str1 = request.args[0] > str2 =

Re: [web2py] Re: A question about ajax function (passing a string parameter over)

2019-05-18 Thread Vlad
('cart','description')}}'; url += '/' + id + '/'; url += "?description="+description; url=encodeURI(url); ajax(url,[],':eval'); On Saturday, May 18, 2019 at 10:45:02 PM UTC-4, Vlad wrote: > > Oops, I still don't know how to achieve

[web2py] IS_NOT_EMPTY() "takes away" a dropbox with a list of items referenced by a foreign key -

2019-05-18 Thread Vlad
In the following table - db.define_table('products_group_content', Field('products_group','reference products_group',requires=[IS_NOT_EMPTY()]), Field('product','reference product'), auth.signature) when I add a record (using grid functionality or in the admin interface) - the

[web2py] Re: IS_NOT_EMPTY() "takes away" a dropbox with a list of items referenced by a foreign key -

2019-05-19 Thread Vlad
IS_IN_DB() validator, which will require the > selection of a value. > > Anthony > > On Sunday, May 19, 2019 at 1:38:10 AM UTC-4, Vlad wrote: >> >> In the following table - >> >> db.define_table('products_group_content', >> Field('products_group','refere

[web2py] Re: IS_NOT_EMPTY() "takes away" a dropbox with a list of items referenced by a foreign key -

2019-05-19 Thread Vlad
Got it working - Thank you! On Sunday, May 19, 2019 at 7:16:40 AM UTC-4, John Bannister wrote: > > Hi Vlad, > > I think I have come across this issue as well some time ago. Can you try > IS_NOT_EMPY() OR IS_IN_DB(id ...) > > This should hopefully bring back your d

[web2py] SQL ALL & ANY operators - ?

2019-05-20 Thread Vlad
Does Web2py / DAL have an equivalent of ALL and ANY SQL operators? -- 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

[web2py] javascript from ajax with :eval question

2019-05-21 Thread Vlad
I am calling ajax function with :eval and setting up some javascript [from the controller] to be executed [as per :eval option js is executed in the end], something like this: result = "$('#DebugID').append('" result += "CONTENT" result += "');" return result Now, this works,

[web2py] Re: Rows class constructor question

2019-05-21 Thread Vlad
Leonel, in your example, if "import peartree" doesn't bring in Pear (and thus Pear needs to be imported explicitly) - then... How is Pear accessible at all? I mean, if Pear is not accessible - then what's the difference between direct usage and indirect usage? I guess I am missing something

[web2py] Re: javascript from ajax with :eval question

2019-05-21 Thread Vlad
> Maybe this: ASSIGNJS > > http://www.web2py.com/books/default/chapter/29/05/the-views#ASSIGNJS > > > > On Tuesday, 21 May 2019 15:43:25 UTC+1, Vlad wrote: >> >> I am calling ajax function with :eval and setting up some javascript >> [from the cont

[web2py] Re: Rows class constructor question

2019-05-21 Thread Vlad
suspecting that I am missing something very basic about namespaces. Earlier Leonel explained it, but I didn't understand the explanation. On Tuesday, May 21, 2019 at 11:52:23 AM UTC-4, villas wrote: > > rows = pydal.objects.Rows() > > > On Tuesday, 21 May 2019 04:14:45 UTC+1, Vlad wrot

[web2py] Re: updating menu without reloading the page

2019-05-16 Thread Vlad
s created dynamically... This kind of stuff makes our work enjoyable :) Thank you for the inquiry! On Thursday, May 16, 2019 at 7:24:45 AM UTC-4, villas wrote: > > Hi Vlad, > It is great that you resolved this problem. > Many of us use this group to search and learn from each other'

[web2py] Rows class constructor question

2019-05-20 Thread Vlad
I must be missing something very basic here... Want to create an empty Rows object, and then to append to it sets of rows from various sql queries with the same structure of the result sets. The first line in the code (in a controller) is rows = Rows() with an intention of creating an

[web2py] Online store with Web2py

2019-05-06 Thread Vlad
By any chance, is there a template-like online store available? I am sure plenty stores have been built with web2py already... Shouldn't be a big deal to build it, but would be nice to have something functional to begin with... -- Resources: - http://web2py.com - http://web2py.com/book

[web2py] Using db.table.format (i.e. format attr outside of table definition)

2019-07-03 Thread Vlad
Using the following db.table.format = lambda row: 'test' before SQLFORM.grid creation doesn't seem to work. What's the proper way to set record representation outside of table definition? -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) -

[web2py] customizing menu items when MENU helper is used

2019-07-30 Thread Vlad
what would be the best way to specify a background color (different for each menu item, depending on some database-driven data) when I build the menu with menu.append(...) in menu.py? I would love to have something like this: menu.append([description, False,

[web2py] specifying an id of an ajax component (LOAD)

2019-06-30 Thread Vlad
I am using the LOAD helper in the view: {{=LOAD(c='customer',f='testimonials',extension='load',ajax=True,ajax_trap=True,content='loading testimonials...',*_id='TESTIMONIALS_HERE'*)}} The id (_id) is specified explicitly. However, it ignores the id parameter and produces the following:

Re: [web2py] switching to postgres [RuntimeError: No driver of supported ones ('psycopg2',) is available]

2019-06-16 Thread Vlad
is point is present and found by Python *(not even sure what was the problem before, when it couldn't be found on windows), but *on windows connection fails, while on linux password authentication fails*. Greatly appreciate any ideas. On Sunday, June 16, 2019 at 7:54:20 AM UTC-4, Vlad wrote: >

[web2py] Using db.table.format (i.e. format attr outside of table definition)

2019-07-07 Thread Vlad
Please help! Any way to use this format property outside of a table definition? -- 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] auth_membership grid with both, group id and group roles displayed when adding a new record

2019-10-07 Thread Vlad
the following line works perfectly: grid = SQLFORM.grid(db.auth_membership) by "perfect" in the context, I mean that when I click "add record", the group id field contains both values, group id and group role (for example, "Manager (4)", "Loyal customer (9)", ... However, I want to limit

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

2019-10-07 Thread Vlad
I don't fully understand it - will play with it to figure it out. Annet's suggestion worked right away, but still I really want to understand what's going on... thank you! On Monday, October 7, 2019 at 6:38:24 AM UTC-4, villas wrote: > > By specifying requires = IS_IN_SET(ids), you are also

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

2019-10-07 Thread Vlad
thank you very much! works like a charm! On Monday, October 7, 2019 at 6:36:02 AM UTC-4, Annet wrote: > > 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 > --

  1   2   3   >