Ejemplo 1: orden de django por
class Meta:
ordering = ('date',)
Ejemplo 2: el filtro django existe
if table.objects.filter(prop='value').count() > 0:
Ejemplo 3: django select_related y prefetch_related
django select_related and prefetch_related
select_related >> foreignkey
prefetch_related >> many to many
basically they are performance boosters ,used to avoid multiple unnecessary queries
Both methods achieve the same purpose, to forego unnecessary db queries.
But they use different approaches for efficiency..
¡Haz clic para puntuar esta entrada!
(Votos: 0 Promedio: 0)