I have the following TabularInline:
class ProcessVariableInlineAdmin(TabularInline):
model = ProcessVariable
fields = (
"variable",
"station_rank",
)
readonly_fields = (
"variable",
"station_rank",
)
... and would like to remove the small line variables on each row:
I tried poking around on the django docs for TabularInline but came up short. Is there a way to do this that I'm overlooking? Thank you in advance!
class ProcessVariable(DateUserFieldsAbstract):
id = models.BigAutoField(
auto_created=True,
primary_key=True,
serialize=False,
verbose_name='ID')
variable = models.CharField(max_length=100, verbose_name='')
placeholder = models.CharField(max_length=150, default='', blank=True)
variable_type = models.CharField(
max_length=25,
default="Text",
choices=settings.PROCESS_VARIABLE_TYPES)
station = models.ForeignKey(
'Station',
on_delete=models.PROTECT,
null=True,
blank=True)
station_rank = models.IntegerField(null=True, blank=True)
is_required = models.BooleanField(default=False)
is_disabled = models.BooleanField(default=False)
state = models.BooleanField(default=True,
choices=settings.PROCESS_VARIABLE_STATE)
def __str__(self):
return "{}".format(self.variable)
class Meta:
constraints = [
UniqueConstraint(
fields=["variable", "station"], name="unique_variable_station"
)
]