unt-libraries / django-nomination

A Django application for nominating URLs by project.
BSD 3-Clause "New" or "Revised" License
2 stars 1 forks source link

Get object or 404 #109

Closed madhuBayy closed 3 years ago

madhuBayy commented 3 years ago

@ldko @somexpert This resolves #93 and #110

madhuBayy commented 3 years ago

@ldko @somexpert This PR is ready to review. I removed __iexact in surt_exists and urls are getting nominated, not sure why since that part is expected to get stripped off when it goes to create(). But elsewhere it seems to work fine.

ldko commented 3 years ago

I still don't think these nominations are working as expected for me. Regarding using iexact in get_or_create kwargs, I think we need to keep them that way so the get call is done using them, and in places where we use them also pass the field in the defaults to use in the create if an object isn't found with the get. This is based on the documents that to me look like they indicate the field won't be used at all from the kwarg if it has '__' in it and the data in the admin side looking like it is missing.

madhuBayy commented 3 years ago

I still don't think these nominations are working as expected for me. Regarding using iexact in get_or_create kwargs, I think we need to keep them that way so the get call is done using them, and in places where we use them also pass the field in the defaults to use in the create if an object isn't found with the get. This is based on the documents that to me look like they indicate the field won't be used at all from the kwarg if it has '__' in it and the data in the admin side looking like it is missing.

I see what you were meaning. The 'entity', 'attribute' in urls in admin seems off. When I reverted using get_or_ceate() and let the previous code be, everything seems to be working fine. Do you both think I should drop off get_or_create for now ?

madhuBayy commented 3 years ago

Hold off on reviewing this PR. I'll ping you both again when it is ready for review. Thank you!

madhuBayy commented 3 years ago

@ldko @somexpert This is ready for review again.

madhuBayy commented 3 years ago

@ldko @somexpert This is ready for review again!!