Ejemplo n.º 1
0
 def project(self, ref, title, body, raw_html=False, **kw):
     if not raw_html:
         body = restify(doc2rst(body))
     kw.update(ref=ref)
     kw.update(description=body)
     kw.update(name=title)
     if self.project:
         kw.setdefault('parent', self.current_project)
     return self.add_object(tickets.Project(**kw))
Ejemplo n.º 2
0
 def milestone(self, ref, date, body=None, raw_html=False, **kw):
     if not raw_html:
         body = restify(doc2rst(body))
     kw.update(ref=ref)
     #~ kw.update(checkin=checkin)
     #~ kw.update(description=body)
     if self.project:
         kw.setdefault('project', self.current_project)
     return self.add_object(tickets.Milestone(**kw))
Ejemplo n.º 3
0
 def milestone(self, ref, date, body=None, raw_html=False, **kw):
     if not raw_html:
         body = restify(doc2rst(body))
     kw.update(ref=ref)
     #~ kw.update(checkin=checkin)
     #~ kw.update(description=body)
     if self.project:
         kw.setdefault('project', self.current_project)
     return self.add_object(tickets.Milestone(**kw))
Ejemplo n.º 4
0
 def project(self, ref, title, body, raw_html=False, **kw):
     if not raw_html:
         body = restify(doc2rst(body))
     kw.update(ref=ref)
     kw.update(description=body)
     kw.update(name=title)
     if self.project:
         kw.setdefault('parent', self.current_project)
     return self.add_object(tickets.Project(**kw))
Ejemplo n.º 5
0
 def entry(self, ticket, time, title, body, raw_html=False, **kw):
     if isinstance(time, (basestring, int)):
         time = i2t(time)
     kw.update(created=datetime.datetime.combine(self.date, time))
     if not raw_html:
         body = restify(doc2rst(body))
     kw.update(user=self.user)
     kw.update(body=body)
     kw.update(title=title)
     kw.update(ticket=ticket)
     return self.add_object(blogs.Entry(**kw))
Ejemplo n.º 6
0
 def entry(self, ticket, time, title, body, raw_html=False, **kw):
     if isinstance(time, (basestring, int)):
         time = i2t(time)
     kw.update(created=datetime.datetime.combine(self.date, time))
     if not raw_html:
         body = restify(doc2rst(body))
     kw.update(user=self.user)
     kw.update(body=body)
     kw.update(title=title)
     kw.update(ticket=ticket)
     return self.add_object(blogs.Entry(**kw))
Ejemplo n.º 7
0
 def ticket(self, project_ref, title, body, raw_html=False, **kw):
     if not raw_html:
         body = restify(doc2rst(body))
     kw.update(description=body)
     kw.update(summary=title)
     project = tickets.Project.get_by_ref(project_ref)
     #~ try:
         #~ project=tickets.Project.objects.get(ref=project_ref)
     #~ except tickets.Project.DoesNotExist,e:
         #~ raise Exception("No project with reference %r" % project_ref)
     kw.update(project=project)
     #~ kw.update(project=tickets.Project.objects.get(ref=project_ref))
     return self.add_object(tickets.Ticket(**kw))
Ejemplo n.º 8
0
 def ticket(self, project_ref, title, body, raw_html=False, **kw):
     if not raw_html:
         body = restify(doc2rst(body))
     kw.update(description=body)
     kw.update(summary=title)
     project = tickets.Project.get_by_ref(project_ref)
     #~ try:
     #~ project=tickets.Project.objects.get(ref=project_ref)
     #~ except tickets.Project.DoesNotExist,e:
     #~ raise Exception("No project with reference %r" % project_ref)
     kw.update(project=project)
     #~ kw.update(project=tickets.Project.objects.get(ref=project_ref))
     return self.add_object(tickets.Ticket(**kw))
Ejemplo n.º 9
0
def render_node(request, node, template_name='pages/node.html', **context):
    context.update(node=node)
    heading = dbutils.babelattr(node, 'title', '')
    if heading:
        context.update(heading=heading)
        context.update(title=heading + ' · ' + settings.SITE.title)
    else:
        context.update(heading=settings.SITE.title)
        context.update(title=settings.SITE.title)
    body = dbutils.babelattr(node, 'body', '')
    if not node.raw_html:
        body = restify(doc2rst(body))
    #~ logger.info("20121227 render_node %s -> body is %s",node,body)
    context.update(body=body)
    return web.render_from_request(request, template_name, **context)
Ejemplo n.º 10
0
Archivo: utils.py Proyecto: khchine5/xl
def render_node(request, node, template_name='pages/node.html', **context):
    context.update(node=node)
    heading = dd.babelattr(node, 'title', '')
    if settings.SITE.title is None:
        title = settings.SITE.verbose_name
    else:
        title = settings.SITE.title

    if heading:
        context.update(heading=heading)
        context.update(title=heading + ' · ' + title)
    else:
        context.update(heading=title)
        context.update(title=title)
    body = dd.babelattr(node, 'body', '')
    if not node.raw_html:
        body = restify(doc2rst(body))
    # dd.logger.info("20121227 render_node %s -> body is %s",node,body)
    context.update(body=body)
    # return web.render_from_request(request, template_name, **context)
    return dd.plugins.jinja.render_from_request(
        request, template_name, **context)
Ejemplo n.º 11
0
def render_node(request, node, template_name='pages/node.html', **context):
    context.update(node=node)
    heading = dd.babelattr(node, 'title', '')
    if settings.SITE.title is None:
        title = settings.SITE.verbose_name
    else:
        title = settings.SITE.title

    if heading:
        context.update(heading=heading)
        context.update(title=heading + ' · ' + title)
    else:
        context.update(heading=title)
        context.update(title=title)
    body = dd.babelattr(node, 'body', '')
    if not node.raw_html:
        body = restify(doc2rst(body))
    #~ logger.info("20121227 render_node %s -> body is %s",node,body)
    context.update(body=body)
    # return web.render_from_request(request, template_name, **context)
    return dd.plugins.jinja.render_from_request(request, template_name,
                                                **context)