Skip to main content
Search type Search syntax
Tags [tag]
Exact "words here"
Author user:1234
user:me (yours)
Score score:3 (3+)
score:0 (none)
Answers answers:3 (3+)
answers:0 (none)
isaccepted:yes
hasaccepted:no
inquestion:1234
Views views:250
Code code:"if (foo != bar)"
Sections title:apples
body:"apples oranges"
URL url:"*.example.com"
Saves in:saves
Status closed:yes
duplicate:no
migrated:no
wiki:no
Types is:question
is:answer
Exclude -[tag]
-apples
For more details on advanced search visit our help page
Results tagged with
Search options not deleted user 208145

Django is a Python-based framework for creating web applications.

0 votes
1 answer
203 views

django multiple if else refactor

I have a function with multiple if else statements that I'm trying to simplify in Django Is there a pattern or maybe a better modeling approach that I could use here? …
Laycoonz's user avatar
  • 123
1 vote

django multiple if else refactor

Well finally I ended up with the following, I changed some names to make it more explanatory and the function to respond to an ajax request. However the logic is pretty much the same: @login_required …
Laycoonz's user avatar
  • 123