Skip to content

Instantly share code, notes, and snippets.

@loic loic/foo.diff
Created May 1, 2014

Embed
What would you like to do?
diff --git a/mezzanine/generic/fields.py b/mezzanine/generic/fields.py
index 8d8dd94..e95de37 100644
--- a/mezzanine/generic/fields.py
+++ b/mezzanine/generic/fields.py
@@ -134,6 +134,12 @@ class BaseGenericRelation(GenericRelation):
"""
pass
+ def value_from_object(self, obj):
+ """
+ Returns the value of this field in the given model instance.
+ """
+ return getattr(obj, self.attname).all()
+
class CommentsField(BaseGenericRelation):
"""
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.