1👍
As you are dealing with a many to many relation your InlineModelAdmin
should look like this:
class TagInline(admin.TabularInline):
model = Tag.posts.through
👤arie
0👍
Maybe you can try setting the model field for posts to
posts = models.ManyToManyField(Post, null=True, blank=True)
.
I guess the post might not be created, so it is not able to create a tag or “connect” a tag with a post.
- [Answer]-How to write a Django query where coloum_value < 100?
- [Answer]-Django, update profile, check if email is unique(exclude logged in user's email)
- [Answer]-DoesNotExist at /admin
- [Answer]-Matching a time pattern in django urls
- [Answer]-How to let a view has an expiration age in django?
0👍
your many to many field should be on the post model not the tag model. objects must be defined in order or you must models.ManyToManyField(‘tag’) this is not recommended unless unavoidable. so define tag first then post so you can do with just (tag) under post model. i would suggest just using django tagging. it has always served me well.
after all thats what makes django so appealing is reusable apps and fast development.
- [Answer]-Django sendfile download — Page not found
- [Answer]-Implement javascript in django templates language
- [Answer]-Cron not firing at regular intervals
- [Answer]-How to check subscription of django-paypal while development
Source:stackexchange.com