On 3 Feb, 08:52, SeanFromIT <[EMAIL PROTECTED]> wrote:
> I'm just not seeing what's wrong with this models.py.
>
> from django.db import models
> class AdditionalEvidence(models.Model):
>     AEID = models.AutoField(primary_key=True)
>     class Meta:
>         db_table = 'Additional_Evidence'
>
> class Recording(models.Model):
>     RID = models.AutoField(primary_key=True)
>     class Meta:
>         db_table = 'Recording'
>
> class AdditionalEvidence-Recording(models.Model):
>     AEID = models.ForeignKey(AdditionalEvidence)
>     RID = models.ForeignKey(Recording)
>     class Meta:
>         db_table = 'Additional_Evidence-Recording'
>
> I'm getting an invalid syntax error on the first line of the third
> class.

You can't use a hyphen in a class or variable name in Python.
The interpreter would have no way of distinguishing between your class
name, and the calculation "Additional Evidence minus Recording".
Use an underscore instead.
--
DR.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to