Efrain Valles wrote:
> I have been trying to reference a model from another application I
> wrote for the same project.  basically what I need to do is asign a
> relationship between two model classes  in different apps.
>
> example
>
> module Product has a model class that belongs to the inventory app and
> the tax field of Product should use the tax module from the Billing
> app.
>
> I tried a simple import
>
> from myproject.app1.models import tax
>
> and then I:
>
> tax = models.ManyToManyField(tax)
>
> but it does nto work and I seem to be referencing it the wrong way.
>
> Any help appreciated.
>
>   
First piece of help: "it does not work" is a poor description of your
problem. We need a little more information to deduce what the problem
might actually be.

It might be easier to read the code if you had used

import myproject.app1.models


class Goods(models.Model):
    tax = models.ManyToManyField(myproject.app1.models.tax)

That only affects readability, however. Since your assignment statement
has no indentation I find myself wondering if you are trying to declare
the ManyToMany outside a class? If so, that will be the problem> a
ManyToMany should be a field of one of the related classes.

If my psychic powers have failed me then please reply with more
information about the nature of the failure.

regards
 Steve


--~--~---------~--~----~------------~-------~--~----~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to