Thursday, August 28, 2014

Re: New user - struggling with database design

Ok - here is where I am stuck now. Any thoughts?

If I try to render {{ vessel.CurrentBrew }} in a view, I get something like this:
<django.db.models.fields.related.ManyRelatedManager object at 0x7f76f0088e10>

and this errors out:

{% for Brew in vessel.CurrentBrew.all %}X{{ Brew.ActualName }}<br/>{% endfor %}

(1146, "Table 'dbLunawireBrewing.brewlog_vessel_CurrentBrew' doesn't exist")

The vessel model looks like this:
class Vessel(models.Model):      Name = models.CharField(max_length=20)      ShortName = models.CharField(max_length=4)      Gallons = models.DecimalField(max_digits=4, decimal_places=2, null=True, blank=True)      Weight = models.DecimalField(max_digits=4, decimal_places=2, null=True, blank=True)      CurrentBrew  = models.ManyToManyField('Brew', related_name="brew")      def __unicode__(self):          return self.Name  

You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
To post to this group, send email to
Visit this group at
To view this discussion on the web visit
For more options, visit

No comments:

Post a Comment