refactor(Card): change card field from disable to active for intuitive admin
This commit is contained in:
1 parent
4484195ddb
commit
0a2ce30edd
2 files changed
+3
-6
No files matched your search
+2
-5
@@ -8,13 +8,10 @@ class ProductAdmin(admin.ModelAdmin):
|
|||||||
|
|
||||||
|
|
||||||
class CardAdmin(admin.ModelAdmin):
|
class CardAdmin(admin.ModelAdmin):
|
||||||
list_display = ("name", "user", "card_id", "disabled")
|
list_display = ("name", "user", "card_id", "active")
|
||||||
list_filter = ("disabled",)
|
list_filter = ("active",)
|
||||||
search_fields = ("user__username", "name")
|
search_fields = ("user__username", "name")
|
||||||
|
|
||||||
def get_search_results(self, request, queryset, search_term):
|
|
||||||
return super().get_search_results(request, queryset, search_term)
|
|
||||||
|
|
||||||
|
|
||||||
admin.site.register(Product, ProductAdmin)
|
admin.site.register(Product, ProductAdmin)
|
||||||
admin.site.register(InventoryTransaction)
|
admin.site.register(InventoryTransaction)
|
||||||
|
|||||||
+1
-1
@@ -253,7 +253,7 @@ class Card(models.Model):
|
|||||||
name = models.CharField(max_length=64)
|
name = models.CharField(max_length=64)
|
||||||
# pin = models.IntegerField(max_length=4, blank=True, null=True)
|
# pin = models.IntegerField(max_length=4, blank=True, null=True)
|
||||||
# valid_until = models.DateTimeField(blank=True, null=True)
|
# valid_until = models.DateTimeField(blank=True, null=True)
|
||||||
disabled = models.BooleanField(default=False)
|
active = models.BooleanField(default=True)
|
||||||
created = models.DateTimeField(auto_now_add=True)
|
created = models.DateTimeField(auto_now_add=True)
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
|
|||||||
Reference in new issue
Block a user