<!-- language: lang-default -->
class Seo(models.Model):
title = models.CharField( max_length=500, blank=True)
description = models.CharField(max_length=500, blank=True)
keywords = models.CharField(max_length=1000, blank=True)
url = models.CharField(max_length=500, blank=True)
static = models.BooleanField()
class SeoInlines(generic.GenericStackedInline):
model = Seo
form = SeoForm
extra = 1
max_num = 1
Мне нужно сделать Seo.url
недоступным для редактирования (editable=False
или SeoInlines.exclude = ('url', )
или SeoInlines.readonly_fields = ('url',)
) при seo.static = 1
.
Как я могу это сделать?