Created
September 3, 2012 05:08
-
-
Save fitoria/3606842 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
class AfiliacionNacionalCreateView(CreateView): | |
model = AfiliacionNacional | |
form_class = AfiliacionNacionalForm | |
success_url = reverse_lazy('afiliacionnacional-list') | |
def form_valid(self, form): | |
messages.info(self.request, 'Afiliacion creado', extra_tags='alert alert-success') | |
return super(AfiliacionNacionalCreateView, self).form_valid(form) | |
class AfiliacionNacionalDeleteView(DeleteView): | |
model = AfiliacionNacional | |
success_url = reverse_lazy('afiliacionnacional-list') | |
def post(self, *args, **kwargs): | |
messages.info(self.request, 'Afiliacion ha sido borrada', extra_tags='alert alert-success') | |
return super(AfiliacionNacionalDeleteView, self).post(*args, **kwargs) | |
class AfiliacionNacionalUpdateView(UpdateView): | |
model = AfiliacionNacional | |
form_class = AfiliacionNacionalForm | |
success_url = reverse_lazy('afiliacionnacional-list') | |
def form_valid(self, form): | |
messages.info(self.request, 'Afiliacion editada con éxito', extra_tags='alert alert-success') | |
return super(AfiliacionNacionalUpdateView, self).form_valid(form) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment