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
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 folde
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 fun
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 = db.test
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 Issues
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)
- http://github.com/web2py/we
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'),
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 p
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 everything
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 tha
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
- http:/
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 p
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 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?
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
- http://web2p
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
r settings, 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
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
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 PythonAn
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 G
hat a user 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
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 f
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 Git
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 any
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 applications
racters, even simple 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?
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 rec
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
tabl
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%;'");
$('input:submit[value=Ex
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:
-
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
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 determi
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 joine
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 (Docume
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 (Report
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 (Documentatio
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 c
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 witho
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...
>
&
cart quantity.
It's pretty straightforward, but somehow it took me time to figure out how
to address that menu item as it'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:
>
&
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');
t
hat am I doing wrong? (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 es
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-
illas wrote:
>
> Maybe you 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 clari
ly whatever 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:
>>
>>
re);
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% :)
>
encoding / decoding???
On Saturday, May 18, 2019 at 9:55:22 PM 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
var url='{{=URL('cart','description')}}';
url += '/' + id + '/';
url += "?description="+description;
url=encodeURI(url);
ajax(url,[],':eval');
On Saturday, May 18, 2019 at 10:45
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 prod
N_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
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
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
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 emp
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 basi
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, a
on final touch?
On Tuesday, May 21, 2019 at 11:34:54 AM UTC-4, villas wrote:
>
> 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 cal
port statement? I am 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:
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
server-rel
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'
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
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)
---
Yo
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
else here - those variables that are
hardcoded in the form, i.e. not submitted via created on the fly 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 componen
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
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
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?
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)
redirect(URL('default
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 a
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
- http:/
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 would
easy 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.
>
- db(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
>>
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
only
he root www.domain2.com will still be redirecting
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:
&g
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?
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 d
t;
*So psycopg2 at this 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:2
pointers to the db direction. 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
>
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",
line
118, 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:
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)
- http://github.com/web
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 w
nt_here()
>
> return 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,
to auth() 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
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():
>
> #
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'),
groupby=d
l throw an error. In any case, in
> SQL, "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, V
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)
- h
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,
>
> Ann
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 - document.documentElement.outerHTML
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
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
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 re
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:
load
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)
- http://github.com/web2py/web
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 message
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,
URL('catalog','regimen',args=[id]
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 wha
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
>
--
R
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 ov
1 - 100 of 224 matches
Mail list logo