Skip to content

Commit 3d4e246

Browse files
Complete
1 parent 1e77792 commit 3d4e246

File tree

18 files changed

+73
-41
lines changed

18 files changed

+73
-41
lines changed

Creando_nuestro_primer_listado_en_django/.idea/workspace.xml

+12-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Binary file not shown.
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,27 @@
1-
{% extends 'body.html'%}
1+
{% extends 'list.html'%}
2+
3+
{% block columns %}
4+
<tr>
5+
<th scope="col">Numero</th>
6+
<th scope="col">Nombre</th>
7+
<th scope="col">Opciones</th>
8+
</tr>
9+
{% endblock %}
10+
11+
{% block row %}
12+
{% for c in categorias %}
13+
<tr>
14+
<td> {{ c.id }}</td>
15+
16+
<td> {{ c.name }}</td>
17+
18+
<td>
19+
<button type="button" class="btn btn-warning btn-xs"><i class="fas fa-edit"></i></button>
20+
<button type="button" class="btn btn-danger btn-xs"><i class="far fa-trash-alt"></i></button>
21+
</td>
22+
</tr>
23+
{% endfor %}
224

3-
{% block content %}
4-
<div class="card card-default">
5-
<div class="card-header">
6-
<h3 class="card-title">
7-
<i class="fas fa-search"></i>
8-
{{ title }}
9-
</h3>
10-
</div>
11-
<!-- /.card-header -->
12-
<div class="card-body">
13-
<table class="table">
14-
<thead>
15-
<tr>
16-
<th scope="col">Numero</th>
17-
<th scope="col">Nombre</th>
18-
<th scope="col">Opciones</th>
19-
</tr>
20-
</thead>
21-
<tbody>
22-
{% for c in categorias %}
23-
<tr>
24-
<td> {{ c.id }}<td>
25-
<td> {{ c.name }}<td>
26-
<td>
27-
<button type="button" class="btn btn-primary btn-xs"><i class="fas fa-edit"></i></button>
28-
<button type="button" class="btn btn-danger btn-xs"><i class="far fa-trash-alt"></i></button>
29-
<td>
30-
</td>
31-
{% endfor %}
32-
</tbody>
33-
</table>
34-
</div>
35-
<!-- /.card-body -->
36-
</div>
37-
<!-- /.card -->
38-
</div>
3925

4026
{% endblock %}
4127

Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
from django.shortcuts import render
2+
from core.erp.models import Category
3+
24

35
def category_list(request):
46
data = {
57
'title':'Listado de Categorias',
6-
'categorias': category.objects.all()
8+
'categorias': Category.objects.all()
79
}
810
return render(request, 'category/list.html', data)

Creando_nuestro_primer_listado_en_django/manage.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
12
#!/usr/bin/env python
23
"""Django's command-line utility for administrative tasks."""
34
import os
@@ -18,4 +19,4 @@ def main():
1819

1920

2021
if __name__ == '__main__':
21-
main()
22+
main()
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
{% extends 'body.html'%}
2+
3+
{% block content %}
4+
<div class="card card-default">
5+
<div class="card-header">
6+
<h3 class="card-title">
7+
<i class="fas fa-search"></i>
8+
{{ title }}
9+
</h3>
10+
</div>
11+
<div class="card-body">
12+
<table class="table">
13+
<thead>
14+
15+
{% block columns %}
16+
{% endblock %}
17+
18+
</thead>
19+
<tbody>
20+
21+
{% block row %}
22+
{% endblock %}
23+
24+
</tbody>
25+
</table>
26+
</div>
27+
</div>
28+
<div class="card-footer">
29+
<buttoN class="btn btn-warning btn-flat">
30+
<i class="fas fa-plus"></i> Nuevo registro
31+
</buttoN>
32+
</div>
33+
{% endblock %}

0 commit comments

Comments
 (0)