def get_post_images(self, obj): if obj.images: images = [] for image in obj.images.all(): images.append(get_absolute_url(image.image.url)) return images return None
def get_qr_code(self, obj): if hasattr(obj, "qr_code"): return get_absolute_url(obj.qr_code.qr_code.url) return None
def get_image(self, obj): if obj.image: return get_absolute_url(obj.image.url) return None