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

ObjectID vs ID ? #40

Closed
MAkcanca opened this issue Mar 19, 2017 · 1 comment
Closed

ObjectID vs ID ? #40

MAkcanca opened this issue Mar 19, 2017 · 1 comment

Comments

@MAkcanca
Copy link

MAkcanca commented Mar 19, 2017

Hi !
I was experimenting with <a href='{% url "review_create" content_type=book object_id=id %}'>{% trans "Review this book" %}</a>
I realized when I register my book object with object id 1 and when it gets a PK from python id, instead of using object_id, I need to use that pk. Is that a bug or feature ? Because when I look at object_id tag, I think about ContentType relations and want to fill that tag with object_id.

Summary :
Book object created with object_id, positive integer field = 2
Python assigned PK 1 to Book object
Tag asks me to put object_id, I pass 2, doesn't work
Tag asks me to put object_id, I pass 1(PK), works

Did I misunderstood the concept or is this a feature ➿
I could set object_id class as PK but I'm not really fan of it.
Thanks !

@Tyrdall
Copy link
Member

Tyrdall commented Mar 28, 2017

The object_id should be the pk. You should not create an own object ID: https://github.com/bitlabstudio/django-review/blob/master/review/views.py#L91

@Tyrdall Tyrdall closed this as completed Mar 28, 2017
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

No branches or pull requests

2 participants