Say, I've got a model like this:
class Fleet(models.Model):
user = models.ForeignKey(User)
[...]
ship1 = models.IntegerField(default=0)
ship2 = models.IntegerField(default=0)
ship3 = models.IntegerField(default=0)
ship4 = models.IntegerField(default=0)
And a form:
class sendFleet(forms.Form):
[...]
ship1 = forms.IntegerField(initial=0)
ship2 = forms.IntegerField(initial=0)
ship3 = forms.IntegerField(initial=0)
ship4 = forms.IntegerField(initial=0)
How I can make the fields in the form hidden if the user has no 'ships' available (i.e = 0 in the Fleet model)?