Conjunto fa1fdaf en sapic
- Fecha y hora:
- 14/08/2017 08:52:49 (hace 7 años)
- Branches:
- master, erwin, explicacion_situacional, gestion_usuarios, taller_django
- Children:
- 9b2d259
- Parents:
- def38c0
- Ubicación:
- curso_django
- Ficheros:
-
- 6 editados
Leyenda
- No modificado
- Añadido
- Eliminado
-
curso_django/curso_django.aux
r90130ad rfa1fdaf 123 123 \@writefile{nav}{\headcommand {\slideentry {2}{11}{1}{30/30}{Listar Registros}{0}}} 124 124 \@writefile{nav}{\headcommand {\beamer@framepages {30}{30}}} 125 \@writefile{toc}{\beamer@subsectionintoc {2}{12}{Anexar registros}{31}{0}{2}} 126 \@writefile{nav}{\headcommand {\beamer@subsectionentry {0}{2}{12}{31}{Anexar registros}}\headcommand {\beamer@subsectionpages {30}{30}}} 127 \@writefile{nav}{\headcommand {\slideentry {2}{12}{1}{31/31}{Anexar registros}{0}}} 125 \@writefile{nav}{\headcommand {\slideentry {2}{11}{2}{31/31}{Listar Registros}{0}}} 128 126 \@writefile{nav}{\headcommand {\beamer@framepages {31}{31}}} 129 \@writefile{toc}{\beamer@subsectionintoc {2}{13}{Modificar y eliminar registros}{32}{0}{2}} 130 \@writefile{nav}{\headcommand {\beamer@subsectionentry {0}{2}{13}{32}{Modificar y eliminar registros}}\headcommand {\beamer@subsectionpages {31}{31}}} 131 \@writefile{nav}{\headcommand {\slideentry {2}{13}{1}{32/32}{Modificar y eliminar registros}{0}}} 127 \@writefile{nav}{\headcommand {\slideentry {2}{11}{3}{32/32}{Listar Registros}{0}}} 132 128 \@writefile{nav}{\headcommand {\beamer@framepages {32}{32}}} 133 \@writefile{toc}{\beamer@subsectionintoc {2}{1 4}{View's}{33}{0}{2}}134 \@writefile{nav}{\headcommand {\beamer@subsectionentry {0}{2}{1 4}{33}{View's}}\headcommand {\beamer@subsectionpages {32}{32}}}135 \@writefile{nav}{\headcommand {\slideentry {2}{1 4}{1}{33/33}{View's}{0}}}129 \@writefile{toc}{\beamer@subsectionintoc {2}{12}{Anexar registros}{33}{0}{2}} 130 \@writefile{nav}{\headcommand {\beamer@subsectionentry {0}{2}{12}{33}{Anexar registros}}\headcommand {\beamer@subsectionpages {30}{32}}} 131 \@writefile{nav}{\headcommand {\slideentry {2}{12}{1}{33/33}{Anexar registros}{0}}} 136 132 \@writefile{nav}{\headcommand {\beamer@framepages {33}{33}}} 137 \@writefile{toc}{\beamer@subsectionintoc {2}{1 5}{Crear Login}{34}{0}{2}}138 \@writefile{nav}{\headcommand {\beamer@subsectionentry {0}{2}{1 5}{34}{Crear Login}}\headcommand {\beamer@subsectionpages {33}{33}}}139 \@writefile{nav}{\headcommand {\slideentry {2}{1 5}{1}{34/34}{Crear Login}{0}}}133 \@writefile{toc}{\beamer@subsectionintoc {2}{13}{Modificar y eliminar registros}{34}{0}{2}} 134 \@writefile{nav}{\headcommand {\beamer@subsectionentry {0}{2}{13}{34}{Modificar y eliminar registros}}\headcommand {\beamer@subsectionpages {33}{33}}} 135 \@writefile{nav}{\headcommand {\slideentry {2}{13}{1}{34/34}{Modificar y eliminar registros}{0}}} 140 136 \@writefile{nav}{\headcommand {\beamer@framepages {34}{34}}} 141 \@writefile{toc}{\beamer@subsectionintoc {2}{1 6}{Registro de Usuarios}{35}{0}{2}}142 \@writefile{nav}{\headcommand {\beamer@subsectionentry {0}{2}{1 6}{35}{Registro de Usuarios}}\headcommand {\beamer@subsectionpages {34}{34}}}143 \@writefile{nav}{\headcommand {\slideentry {2}{1 6}{1}{35/35}{Registro de Usuarios}{0}}}137 \@writefile{toc}{\beamer@subsectionintoc {2}{14}{View's}{35}{0}{2}} 138 \@writefile{nav}{\headcommand {\beamer@subsectionentry {0}{2}{14}{35}{View's}}\headcommand {\beamer@subsectionpages {34}{34}}} 139 \@writefile{nav}{\headcommand {\slideentry {2}{14}{1}{35/35}{View's}{0}}} 144 140 \@writefile{nav}{\headcommand {\beamer@framepages {35}{35}}} 145 \@writefile{toc}{\beamer@subsectionintoc {2}{1 7}{Login required}{36}{0}{2}}146 \@writefile{nav}{\headcommand {\beamer@subsectionentry {0}{2}{1 7}{36}{Login required}}\headcommand {\beamer@subsectionpages {35}{35}}}147 \@writefile{nav}{\headcommand {\slideentry {2}{1 7}{1}{36/36}{Login required}{0}}}141 \@writefile{toc}{\beamer@subsectionintoc {2}{15}{Crear Login}{36}{0}{2}} 142 \@writefile{nav}{\headcommand {\beamer@subsectionentry {0}{2}{15}{36}{Crear Login}}\headcommand {\beamer@subsectionpages {35}{35}}} 143 \@writefile{nav}{\headcommand {\slideentry {2}{15}{1}{36/36}{Crear Login}{0}}} 148 144 \@writefile{nav}{\headcommand {\beamer@framepages {36}{36}}} 149 \@writefile{toc}{\beamer@subsectionintoc {2}{1 8}{Recuperar contrase\IeC {\~n}a por correo}{37}{0}{2}}150 \@writefile{nav}{\headcommand {\beamer@subsectionentry {0}{2}{1 8}{37}{Recuperar contrase\IeC {\~n}a por correo}}\headcommand {\beamer@subsectionpages {36}{36}}}151 \@writefile{nav}{\headcommand {\slideentry {2}{1 8}{1}{37/37}{Recuperar contrase\IeC {\~n}a por correo}{0}}}145 \@writefile{toc}{\beamer@subsectionintoc {2}{16}{Registro de Usuarios}{37}{0}{2}} 146 \@writefile{nav}{\headcommand {\beamer@subsectionentry {0}{2}{16}{37}{Registro de Usuarios}}\headcommand {\beamer@subsectionpages {36}{36}}} 147 \@writefile{nav}{\headcommand {\slideentry {2}{16}{1}{37/37}{Registro de Usuarios}{0}}} 152 148 \@writefile{nav}{\headcommand {\beamer@framepages {37}{37}}} 153 \@writefile{toc}{\beamer@subsectionintoc {2}{1 9}{Conceptos avanzados}{38}{0}{2}}154 \@writefile{nav}{\headcommand {\beamer@subsectionentry {0}{2}{1 9}{38}{Conceptos avanzados}}\headcommand {\beamer@subsectionpages {37}{37}}}155 \@writefile{nav}{\headcommand {\slideentry {2}{1 9}{1}{38/38}{Conceptos avanzados}{0}}}149 \@writefile{toc}{\beamer@subsectionintoc {2}{17}{Login required}{38}{0}{2}} 150 \@writefile{nav}{\headcommand {\beamer@subsectionentry {0}{2}{17}{38}{Login required}}\headcommand {\beamer@subsectionpages {37}{37}}} 151 \@writefile{nav}{\headcommand {\slideentry {2}{17}{1}{38/38}{Login required}{0}}} 156 152 \@writefile{nav}{\headcommand {\beamer@framepages {38}{38}}} 157 \@writefile{nav}{\headcommand {\beamer@partpages {1}{38}}} 158 \@writefile{nav}{\headcommand {\beamer@subsectionpages {38}{38}}} 159 \@writefile{nav}{\headcommand {\beamer@sectionpages {6}{38}}} 160 \@writefile{nav}{\headcommand {\beamer@documentpages {38}}} 161 \@writefile{nav}{\headcommand {\def \inserttotalframenumber {38}}} 153 \@writefile{toc}{\beamer@subsectionintoc {2}{18}{Recuperar contrase\IeC {\~n}a por correo}{39}{0}{2}} 154 \@writefile{nav}{\headcommand {\beamer@subsectionentry {0}{2}{18}{39}{Recuperar contrase\IeC {\~n}a por correo}}\headcommand {\beamer@subsectionpages {38}{38}}} 155 \@writefile{nav}{\headcommand {\slideentry {2}{18}{1}{39/39}{Recuperar contrase\IeC {\~n}a por correo}{0}}} 156 \@writefile{nav}{\headcommand {\beamer@framepages {39}{39}}} 157 \@writefile{toc}{\beamer@subsectionintoc {2}{19}{Conceptos avanzados}{40}{0}{2}} 158 \@writefile{nav}{\headcommand {\beamer@subsectionentry {0}{2}{19}{40}{Conceptos avanzados}}\headcommand {\beamer@subsectionpages {39}{39}}} 159 \@writefile{nav}{\headcommand {\slideentry {2}{19}{1}{40/40}{Conceptos avanzados}{0}}} 160 \@writefile{nav}{\headcommand {\beamer@framepages {40}{40}}} 161 \@writefile{nav}{\headcommand {\beamer@partpages {1}{40}}} 162 \@writefile{nav}{\headcommand {\beamer@subsectionpages {40}{40}}} 163 \@writefile{nav}{\headcommand {\beamer@sectionpages {6}{40}}} 164 \@writefile{nav}{\headcommand {\beamer@documentpages {40}}} 165 \@writefile{nav}{\headcommand {\def \inserttotalframenumber {40}}} -
curso_django/curso_django.nav
r90130ad rfa1fdaf 80 80 \headcommand {\slideentry {2}{11}{1}{30/30}{Listar Registros}{0}} 81 81 \headcommand {\beamer@framepages {30}{30}} 82 \headcommand {\beamer@subsectionentry {0}{2}{12}{31}{Anexar registros}}\headcommand {\beamer@subsectionpages {30}{30}} 83 \headcommand {\slideentry {2}{12}{1}{31/31}{Anexar registros}{0}} 82 \headcommand {\slideentry {2}{11}{2}{31/31}{Listar Registros}{0}} 84 83 \headcommand {\beamer@framepages {31}{31}} 85 \headcommand {\beamer@subsectionentry {0}{2}{13}{32}{Modificar y eliminar registros}}\headcommand {\beamer@subsectionpages {31}{31}} 86 \headcommand {\slideentry {2}{13}{1}{32/32}{Modificar y eliminar registros}{0}} 84 \headcommand {\slideentry {2}{11}{3}{32/32}{Listar Registros}{0}} 87 85 \headcommand {\beamer@framepages {32}{32}} 88 \headcommand {\beamer@subsectionentry {0}{2}{1 4}{33}{View's}}\headcommand {\beamer@subsectionpages {32}{32}}89 \headcommand {\slideentry {2}{1 4}{1}{33/33}{View's}{0}}86 \headcommand {\beamer@subsectionentry {0}{2}{12}{33}{Anexar registros}}\headcommand {\beamer@subsectionpages {30}{32}} 87 \headcommand {\slideentry {2}{12}{1}{33/33}{Anexar registros}{0}} 90 88 \headcommand {\beamer@framepages {33}{33}} 91 \headcommand {\beamer@subsectionentry {0}{2}{1 5}{34}{Crear Login}}\headcommand {\beamer@subsectionpages {33}{33}}92 \headcommand {\slideentry {2}{1 5}{1}{34/34}{Crear Login}{0}}89 \headcommand {\beamer@subsectionentry {0}{2}{13}{34}{Modificar y eliminar registros}}\headcommand {\beamer@subsectionpages {33}{33}} 90 \headcommand {\slideentry {2}{13}{1}{34/34}{Modificar y eliminar registros}{0}} 93 91 \headcommand {\beamer@framepages {34}{34}} 94 \headcommand {\beamer@subsectionentry {0}{2}{1 6}{35}{Registro de Usuarios}}\headcommand {\beamer@subsectionpages {34}{34}}95 \headcommand {\slideentry {2}{1 6}{1}{35/35}{Registro de Usuarios}{0}}92 \headcommand {\beamer@subsectionentry {0}{2}{14}{35}{View's}}\headcommand {\beamer@subsectionpages {34}{34}} 93 \headcommand {\slideentry {2}{14}{1}{35/35}{View's}{0}} 96 94 \headcommand {\beamer@framepages {35}{35}} 97 \headcommand {\beamer@subsectionentry {0}{2}{1 7}{36}{Login required}}\headcommand {\beamer@subsectionpages {35}{35}}98 \headcommand {\slideentry {2}{1 7}{1}{36/36}{Login required}{0}}95 \headcommand {\beamer@subsectionentry {0}{2}{15}{36}{Crear Login}}\headcommand {\beamer@subsectionpages {35}{35}} 96 \headcommand {\slideentry {2}{15}{1}{36/36}{Crear Login}{0}} 99 97 \headcommand {\beamer@framepages {36}{36}} 100 \headcommand {\beamer@subsectionentry {0}{2}{1 8}{37}{Recuperar contrase\IeC {\~n}a por correo}}\headcommand {\beamer@subsectionpages {36}{36}}101 \headcommand {\slideentry {2}{1 8}{1}{37/37}{Recuperar contrase\IeC {\~n}a por correo}{0}}98 \headcommand {\beamer@subsectionentry {0}{2}{16}{37}{Registro de Usuarios}}\headcommand {\beamer@subsectionpages {36}{36}} 99 \headcommand {\slideentry {2}{16}{1}{37/37}{Registro de Usuarios}{0}} 102 100 \headcommand {\beamer@framepages {37}{37}} 103 \headcommand {\beamer@subsectionentry {0}{2}{1 9}{38}{Conceptos avanzados}}\headcommand {\beamer@subsectionpages {37}{37}}104 \headcommand {\slideentry {2}{1 9}{1}{38/38}{Conceptos avanzados}{0}}101 \headcommand {\beamer@subsectionentry {0}{2}{17}{38}{Login required}}\headcommand {\beamer@subsectionpages {37}{37}} 102 \headcommand {\slideentry {2}{17}{1}{38/38}{Login required}{0}} 105 103 \headcommand {\beamer@framepages {38}{38}} 106 \headcommand {\beamer@partpages {1}{38}} 107 \headcommand {\beamer@subsectionpages {38}{38}} 108 \headcommand {\beamer@sectionpages {6}{38}} 109 \headcommand {\beamer@documentpages {38}} 110 \headcommand {\def \inserttotalframenumber {38}} 104 \headcommand {\beamer@subsectionentry {0}{2}{18}{39}{Recuperar contrase\IeC {\~n}a por correo}}\headcommand {\beamer@subsectionpages {38}{38}} 105 \headcommand {\slideentry {2}{18}{1}{39/39}{Recuperar contrase\IeC {\~n}a por correo}{0}} 106 \headcommand {\beamer@framepages {39}{39}} 107 \headcommand {\beamer@subsectionentry {0}{2}{19}{40}{Conceptos avanzados}}\headcommand {\beamer@subsectionpages {39}{39}} 108 \headcommand {\slideentry {2}{19}{1}{40/40}{Conceptos avanzados}{0}} 109 \headcommand {\beamer@framepages {40}{40}} 110 \headcommand {\beamer@partpages {1}{40}} 111 \headcommand {\beamer@subsectionpages {40}{40}} 112 \headcommand {\beamer@sectionpages {6}{40}} 113 \headcommand {\beamer@documentpages {40}} 114 \headcommand {\def \inserttotalframenumber {40}} -
curso_django/curso_django.out
r90130ad rfa1fdaf 15 15 \BOOKMARK [3][]{Outline0.2.10.29}{Configurar est\341ticos}{Outline0.2}% 15 16 16 \BOOKMARK [3][]{Outline0.2.11.30}{Listar Registros}{Outline0.2}% 16 17 \BOOKMARK [3][]{Outline0.2.12.3 1}{Anexar registros}{Outline0.2}% 1718 \BOOKMARK [3][]{Outline0.2.13.3 2}{Modificar y eliminar registros}{Outline0.2}% 1819 \BOOKMARK [3][]{Outline0.2.14.3 3}{View's}{Outline0.2}% 1920 \BOOKMARK [3][]{Outline0.2.15.3 4}{Crear Login}{Outline0.2}% 2021 \BOOKMARK [3][]{Outline0.2.16.3 5}{Registro de Usuarios}{Outline0.2}% 2122 \BOOKMARK [3][]{Outline0.2.17.3 6}{Login required}{Outline0.2}% 2223 \BOOKMARK [3][]{Outline0.2.18.3 7}{Recuperar contrase\361a por correo}{Outline0.2}% 2324 \BOOKMARK [3][]{Outline0.2.19. 38}{Conceptos avanzados}{Outline0.2}% 2417 \BOOKMARK [3][]{Outline0.2.12.33}{Anexar registros}{Outline0.2}% 17 18 \BOOKMARK [3][]{Outline0.2.13.34}{Modificar y eliminar registros}{Outline0.2}% 18 19 \BOOKMARK [3][]{Outline0.2.14.35}{View's}{Outline0.2}% 19 20 \BOOKMARK [3][]{Outline0.2.15.36}{Crear Login}{Outline0.2}% 20 21 \BOOKMARK [3][]{Outline0.2.16.37}{Registro de Usuarios}{Outline0.2}% 21 22 \BOOKMARK [3][]{Outline0.2.17.38}{Login required}{Outline0.2}% 22 23 \BOOKMARK [3][]{Outline0.2.18.39}{Recuperar contrase\361a por correo}{Outline0.2}% 23 24 \BOOKMARK [3][]{Outline0.2.19.40}{Conceptos avanzados}{Outline0.2}% 24 -
curso_django/curso_django.tex
r90130ad rfa1fdaf 598 598 \begin{frame}[fragile] 599 599 \begin{verbatim} 600 Descargar plantillas prediseñadas, por ejemplo: 601 602 https://adminlte.io/ 603 604 Copiar los directorios ccs y js en los en la carpeta static 605 606 Copiar los archivo *.html en la carpeta templates 607 608 Editar index.html y cambiar los enlaces a cada archivo en: 609 610 <link rel="stylesheet" 611 href="{% static 'css/DataTables/jquery.dataTables.min.css' %}"> 600 612 601 613 \end{verbatim} … … 605 617 \begin{frame}[fragile] 606 618 \begin{verbatim} 607 619 Creamos el archivo ajax.py 620 621 # -*- encoding: utf-8 -*- 622 from django.conf import settings 623 from django_datatables_view.base_datatable_view import ( 624 BaseDatatableView) 625 626 from django.contrib.auth.models import ( 627 User) 628 629 class ListUsersAjaxView(BaseDatatableView): 630 model = User 631 columns = ['pk','first_name','last_name','username','email', 632 'date_joined', 'last_joined' ] 633 order_columns = ['pk', 'username'] 634 max_display_length = 500 635 636 def __init__(self): 637 super(ListUsersAjaxView, self).__init__() 638 639 def get_initial_queryset(self): 640 return self.model.objects.all() 641 642 \end{verbatim} 643 \end{frame} 644 645 \begin{frame}[fragile] 646 \begin{verbatim} 647 def prepare_results(self, qs): 648 json_data = [] 649 for item in qs: 650 json_data.append([ 651 username, 652 "{0} {1}".format(str(item.first_name),str(item.last_name)), 653 item.email, 654 item.date_joined.strftime("%Y-%m-%d %H:%M:%S"), 655 last_login 656 ]) 657 658 return json_data 659 # Fin del archivo ajax.py 660 661 #En el archivo urls.py anexar las siguientes lineas 662 from .ajax import * 663 664 urlpatterns = [ 665 .... 666 url(r'^listar-users/$', ListUsersAjaxView.as_view(), 667 name="listar_users"), 668 \end{verbatim} 669 \end{frame} 670 671 \begin{frame}[fragile] 672 \begin{verbatim} 673 Se anexa el siguiente código el archivo index.html 674 En la parte visual: 675 676 <div id="datatable"></div> 677 678 Y en la parte de código javascript 679 680 <script type="text/javascript"> 681 $(document).ready(function() { 682 $('#datatable').dataTable({ 683 "processing": true, 684 "serverSide": true, 685 "ajax": {% url 'listar_user'%}, 686 language: {url: JSON_DATA} 687 }); 688 $('#datatable') 689 .removeClass('display') 690 .addClass('table table-striped table-bordered'); 691 }); 692 </script> 608 693 \end{verbatim} 609 694 \end{frame} … … 612 697 \begin{frame}[fragile] 613 698 \begin{verbatim} 614 699 Creamos el método en el archivo views.py 700 701 def AnexarRegistro(request): 702 if request.method == 'POST': 703 704 vusername = request.POST['username'] 705 u = User(username = vusername) 706 u.save() 707 message = _("El usuario fue creado") 708 template = loader.get_template('personal/profile.html') 709 context = {'message':message} 710 return HttpResponse(template.render(context, request)) 711 615 712 \end{verbatim} 616 713 \end{frame} -
curso_django/curso_django.toc
r90130ad rfa1fdaf 17 17 \beamer@subsectionintoc {2}{10}{Configurar est\IeC {\'a}ticos}{29}{0}{2} 18 18 \beamer@subsectionintoc {2}{11}{Listar Registros}{30}{0}{2} 19 \beamer@subsectionintoc {2}{12}{Anexar registros}{3 1}{0}{2}20 \beamer@subsectionintoc {2}{13}{Modificar y eliminar registros}{3 2}{0}{2}21 \beamer@subsectionintoc {2}{14}{View's}{3 3}{0}{2}22 \beamer@subsectionintoc {2}{15}{Crear Login}{3 4}{0}{2}23 \beamer@subsectionintoc {2}{16}{Registro de Usuarios}{3 5}{0}{2}24 \beamer@subsectionintoc {2}{17}{Login required}{3 6}{0}{2}25 \beamer@subsectionintoc {2}{18}{Recuperar contrase\IeC {\~n}a por correo}{3 7}{0}{2}26 \beamer@subsectionintoc {2}{19}{Conceptos avanzados}{ 38}{0}{2}19 \beamer@subsectionintoc {2}{12}{Anexar registros}{33}{0}{2} 20 \beamer@subsectionintoc {2}{13}{Modificar y eliminar registros}{34}{0}{2} 21 \beamer@subsectionintoc {2}{14}{View's}{35}{0}{2} 22 \beamer@subsectionintoc {2}{15}{Crear Login}{36}{0}{2} 23 \beamer@subsectionintoc {2}{16}{Registro de Usuarios}{37}{0}{2} 24 \beamer@subsectionintoc {2}{17}{Login required}{38}{0}{2} 25 \beamer@subsectionintoc {2}{18}{Recuperar contrase\IeC {\~n}a por correo}{39}{0}{2} 26 \beamer@subsectionintoc {2}{19}{Conceptos avanzados}{40}{0}{2}
Nota: Vea TracChangeset
para ayuda en el uso del visor de conjuntos de cambios.