Skip to content
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

Check if related model has an integer as pk for ManyToMany fields. #64

Merged
merged 1 commit into from
Mar 31, 2016

Conversation

logaritmisk
Copy link
Contributor

I have a model (Station) that uses UUID as pk, and it has an ManyToMany relation to a model (Entity) that uses integers as pk. With current implementation I get an exception because Station.has_int_pk() returns False (as it should), so ids is None when we call get_many_to_something(). It should check if the related model has integers as pk, because it's the related model ids when want in our query.

I guess there should be an else statement where ids is set to self.value, if the related model uses string as pk?

@coveralls
Copy link

Coverage Status

Coverage remained the same at 78.648% when pulling d4b9b17 on logaritmisk:master into fe24dbc on jedie:master.

@jedie jedie merged commit 335dd4a into jedie:master Mar 31, 2016
@jedie
Copy link
Owner

jedie commented Mar 31, 2016

Thanks for contribution!

Can you also contribute a test with UUID?

@logaritmisk
Copy link
Contributor Author

I'm doing this for a client, so not much time over to other things. But I will give it a try and see if I can get something working after work

@jedie
Copy link
Owner

jedie commented Apr 27, 2016

i uploaded release v0.6.2 that contains this pull ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants