Tuesday, September 2, 2014

Re: New user - struggling with database design

That looks like a database error - check in your database as to which tables have been created.

On Thursday, 28 August 2014 18:05:01 UTC+2, Jason G wrote:
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 django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/41928000-f83d-4403-aa9d-086429f1fa80%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment