Perhaps the most djangoish way would be to create two model forms, with
different fields excluded, and choose which to render in the template.
Or you could render CSS style information to hide one or the other.
Or you could use JavaScript to hide one or the other based on something
else that you
Hi,
I have a model that contains either a text or a numerical information,
based on the type of the entry:
equipment = models.ForeignKey(equipment)
number = models.DecimalField('Amount/number', max_digits=6,
decimal_places=2, blank=True, null=False, default=0)
text = models.TextField("Text",
2 matches
Mail list logo