Skip to content

Commit

Permalink
VideoTutorial No. 25 [Personalizando el Admin]
Browse files Browse the repository at this point in the history
Aqui se encuentran los cambios necesarios para una visualización
personalizada del modelo de Productos.
  • Loading branch information
alexdzul committed Jun 14, 2013
1 parent cd862f9 commit e9a79fa
Show file tree
Hide file tree
Showing 10 changed files with 17 additions and 26 deletions.
29 changes: 4 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,28 +1,7 @@
Proyecto demo
========================
Descripción:
demo
====

Proyecto de Software WEB para la venta de productos en línea.
Este proyecto se trabaja como parte de los ejemplos del canal de youtube
Proyecto que se trabaja en el canal de Youtube de alexexc2
- http://www.youtube.com/user/alexexc2

====================================================
Software:

- Version actualizada a Django 1.5.1
- Procesamiento de imágenes con el software PIL
- Motor de Base de Datos MySQL y conector MySQLDB Python

====================================================

Para cualquier duda o comentario por favor contactarme vía twitter

@alexjs88


Estoy siempre atento a escuchar crítica constructiva.
Recuerden que los videos son para ayudar a la comunidad de Django en Español.


Un Saludo.
Alex Dzul
Version Django 1.4
10 changes: 9 additions & 1 deletion demo/apps/ventas/admin.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
from django.contrib import admin
from demo.apps.ventas.models import cliente,producto,categoriaProducto


class productoAdmin(admin.ModelAdmin):
list_display = ('nombre','thumbnail','precio','stock')
list_filter = ('nombre','precio')
search_fields = ['nombre','precio']
fields = ('nombre','descripcion',('precio','stock','imagen'),'categorias','status')


admin.site.register(cliente)
admin.site.register(producto)
admin.site.register(producto,productoAdmin)
admin.site.register(categoriaProducto)
4 changes: 4 additions & 0 deletions demo/apps/ventas/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ def url(self,filename):
ruta = "MultimediaData/Producto/%s/%s"%(self.nombre,str(filename))
return ruta

def thumbnail(self):
return '<a href="/media/%s"><img src="/media/%s" width=50px heigth=50px/></a>'%(self.imagen,self.imagen)

thumbnail.allow_tags = True

nombre = models.CharField(max_length=100)
descripcion = models.TextField(max_length=300)
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit e9a79fa

Please sign in to comment.