Created
May 1, 2014 19:00
-
-
Save loic/11458982 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
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