[bf47591] | 1 | from django.shortcuts import render |
---|
[248b1b4] | 2 | from django.views.generic import ListView, FormView |
---|
[8fa24c3] | 3 | from multi_form_view import MultiModelFormView |
---|
[bf47591] | 4 | |
---|
[8fa24c3] | 5 | from .forms import * |
---|
| 6 | from participantes.forms import ( |
---|
| 7 | FormsetParticipanteEvento |
---|
| 8 | ) |
---|
[66158c7] | 9 | from .models import Evento |
---|
[8fa24c3] | 10 | |
---|
| 11 | class RegisterEvent(MultiModelFormView): |
---|
| 12 | """! |
---|
| 13 | Muestra el formulario de registro de usuarios |
---|
| 14 | |
---|
| 15 | @author Ing. Leonel P. Hernandez M. (lhernandez at cenditel.gob.ve) |
---|
[5dea5ff] | 16 | @copyright <a href='https://www.gnu.org/licenses/gpl-3.0.en.html'>GNU Public License versión 3 (GPLv3)</a> |
---|
[8fa24c3] | 17 | @date 20-11-2017 |
---|
| 18 | @version 1.0.0 |
---|
| 19 | """ |
---|
| 20 | template_name = "register.event.html" |
---|
| 21 | form_classes = { |
---|
| 22 | 'event': EventoForm, |
---|
| 23 | 'participante': FormsetParticipanteEvento, |
---|
| 24 | } |
---|
| 25 | #success_url = reverse_lazy('users:home') |
---|
| 26 | record_id=None |
---|
[66158c7] | 27 | |
---|
| 28 | |
---|
| 29 | class ListEvent(ListView): |
---|
| 30 | """! |
---|
| 31 | Muestra el listado de eventos |
---|
| 32 | |
---|
| 33 | @author Rodrigo Boet (rboet at cenditel.gob.ve) |
---|
[5dea5ff] | 34 | @copyright <a href='https://www.gnu.org/licenses/gpl-3.0.en.html'>GNU Public License versión 3 (GPLv3)</a> |
---|
[66158c7] | 35 | @date 20-11-2017 |
---|
| 36 | @version 1.0.0 |
---|
| 37 | """ |
---|
| 38 | model = Evento |
---|
| 39 | template_name = "evento.list.html" |
---|
[248b1b4] | 40 | paginate_by = 5 |
---|
| 41 | |
---|
| 42 | class SignEvent(FormView): |
---|
| 43 | """! |
---|
| 44 | Muestra el formulario para buscar y luego firmar documento |
---|
| 45 | |
---|
| 46 | @author Rodrigo Boet (rboet at cenditel.gob.ve) |
---|
[5dea5ff] | 47 | @copyright <a href='https://www.gnu.org/licenses/gpl-3.0.en.html'>GNU Public License versión 3 (GPLv3)</a> |
---|
[248b1b4] | 48 | @date 20-11-2017 |
---|
| 49 | @version 1.0.0 |
---|
| 50 | """ |
---|
| 51 | form_class = FirmaEventoForm |
---|
[ae65f8e] | 52 | template_name = "evento.firma.html" |
---|
| 53 | |
---|
| 54 | def get_context_data(self, **kwargs): |
---|
| 55 | """! |
---|
| 56 | Metodo que permite cargar de nuevo valores en los datos de contexto de la vista |
---|
| 57 | |
---|
| 58 | @author Rodrigo Boet (rboet at cenditel.gob.ve) |
---|
| 59 | @copyright GNU/GPLv3 |
---|
| 60 | @date 20-11-2017 |
---|
| 61 | @param self <b>{object}</b> Objeto que instancia la clase |
---|
| 62 | @param kwargs <b>{object}</b> Objeto que contiene los datos de contexto |
---|
| 63 | @return Retorna los datos de contexto |
---|
| 64 | """ |
---|
| 65 | kwargs['nombre_evento'] = Evento.objects.get(pk=int(self.kwargs['pk'])) |
---|
| 66 | return super(SignEvent, self).get_context_data(**kwargs) |
---|