-
-
Notifications
You must be signed in to change notification settings - Fork 485
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
changed_by field with through model(that already has User ForeignKey) #86
Comments
I've never seen this before. According to that ticket it looks like you can't have two ForeignKey fields both using the same Maybe this is the main problem with #16 (many-to-many field support)? |
The django ticket says that i can't have on through model two or more ForeignKey to source/target models. CustomUser and Account in my exemple. Issue #16 objective is to allow keep history of m2m fields, right? Should it include in the history object through model fields too(field 'role' in my case)? I want to keep history/history_user of fields that are in the through model(role and others...), I don't need to keep history of my m2m to Account(not for that m2m at least). PS.: Maybe I'm not understand the big picture here :) let me know if is that the case. |
I have had not had any reason to look into many-to-many field tracking. Your issue is related to many-to-many field tracking, but your problem seems separate from the proposed solution in #16. A ManyToManyField should probably be removed from the history model since it doesn't correspond to an actual database field. That would probably fix your specific problem, right? |
Yes, my problem is separate from proposed solution in #16. My point here is: We can't have in intermediate m2m model two ForeignKey to any of the models involved in the many-to-many.
Maybe in django 1.7 it will be fixed :) |
@csarcom you can try upgrading your current application to the Django 1.7 beta and see if it resolves the problem. I hope it does. |
Since 1.6.0 history_user no longer defaults to having a reverse relationship (#163), to avoid collisions like this. Closing, should not be an issue anymore. |
This is what I have:
https://gist.github.com/csarcom/9938033
Problem:
My model should be ok with two foreign key to the same model using related_name right? But, since it is a through model, i guess django does not support it[1].
Any idea how can I save history_user on that model?
[1] https://code.djangoproject.com/ticket/8618
The text was updated successfully, but these errors were encountered: