mirror of
https://github.com/not-kennethreitz/convore.json.git
synced 2026-06-17 13:41:01 +00:00
1 line
1.7 KiB
JSON
1 line
1.7 KiB
JSON
[{"user_id": 1822, "stars": [{"date_created": 1302702813.8203671, "user_id": 4581}], "topic_id": 19200, "date_created": 1302702294.392684, "message": "or I did it in the ORM by doing a .values_list('duped_field', 'id') and doing the check in python because I knew I could afford to do it in memory", "group_id": 81, "id": 665149}, {"user_id": 1822, "stars": [], "topic_id": 19200, "date_created": 1302702201.2877009, "message": "say you have a field on a model that was not constrained as unique, you later decided to do so, and you needed to clean your data of dupe values", "group_id": 81, "id": 665131}, {"user_id": 1822, "stars": [{"date_created": 1302753666.7767279, "user_id": 28282}], "topic_id": 19200, "date_created": 1302702239.335567, "message": "is there a way to do that from the ORM? This is mostly a curiosity - as it is maintenance it can be done in SQL like:\n\nSELECT id\nFROM table \nWHERE tablefield IN ( \n SELECT tablefield\n FROM table \n GROUP BY tablefield \n HAVING (COUNT(tablefield ) > 1) \n)", "group_id": 81, "id": 665140}, {"user_id": 4581, "stars": [], "topic_id": 19200, "date_created": 1302702833.0080199, "message": "@ptone The few times I've needed to do this, I too just did it in python.", "group_id": 81, "id": 665226}, {"user_id": 1398, "stars": [], "topic_id": 19200, "date_created": 1302728619.845119, "message": "@ptone - check out https://github.com/cartwheelweb/packaginator/blob/master/apps/grid/management/commands/fix_grid_element.py", "group_id": 81, "id": 671828}, {"user_id": 20278, "stars": [], "topic_id": 19200, "date_created": 1302794472.4613431, "message": "maybe this helps: http://stackoverflow.com/questions/327807/django-equivalent-for-count-and-group-by", "group_id": 81, "id": 686250}] |