def normalize_for_view(self, img_width): """Return attributes as a dictionary for use in a view context This allows using the same template across different models with differently-named attributes that hold similar information. """ return { "type": _("News"), "title": self.title, "author": format_user_name(self.author), "date": self.created, "image_html": ' <img src="%s" />' % (self.image.url), "excerpt": self.body, "url": self.get_absolute_url(), }
def normalize_for_view(self, img_width): """Return attributes as a dictionary for use in a view context This allows using the same template across different models with differently-named attributes that hold similar information. """ return { "type": _("News"), "title": self.title, "author": format_user_name(self.author), "date": self.created, "image_html":' <img src="%s" />' % (self.image.url), "excerpt": self.body, "url": self.get_absolute_url(), }
def name(self): # Import needs to go here to prevent a circular import from storybase_user.utils import format_user_name return format_user_name(self.user)
def contributor_name(self): """ Return the contributor's first name and last initial or username """ return format_user_name(self.author)
def contributor_name(self): """ Return the contributor's first name and last initial or username """ return format_user_name(self.author)
def not_member(step, username, name): user = User.objects.get(username=username) world.browser.visit(django_url("/organizations/%s" % world.organization.organization_id)) world.assert_text_not_present("Organization Contributors") world.assert_text_not_present(format_user_name(user))
def not_member(step, username, name): user = User.objects.get(username=username) world.browser.visit( django_url('/organizations/%s' % world.organization.organization_id)) world.assert_text_not_present("Organization Contributors") world.assert_text_not_present(format_user_name(user))