A guess, but are you sure syncdb created the tables? Ie have you checked
using mysql, or manage.py dbshell that the tables are really there?

Syncdb only creates tables for a model the first time it is run - after that
it won't track updates. So if you ran it, then added the relationship, then
ran again you'd get the error your seeing.

If you have no data, just blow away the tables and start again. If you have
data, now is a good time to find out about South (http://south.aeracode.org)

Malcolm


On 21 July 2011 15:34, Schmidtchen Schleicher <spiolli...@googlemail.com>wrote:

> Something went wrong with posting the model, it should be:
>
>
> # -*- coding: utf-8 -*-
> from django.db import models
> from django.contrib.auth.models import User
> import datetime
>
> class Kalender(models.Model):
>     name = models.CharField("Kalendername", max_length=100)
>     description = models.TextField("Beschreibung")
>
>     class Meta:
>         verbose_name_plural = "Kalender"
>
> class Termin(models.Model):
>     in_calendar = models.ForeignKey(Kalender)
>     name = models.CharField("Terminname", max_length=100)
>     date = models.DateTimeField("Datum und Uhrzeit")
>     description = models.TextField("Beschreibung")
>
>     def is_today(self):
>         return self.date.date() == datetime.date.today()
>
>     is_today.short_description = "Termin findet heute statt?"
>
>     participants = models.ManyToManyField(User)
>
>     class Meta:
>         verbose_name_plural = "Termine"
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/django-users/-/IiaS26VAlVAJ.
>
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>



-- 
Malcolm Box
malcolm....@gmail.com

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to