Is it possible to display many to many links for two models in the django admin panel? Models are in different applications.
What I was trying to do.
library.models:
from article.models import Articles, ArticlesDocuments class Documents(models.Model): ... article = models.ManyToManyField(Articles, through='ArticlesDocuments', blank=True) article.models:
from library.models import Documents class Articles(models.Model): ... document = models.ManyToManyField(Documents, through='ArticlesDocuments', blank=True) class ArticlesDocuments(models.Model): article = models.ForeignKey(Articles) document = models.ForeignKey(Documents) class Meta: db_table = 'article_articles_documents' auto_created = Articles But it does not work, it gives an error: ImportError: cannot import name 'Articles'
As I understand it, this is because Documents have already been imported into article.models. How to be? Thanks in advance for your reply.
from article import models as aModelsasfrom article import models as aModels. And then useaModels.Articles- betonimig