Hi Johan,
following code works for me to insert some items from the db into a submenu:
response.menu = [
('Home', False, URL('default','index'), []),
]
if auth.is_logged_in():
locaties = db(db.locatie.apotheek_id==auth.user.apotheek_id).select()
if locaties:
locaties_
Hi All,
i would like to remove sessions for some selected users.
I can't find a way to relate a session to a user, is there a way to do this?
I already store the sessions in the database, so removing all sessions is
easy:
@auth.requires_membership('Administrators')
def invalidate_sessions():
i found the answer, thought to post in case somebody is struggling with the
same problem.
you can access the session.session_data with
cPickle.loads(sessie.session_data)['auth']['user']['id']
--
Hi All,
In the past few days i have been struggling with the problem of generating
a dynamic query.
My goal is to create a reusable model, which gives the possibility to
search all fields in a given table for the presence of a string. The result
will be a list of id's with the records in whic
Hi Anthony,
Thanks (again) for taking the time to answer my question! This gets me
going again!
I will post the working result here in case somebody else is trying to
archieve something like this.
Cheers,
Jaap
--
Hi All,
i've been struggling with the following problem for some time and hope
anyone can help.
When i instantiate a class in a controller (class is in separate file in
Modules folder) and i want to use the database from within this instance, i
have to pass the DB to the class.
Inside this i
Hi Johann,
Thanks for your quick reply!
I will test the suggestions as made in the previous thread (don't know if
this works:
https://groups.google.com/forum/?fromgroups#!topic/web2py/0k0Fvw6fmb8 ).
bye,
Jaap
Hi Wikus,
Thanks a lot!
Adding a db.commit() after an insert causes the database to be updated.
Bye,
Jaap
On Feb 24, 6:38 pm, Anthony wrote:
> On Friday, February 24, 2012 12:24:03 PM UTC-5, JaapP wrote:
>
> > Hi Wikus,
>
> > Thanks a lot!
> > Adding a db.commit() after an insert causes the database to be updated.
>
> The db.commit() shouldn't be needed. Can yo
at your app is using. Is it possible you
> made a change to your toolbox module and didn't restart web2py or have
> module change tracking turned on? Have you tried removing the db.commit()
> and restarting web2py to see if it works without it? Maybe try my sample
> code above and see
Hi ,
could anyone give me an hint on this one please:
i've been playing with sqlform.grid and noticed that in web2py Version
1.99.3 (2011-11-11 10:27:54) dev i cannot use the columns option any
more (TypeError: grid() got an unexpected keyword argument 'colums')
This did work in previous version
= [db.table.field1, db.table.field2]
>
> grid = SQLFORM.grid(query, fields=fields)
>
> I'm still having some issues when using fields in SQLFORM.smartgrid, but
> I think it should work fine in SQLFORM.grid.
>
> -Jim
>
> On 11/11/2011 12:22 PM, JaapP wrote:
>
>
One more reason to stick to using fields could be that with fields you
can specify the order in which the columns are shown, this didn't work
for 'columns'
On 14 nov, 18:13, Jim Steil wrote:
> Ok, columns are gone again...
>
> Might just be best to stick with using fields.
>
> -Jim
>
> On 11
Hi Massimo,
i tried to play a little bit with the 'query=...' part but i can't get
it working;
#CONTROLLER
def locaties():
locaties =
SQLFORM.grid(db.locatie,query=db.locatie.mutatie_user_id==auth.user.id)
return dict(locaties=locaties)
Error:
locaties =
SQLFORM.grid(db.locatie,query=
omatically
>
> On Aug 21, 7:19 am, JaapP wrote:
>
>
>
>
>
>
>
> > Hi Massimo,
>
> > i tried to play a little bit with the 'query=...' part but i can't get
> > it working;
>
> > #CONTROLLER
> > def locaties():
> >
Hi,
i am trying to use a crud.update function and want to change the value
of a field before passing to the view.
i've spent a couple of hours trying and searchin.
I found this post http://permalink.gmane.org/gmane.comp.python.web2py/37314
but the suggested use of 'db.table.field.update=' doesn't
a concrete example?
>
> On Aug 28, 9:37 am, JaapP wrote:
>
>
>
>
>
>
>
> > Hi,
>
> > i am trying to use a crud.update function and want to change the value
> > of a field before passing to the view.
> > i've spent a couple of hours trying an
tand from the post i refered to in the beginning
Massimo suggests using 'db.table.field.update=...' for changing the
existing value?
Jaap
On Aug 28, 5:16 pm, Bruno Rocha wrote:
> On Sun, Aug 28, 2011 at 12:06 PM, JaapP wrote:
> > db.bestelling.bedrag.update = '10'
&
Hi,
i've build a (very small) standalone side project (so, running without
Web2Py) that uses the Web2Py DAL, and all goes well.
Now i'm trying to enable record versioning. but this seems not to be
working (thread._local object has no attribute 'request')
Has anybody succeeded in using record
Hi All,
i've been struggling and googling this problem for may hours, hope someone
can give me a hint:
i'm trying to create a ROWS object from data i receive from an external
webservice.
I do not have a corresponding table in the database, and would like to do
something like this:
*NOT WORKI
Hello Anthony,
Your code is working for me!
If you want to display the rows from a view with {{=rows}} i still get an
error, but i use a custom table builder which takes a rows object as input,
and this works just fine.
In the end, my mistake was not importing a row object, only a rows object..
Hello,
i'm trying to call a javascript function from a submenu item and having
some troubles with this.
Calling javascript from a level 1 menu works just fine, like this:
response.menu = [
(T('File'), False, URL(), [
(T('New'), False, URL('project', 'create'), [])
]),
(A('c
Hi,
Any hints about how to tackle the following problem greatly appreciated:
given three tables:
*employee*:
id
name
...
*contract*:
id
start_date
fte100
...
*employee_contract:*
id
employee_id
contract_id
An employee can have one or more contracs; they are linked through the
employee_contra
the last line in my code example should have been:
latest_start_date = contr[db.contract.start_date.max()]
--
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)
--
employee.ALL, db.contract.ALL, orderby=
> db.employee.id|~db.contract.start_date, distinct=db.employee.id)
>
> On Sunday, 28 December 2014 15:57:10 UTC-6, JaapP wrote:
>>
>> Hi,
>>
>> Any hints about how to tackle the following problem greatly appreciated:
>>
>>
Hi,
Hope to save someone with the same problem some time:
i encountered a problem running web2py in a docker; the admin password as
set from the start command was not recognised when trying to log into the
admin interface.
Wrong dockerfile snippet:
EXPOSE 8000
CMD ["/usr/bin/python", "/home/w
26 matches
Mail list logo