Skip to content

Instantly share code, notes, and snippets.

View luiscberrocal's full-sized avatar
👽
Happy since I left the circus...

Luis Carlos Berrocal luiscberrocal

👽
Happy since I left the circus...
View GitHub Profile
@luiscberrocal
luiscberrocal / crudviews
Last active October 25, 2018 21:55
Django Crud Views
class $MODEL$ListView(LoginRequiredMixin, ListView):
model = $MODEL$
context_object_name = '$context_object$_list'
def get_queryset(self):
return $MODEL$.objects.all()
class $MODEL$UpdateView(LoginRequiredMixin, UpdateView):
model = $MODEL$
context_object_name = '$context_object$'