Ejemplo n.º 1
0
 def register(cls, name, pw, phone=None, address=None, email=None):
     pw_hash = Utils.make_pw_hash(name, pw)
     return cls(parent=Utils.users_key(),
                name=name,
                pw_hash=pw_hash,
                phone=phone,
                address=address,
                email=email)
Ejemplo n.º 2
0
    def render(self, current_user_id):
        key = db.Key.from_path('User',
                               int(self.user.key().id()),
                               parent=Utils.users_key())
        user = db.get(key)

        self._render_text = self.content.replace('\n', '<br>')
        return Utils.render_str("single-post.html",
                                post=self,
                                current_user_id=current_user_id,
                                author=user.name)
Ejemplo n.º 3
0
 def by_id(cls, uid):
     return cls.get_by_id(uid, parent=Utils.users_key())