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

Metadata #110

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open

Metadata #110

wants to merge 7 commits into from

Conversation

rayson1223
Copy link

resolve #17 Include metadata to image level

Copy link
Contributor

@Akasch Akasch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please excuse the delay, I had forgotten about this.

Overall looks good I think, but there are some minor issues to be fixed.

The errors from CI are:

imagetagger/imagetagger/images/forms.py:3:1: F401 'imagetagger.images.models.Image' imported but unused
imagetagger/imagetagger/images/forms.py:14:1: W293 blank line contains whitespace
imagetagger/imagetagger/images/views.py:43:1: F811 redefinition of unused 'json' from line 29
imagetagger/imagetagger/images/views.py:213:1: W293 blank line contains whitespace
imagetagger/imagetagger/images/views.py:277:69: F821 undefined name 'image_file'
imagetagger/imagetagger/images/views.py:407:19: E222 multiple spaces after operator
imagetagger/imagetagger/images/views.py:412:1: E302 expected 2 blank lines, found 1

could you fix them also pleas?

I have not reviewed the changes due to the indention fixes on the template in detail.

imagetagger/imagetagger/images/views.py Outdated Show resolved Hide resolved
imagetagger/imagetagger/images/views.py Outdated Show resolved Hide resolved
imagetagger/imagetagger/images/views.py Show resolved Hide resolved
imagetagger/imagetagger/images/views.py Outdated Show resolved Hide resolved
imagetagger/imagetagger/images/urls.py Outdated Show resolved Hide resolved
@Akasch Akasch requested a review from wichmannpas January 7, 2019 12:26
@rayson1223
Copy link
Author

rayson1223 commented Jan 7, 2019 via email

@rayson1223
Copy link
Author

@Akasch , thank you for the tips and guidance above, it is really helpful!
I had update the code according as requested at the latest commit.
Do let me know if there's anything else required to me update for this pr.

Copy link
Contributor

@Akasch Akasch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think if you change the two minor issues it should be good to merging

def metadata_delete(request, image_id):
img = get_object_or_404(Image, id=image_id)
metadata = json.loads(img.metadata)
if request.POST['key'] in metadata:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if POST['key'] is not set an exception is thrown

return redirect(reverse('annotations:annotate', args=(request.POST['image'],)))


@require_POST
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@login_required is now missing here, just do both on seperate lines:

@login_required
@require_POST
def metadata_delete(request, image_id):

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.

adding meta data to images
2 participants