コード例 #1
0
ファイル: plan.py プロジェクト: flyingoverthetop/osl_notebook
def create_monthly_plan(user):
    now = date.today()
    f, created = getFrame(user).objects.get_or_create(title="Monthly Plan:" + now.strftime("%Y-%m"))
    f.owner_name = user
    f.desc = "Make your monthly plan for this month here."
    f.save()
    f_trans, trans_created = getNoteTranslation(user).objects.get_or_create(note=f)
    f_trans.owner_name = user
    f_trans.lang = "C"
    f_trans.original_lang = "E"
    f_trans.title = _("Monthly Plan:") + now.strftime("%Y-%m")
    f_trans.desc = _("Make your monthly plan for this month here.")
    f_trans.save()
    # to push the translation to the social notebook as well
    f.save()
    return f.id
コード例 #2
0
def create_monthly_plan(user):
    now = date.today()
    f, created = getFrame(user).objects.get_or_create(title='Monthly Plan:' +
                                                      now.strftime('%Y-%m'))
    f.owner_name = user
    f.desc = 'Make your monthly plan for this month here.'
    f.save()
    f_trans, trans_created = getNoteTranslation(user).objects.get_or_create(
        note=f)
    f_trans.owner_name = user
    f_trans.lang = 'C'
    f_trans.original_lang = 'E'
    f_trans.title = _('Monthly Plan:') + now.strftime('%Y-%m')
    f_trans.desc = _('Make your monthly plan for this month here.')
    f_trans.save()
    #to push the translation to the social notebook as well
    f.save()
    return f.id
コード例 #3
0
ファイル: plan.py プロジェクト: flyingoverthetop/osl_notebook
def create_weekly_plan(user):
    now = date.today()
    one_week_later = now + datetime.timedelta(days=6)
    f, created = getFrame(user).objects.get_or_create(
        title="Weekly Plan:" + now.strftime("%Y-%m-%d") + " to " + one_week_later.strftime("%Y-%m-%d")
    )
    # if created:
    f.owner_name = user
    f.desc = "Make your weekly plan for this week here."
    f.save()
    f_trans, trans_created = getNoteTranslation(user).objects.get_or_create(note=f)
    f_trans.owner_name = user
    f_trans.lang = "C"
    f_trans.original_lang = "E"
    f_trans.title = _("Weekly Plan:") + now.strftime("%Y-%m-%d") + _(" to ") + one_week_later.strftime("%Y-%m-%d")
    f_trans.desc = _("Make your weekly plan for this week here.")
    f_trans.save()
    # to push the translation to the social notebook as well
    f.save()
    return f.id
コード例 #4
0
def create_weekly_plan(user):
    now = date.today()
    one_week_later = now + datetime.timedelta(days=6)
    f, created = getFrame(user).objects.get_or_create(
        title='Weekly Plan:' + now.strftime('%Y-%m-%d') + ' to ' +
        one_week_later.strftime('%Y-%m-%d'))
    #if created:
    f.owner_name = user
    f.desc = 'Make your weekly plan for this week here.'
    f.save()
    f_trans, trans_created = getNoteTranslation(user).objects.get_or_create(
        note=f)
    f_trans.owner_name = user
    f_trans.lang = 'C'
    f_trans.original_lang = 'E'
    f_trans.title = _('Weekly Plan:') + now.strftime('%Y-%m-%d') + _(
        ' to ') + one_week_later.strftime('%Y-%m-%d')
    f_trans.desc = _('Make your weekly plan for this week here.')
    f_trans.save()
    #to push the translation to the social notebook as well
    f.save()
    return f.id