Thanks for a great framework. I'm loving web2py, but I just encountered a
difficult query
One query generates a list of people.
Each of those persons has 0 to many reports filed about them.
I wanted to see only the newest report on each person AND I want to see
Null or None if no reports have b
If it helps, here is how I can get the desired result in raw SQL:
SELECT * FROM benchmark_targets t2 LEFT JOIN (SELECT * from lobby_report
GROUP BY KPID ORDER BY datetime DESC)t1 ON t2.KPID = t1.KPID;
Now how to do it in DAL?
--
---
You received this message because you are subscribed to th
Forgot the WHERE in my SQL statement. Should be:
SELECT * FROM benchmark_targets t2
LEFT JOIN (SELECT * from lobby_report GROUP BY KPID ORDER BY datetime
DESC)t1 ON t2.KPID = t1.KPID
WHERE t2.benchmark = 10;
--
---
You received this message because you are subscribed to the Google Groups
I'm only talking to myself here, but the notes are helpful...
This is how I get the desired result in web2py using the executesql command:
foo = db.executesql('SELECT * FROM benchmark_targets AS t2 LEFT JOIN
(SELECT * from lobby_report GROUP BY KPID ORDER BY datetime DESC) AS t1 ON
t2.KPID = t1
Solved: It was a dumb mistake.. I was trying to group by a field in the
left join table.. so of course it was eliminating all records not found in
the second table. I switched the group by to a first table field and all
is well.
Final working query was:
foo = db(db.benchmark_targets.benchmar
I like the way that SQLFORM.grid search works. Once I've searched for
records and come up with the set I want, How can I pass that set off to
another function to do work just on those filtered records? Or in other
words.. if I have 100 records, and I use the grid search to narrow it down
to 1
ld('district_ks_house','string',writable=False),
Field('district_ks_senate','string',writable=False),
)
def search_test():
search = SQLFORM.search_ment([db.members.district_ks_house,
db.members.district_ks_senate])
return locals()
On Sunday, M
from within the .web2py_console part of
> the grid DOM. When you submit the form, the query will be available in
> request.var.keywords, which you can then pass to the SQLFORM.build_query()
> method to generate the DAL Query.
>
> Anthony
>
> On Sunday, March 31, 2013 11:52:
Hi. I have web2py installed on webfaction as my production server.
I followed the web2py documentation on it's scheduler function and built an
app where everything works as anticipated. (very cool!)
In order to run the scheduler though I need to SSH into the server and run
this command:
"python
Simultaneously with Niphlod's reply also came this from webfaction customer
support:
You can use the nohup command at the start of this command to make it
immunte to hangups, like when you are exiting your ssh session.
http://linux.die.net/man/1/nohup
Or you can use disown to disassociate the
In a normal grid the orderby descending works just fine:
grid = SQLFORM.grid(db.meetings,
orderby=~db.meetings.meeting_date,
)
But I can't get the parent table of a smart group to sort the same way:
grid = SQLFORM.smartgrid(db.meetings,
linked_tables=['meeting_docs'],
ed web2py in a while since I moved on to flask.
Sorry I'm not more help.
J
On Fri, Mar 7, 2014 at 6:41 PM, Dan Kozlowski wrote:
> Jake,
>
> Did you ever get this to work ? Reason being I think I have the same
> problem.
>
>
> On Sunday, April 21, 2013 9:47:59 AM UTC-
12 matches
Mail list logo