feat: added search for products
This commit is contained in:
@@ -45,6 +45,7 @@ class ProductViewSet(ModelViewSet):
|
||||
IsAdminUser,
|
||||
ProductPermissions,
|
||||
)
|
||||
search_fields = ('name', )
|
||||
|
||||
def get_serializer_class(self):
|
||||
if self.action == "create":
|
||||
|
||||
+1
-1
@@ -53,7 +53,7 @@ class Product(models.Model):
|
||||
class Meta:
|
||||
verbose_name = _("Producto")
|
||||
verbose_name_plural = _("Productos")
|
||||
ordering = ('id', )
|
||||
ordering = ('-id', )
|
||||
|
||||
|
||||
class ProductPrice(models.Model):
|
||||
|
||||
Reference in New Issue
Block a user