Files
2012-02-21 01:15:00 -05:00

1 line
2.2 KiB
JSON

[{"user_id": 35994, "stars": [], "topic_id": 43391, "date_created": 1312608668.729095, "message": "Maybe this is a silly question but I want to ask it anyway to see if anyone else has had similar thoughts. I was wondering if there is a max length to views.py? At some point should I branch it off? Does it really matter to python? Doe it affect anything as far as the efficiency of processing views?", "group_id": 81, "id": 1808390}, {"user_id": 719, "stars": [{"date_created": 1312682136.642643, "user_id": 22109}], "topic_id": 43391, "date_created": 1312626453.018132, "message": "I doubt it. If it's a maintainability concern, you could create a directory based module (\"views/\" + __init__.py) and split it up.", "group_id": 81, "id": 1809045}, {"user_id": 37643, "stars": [], "topic_id": 43391, "date_created": 1312649042.75298, "message": "Our views.py was getting out of control and it didn't make sense to break it up into apps, so views/ + __init__.py was the approach we used. It's working well", "group_id": 81, "id": 1810192}, {"user_id": 1126, "stars": [{"date_created": 1312817312.706389, "user_id": 2588}], "topic_id": 43391, "date_created": 1312654743.5836329, "message": "It should be worth noting that your individual view functions/methods should be extremely lightweight. Seeing if the request is GET/POST, validate any data, passing data to forms or other objects, calling some model/manager/helper functions, and then returning the response based on the request headers (normal template, json, etc). Get in and get out; all the heavy lifting and business logic should be elsewhere.", "group_id": 81, "id": 1810678}, {"user_id": 1126, "stars": [], "topic_id": 43391, "date_created": 1312654820.811877, "message": "If my individual views are more than 20-30 lines apiece I really start examining them to make sure something can't be refactored", "group_id": 81, "id": 1810683}, {"user_id": 1736, "stars": [{"date_created": 1312817319.5932741, "user_id": 2588}], "topic_id": 43391, "date_created": 1312655561.4348681, "message": "Another thing to do when my views get big is to make them be callable classes, and pull common logic into a base class somewhere.", "group_id": 81, "id": 1810730}]