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