Last active
February 9, 2018 06:00
-
-
Save Nipun2016/0d392ea66c428e85de3db71fceb16719 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from wgadmin.models import * | |
def get_file_attachment_url(object): | |
from django.contrib.contenttypes.models import ContentType | |
contenttype_obj = ContentType.objects.get_for_model(object) | |
return FileAttachment.objects.values('attachment_file','object_id').filter(object_id=object.id, | |
content_type=contenttype_obj) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment