django-wiki / django-nyt

Notification system for Django with batteries included: Email digests, user settings, JSON API
Apache License 2.0
144 stars 47 forks source link

Clashes with Foriegn Keys on related name #4

Closed joshblum closed 8 years ago

joshblum commented 10 years ago

Can a related_name field be added to the different models ? There is the possibility of conflict with other django applications when these are not specified.

benjaoming commented 10 years ago

Good idea, I can vouch for that. Could they be set to default values, though? :)

joshblum commented 10 years ago

I'm having the issue that my source code has classes with the same name and no related_name specified so having unique names for the library would be best

benjaoming commented 10 years ago

Well you can always argue if that's a problem with django-nyt or your application ;) I don't know if there is any best practices about these things, but I would agree that it's not nice if two third parties started clashing on something like this, so maybe let's make them unique and hope we don't create too much misery :)

On 22 September 2014 22:25, Joshua Blum notifications@github.com wrote:

I'm having the issue that my source code has classes with the same name and no related_name specified so having unique names for the library would be best

— Reply to this email directly or view it on GitHub https://github.com/benjaoming/django-nyt/issues/4#issuecomment-56437157.

joshblum commented 10 years ago

Prefixing whatever the key is with django_nyt is probably best. I think the library should take care of it since you want a simple integration and not have to modify your source beyond settings.py and urls.py :)

valberg commented 10 years ago

I would prefer not using django_nyt as a prefix, since code that uses reverse relations would look quite ugly. Having "pretty" related_names shouldn't be that hard.

benjaoming commented 8 years ago

This will be fixed in the 1.0 release.