Skip to content

Commit d1325d1

Browse files

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed
 

‎model_utils/fields.py

+4-7
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,6 @@ def __init__(self, instance, field_name, excerpt_field_name):
196196
self.field_name = field_name
197197
self.excerpt_field_name = excerpt_field_name
198198

199-
# content is read/write
200199
@property
201200
def content(self):
202201
return self.instance.__dict__[self.field_name]
@@ -205,15 +204,13 @@ def content(self):
205204
def content(self, val):
206205
setattr(self.instance, self.field_name, val)
207206

208-
# excerpt is a read only property
209-
def _get_excerpt(self):
207+
@property
208+
def excerpt(self):
210209
return getattr(self.instance, self.excerpt_field_name)
211-
excerpt = property(_get_excerpt)
212210

213-
# has_more is a boolean property
214-
def _get_has_more(self):
211+
@property
212+
def has_more(self):
215213
return self.excerpt.strip() != self.content.strip()
216-
has_more = property(_get_has_more)
217214

218215
def __str__(self):
219216
return self.content

0 commit comments

Comments
 (0)
Please sign in to comment.