Conjunto fa1fdaf en sapic


Ignorar:
Fecha y hora:
14/08/2017 08:52:49 (hace 7 años)
Autor:
Erwin Paredes <eparedes@…>
Branches:
master, erwin, explicacion_situacional, gestion_usuarios, taller_django
Children:
9b2d259
Parents:
def38c0
Mensaje:

actualizacion del curso django

Ubicación:
curso_django
Ficheros:
6 editados

Leyenda

No modificado
Añadido
Eliminado
  • curso_django/curso_django.aux

    r90130ad rfa1fdaf  
    123123\@writefile{nav}{\headcommand {\slideentry {2}{11}{1}{30/30}{Listar Registros}{0}}}
    124124\@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}}}
    128126\@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}}}
    132128\@writefile{nav}{\headcommand {\beamer@framepages {32}{32}}}
    133 \@writefile{toc}{\beamer@subsectionintoc {2}{14}{View's}{33}{0}{2}}
    134 \@writefile{nav}{\headcommand {\beamer@subsectionentry {0}{2}{14}{33}{View's}}\headcommand {\beamer@subsectionpages {32}{32}}}
    135 \@writefile{nav}{\headcommand {\slideentry {2}{14}{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}}}
    136132\@writefile{nav}{\headcommand {\beamer@framepages {33}{33}}}
    137 \@writefile{toc}{\beamer@subsectionintoc {2}{15}{Crear Login}{34}{0}{2}}
    138 \@writefile{nav}{\headcommand {\beamer@subsectionentry {0}{2}{15}{34}{Crear Login}}\headcommand {\beamer@subsectionpages {33}{33}}}
    139 \@writefile{nav}{\headcommand {\slideentry {2}{15}{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}}}
    140136\@writefile{nav}{\headcommand {\beamer@framepages {34}{34}}}
    141 \@writefile{toc}{\beamer@subsectionintoc {2}{16}{Registro de Usuarios}{35}{0}{2}}
    142 \@writefile{nav}{\headcommand {\beamer@subsectionentry {0}{2}{16}{35}{Registro de Usuarios}}\headcommand {\beamer@subsectionpages {34}{34}}}
    143 \@writefile{nav}{\headcommand {\slideentry {2}{16}{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}}}
    144140\@writefile{nav}{\headcommand {\beamer@framepages {35}{35}}}
    145 \@writefile{toc}{\beamer@subsectionintoc {2}{17}{Login required}{36}{0}{2}}
    146 \@writefile{nav}{\headcommand {\beamer@subsectionentry {0}{2}{17}{36}{Login required}}\headcommand {\beamer@subsectionpages {35}{35}}}
    147 \@writefile{nav}{\headcommand {\slideentry {2}{17}{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}}}
    148144\@writefile{nav}{\headcommand {\beamer@framepages {36}{36}}}
    149 \@writefile{toc}{\beamer@subsectionintoc {2}{18}{Recuperar contrase\IeC {\~n}a por correo}{37}{0}{2}}
    150 \@writefile{nav}{\headcommand {\beamer@subsectionentry {0}{2}{18}{37}{Recuperar contrase\IeC {\~n}a por correo}}\headcommand {\beamer@subsectionpages {36}{36}}}
    151 \@writefile{nav}{\headcommand {\slideentry {2}{18}{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}}}
    152148\@writefile{nav}{\headcommand {\beamer@framepages {37}{37}}}
    153 \@writefile{toc}{\beamer@subsectionintoc {2}{19}{Conceptos avanzados}{38}{0}{2}}
    154 \@writefile{nav}{\headcommand {\beamer@subsectionentry {0}{2}{19}{38}{Conceptos avanzados}}\headcommand {\beamer@subsectionpages {37}{37}}}
    155 \@writefile{nav}{\headcommand {\slideentry {2}{19}{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}}}
    156152\@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  
    8080\headcommand {\slideentry {2}{11}{1}{30/30}{Listar Registros}{0}}
    8181\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}}
    8483\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}}
    8785\headcommand {\beamer@framepages {32}{32}}
    88 \headcommand {\beamer@subsectionentry {0}{2}{14}{33}{View's}}\headcommand {\beamer@subsectionpages {32}{32}}
    89 \headcommand {\slideentry {2}{14}{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}}
    9088\headcommand {\beamer@framepages {33}{33}}
    91 \headcommand {\beamer@subsectionentry {0}{2}{15}{34}{Crear Login}}\headcommand {\beamer@subsectionpages {33}{33}}
    92 \headcommand {\slideentry {2}{15}{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}}
    9391\headcommand {\beamer@framepages {34}{34}}
    94 \headcommand {\beamer@subsectionentry {0}{2}{16}{35}{Registro de Usuarios}}\headcommand {\beamer@subsectionpages {34}{34}}
    95 \headcommand {\slideentry {2}{16}{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}}
    9694\headcommand {\beamer@framepages {35}{35}}
    97 \headcommand {\beamer@subsectionentry {0}{2}{17}{36}{Login required}}\headcommand {\beamer@subsectionpages {35}{35}}
    98 \headcommand {\slideentry {2}{17}{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}}
    9997\headcommand {\beamer@framepages {36}{36}}
    100 \headcommand {\beamer@subsectionentry {0}{2}{18}{37}{Recuperar contrase\IeC {\~n}a por correo}}\headcommand {\beamer@subsectionpages {36}{36}}
    101 \headcommand {\slideentry {2}{18}{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}}
    102100\headcommand {\beamer@framepages {37}{37}}
    103 \headcommand {\beamer@subsectionentry {0}{2}{19}{38}{Conceptos avanzados}}\headcommand {\beamer@subsectionpages {37}{37}}
    104 \headcommand {\slideentry {2}{19}{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}}
    105103\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  
    1515\BOOKMARK [3][]{Outline0.2.10.29}{Configurar est\341ticos}{Outline0.2}% 15
    1616\BOOKMARK [3][]{Outline0.2.11.30}{Listar Registros}{Outline0.2}% 16
    17 \BOOKMARK [3][]{Outline0.2.12.31}{Anexar registros}{Outline0.2}% 17
    18 \BOOKMARK [3][]{Outline0.2.13.32}{Modificar y eliminar registros}{Outline0.2}% 18
    19 \BOOKMARK [3][]{Outline0.2.14.33}{View's}{Outline0.2}% 19
    20 \BOOKMARK [3][]{Outline0.2.15.34}{Crear Login}{Outline0.2}% 20
    21 \BOOKMARK [3][]{Outline0.2.16.35}{Registro de Usuarios}{Outline0.2}% 21
    22 \BOOKMARK [3][]{Outline0.2.17.36}{Login required}{Outline0.2}% 22
    23 \BOOKMARK [3][]{Outline0.2.18.37}{Recuperar contrase\361a por correo}{Outline0.2}% 23
    24 \BOOKMARK [3][]{Outline0.2.19.38}{Conceptos avanzados}{Outline0.2}% 24
     17\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  
    598598\begin{frame}[fragile]
    599599\begin{verbatim}
     600Descargar plantillas prediseñadas, por ejemplo:
     601
     602https://adminlte.io/
     603
     604Copiar los directorios ccs y js en los en la carpeta static
     605
     606Copiar los archivo *.html en la carpeta templates
     607
     608Editar index.html y cambiar los enlaces a cada archivo en:
     609
     610<link rel="stylesheet"
     611href="{% static 'css/DataTables/jquery.dataTables.min.css' %}">
    600612
    601613\end{verbatim}
     
    605617\begin{frame}[fragile]
    606618\begin{verbatim}
    607 
     619Creamos el archivo ajax.py
     620
     621# -*- encoding: utf-8 -*-
     622from django.conf import settings
     623from django_datatables_view.base_datatable_view import (
     624   BaseDatatableView)
     625   
     626from django.contrib.auth.models import (
     627    User)
     628
     629class 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}
     647def 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
     662from .ajax import *
     663
     664urlpatterns = [
     665    ....
     666url(r'^listar-users/$', ListUsersAjaxView.as_view(),
     667        name="listar_users"),
     668\end{verbatim}
     669\end{frame}
     670
     671\begin{frame}[fragile]
     672\begin{verbatim}
     673Se anexa el siguiente código el archivo index.html
     674En la parte visual:
     675
     676<div id="datatable"></div>
     677
     678Y 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>
    608693\end{verbatim}
    609694\end{frame}
     
    612697\begin{frame}[fragile]
    613698\begin{verbatim}
    614 
     699Creamos el método en el archivo views.py
     700
     701def 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       
    615712\end{verbatim}
    616713\end{frame}
  • curso_django/curso_django.toc

    r90130ad rfa1fdaf  
    1717\beamer@subsectionintoc {2}{10}{Configurar est\IeC {\'a}ticos}{29}{0}{2}
    1818\beamer@subsectionintoc {2}{11}{Listar Registros}{30}{0}{2}
    19 \beamer@subsectionintoc {2}{12}{Anexar registros}{31}{0}{2}
    20 \beamer@subsectionintoc {2}{13}{Modificar y eliminar registros}{32}{0}{2}
    21 \beamer@subsectionintoc {2}{14}{View's}{33}{0}{2}
    22 \beamer@subsectionintoc {2}{15}{Crear Login}{34}{0}{2}
    23 \beamer@subsectionintoc {2}{16}{Registro de Usuarios}{35}{0}{2}
    24 \beamer@subsectionintoc {2}{17}{Login required}{36}{0}{2}
    25 \beamer@subsectionintoc {2}{18}{Recuperar contrase\IeC {\~n}a por correo}{37}{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.