Created
June 5, 2012 15:27
-
-
Save dstufft/2875669 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# FBV | |
def dosomething(request): | |
# 6 lines of setup | |
if request.METHOD == "POST": | |
# 12 lines of Post Specific | |
pass | |
else: | |
# 12 lines of get specific | |
pass | |
# 12 lines of either method | |
pass | |
# CBV | |
class MyView(View): | |
def post(request): | |
self.setup() | |
# 12 lines of Post specific | |
self.generic() | |
def get(request): | |
self.setup() | |
# 12 lines of get specific | |
self.generic() | |
def setup(): | |
# 6 lines of setup | |
pass | |
def genericcrap(): | |
# 12 lines of generic | |
pass |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment