added dynamic field link to company, to display on admin if it has a shop_link
This commit is contained in:
@@ -16,8 +16,5 @@ class CompanyAdmin(admin.ModelAdmin):
|
||||
PointField: {"widget": GooglePointFieldWidget}
|
||||
}
|
||||
|
||||
def link(self, company):
|
||||
return company.shop_link is not None
|
||||
|
||||
|
||||
admin.site.register(models.Company, CompanyAdmin)
|
||||
|
||||
@@ -57,3 +57,8 @@ class Company(models.Model):
|
||||
class Meta:
|
||||
verbose_name = "Compañía"
|
||||
verbose_name_plural = "Compañías"
|
||||
|
||||
def link(self):
|
||||
return self.shop_link is not None
|
||||
|
||||
link.boolean = True
|
||||
|
||||
Reference in New Issue
Block a user