コード例 #1
0
ファイル: Role.py プロジェクト: philn/alinea
 def newRole(self):
     role = VirtualRow(AlineaRole)
     role.id = self.roleID
     role.users = []
     role.label = ''
     roles = self.getFromSession('editingRoles', {})
     roles[role.id] = role
     self.storeToSession('editingRoles', roles)
コード例 #2
0
ファイル: User.py プロジェクト: philn/alinea
 def newUser(self):
     user = VirtualRow(AlineaUser.AlineaUser)
     user.id = self.userID
     user.articles = []
     user.roles = []
     users = self.getFromSession('editingUsers', {})
     users[user.id] = user
     self.storeToSession('editingUsers', users)
     return user
コード例 #3
0
ファイル: Article.py プロジェクト: philn/alinea
    def newArticle(self):
        """ Create a skeleton for a new Article.

            Return a VirtualRow acting as an AlineaArticle
        """
        date = datetime.datetime.now()
        userID = self.getLoggedUser().id
        article = VirtualRow(AlineaArticle)
        article.date = date
        article.lastModified = date
        article.alineaUserID = userID
        article.id = self.articleID
        article.publicID = self.articleID
        article.published = False
        article.alineaComments = []
        article.title = 'New Article'
        article.alineaSection = None
        article.alineaSectionID = None
        article.hits = 0
        if self.sectionID is not None:
            article.alineaSectionID = int(self.sectionID)
        return article