Community Page
- www.codespatter.com Jump to website »
-
Subscribe -
Community
-
Top Commenters
-
Popular Threads
-
Recent Comments
- You can do this. from somewhere import SoftDeleteManager class NewManager(SoftDeleteManager): '''new stuff''' and in the model objects = NewManager()
- Great writeup, thanks for that! I'll have question though. Say I import SoftDeleteManager from an external file and use it with objects = SoftDeleteManager() But now, I loose ability to define...
- thanks, man!
- Yes! Finally I know where that annoying example.com lives! Thank you!
- Thanks very much! I think you just saved me a lot of stuffing around with settings.py
Jump to original thread »
Trying to find a way to update a bunch of records in the request table by changing request_taken_time to a value in another table. The problem is, there are multiple records in the history table so there will be duplicate queries and it may not get the most recent time which is what is wanted. [
... Continue reading »
1 year ago
1 year ago
UPDATE tbd_requests
SET request_taken_time =
(
SELECT history_created
FROM tbd_history
WHERE tbd_history.request_id = tbd_requests.request_id
AND history_action LIKE 'taken'
ORDER BY history_created DESC
LIMIT 0, 1
)
WHERE request_type != 11
ORDER BY request_id ASC
LIMIT 0, 1
and getting this
#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ' 1' at line 13
Fate doesn't want to allow me to restructure this database, it wants me to forever have slow queries.
1 year ago
Affected rows: 4176 (Query took 176.0788 sec)
1 year ago