Exemplo n.º 1
0
def tk_prepostfix(title, arg='longslash'):
    """
    :param str arg: postfixtype til :func:`tktitler.prepostfix`.
    Det er ikke muligt at ændre prefixtype.
    """
    return tk.prepostfix(title, gfyear=config.GFYEAR,
                         prefixtype='unicode', postfixtype=arg)
Exemplo n.º 2
0
Arquivo: admin.py Projeto: siadyhr/web
 def get_titles(self, profile):
     titles = list(profile.title_set.all())
     if titles:
         with tk.set_gfyear(config.GFYEAR):
             return ', '.join(
                 sorted(
                     tk.prepostfix(t, prefixtype="unicode")
                     for t in titles))
Exemplo n.º 3
0
Arquivo: admin.py Projeto: siadyhr/web
 def choices(self, cl):
     gfyear = config.GFYEAR
     for choice in super(TitlePeriodFilter, self).choices(cl):
         try:
             period = int(choice['display'])
         except ValueError:
             pass
         except TypeError:
             pass
         else:
             choice['display'] = tk.prepostfix(('BEST/FU', period),
                                               gfyear=gfyear,
                                               prefixtype='unicode')
         yield choice
Exemplo n.º 4
0
 def test_prepostfix(self):
     self.assertEqual(tk.prepostfix(self.form(2015), 2016), 'GFORM 2015/16')
Exemplo n.º 5
0
 def test_old_title(self):
     self.assertEqual(tk.prepostfix(("BEST", 1957), 2016), "T56OBEST")
Exemplo n.º 6
0
 def test_EFUIT(self):
     self.assertEqual(tk.prepostfix(("EFUIT", 2011), 2016), "T2OEFUIT")
Exemplo n.º 7
0
 def test_year_plus_03(self):
     self.assertEqual(tk.prepostfix(("CERM", 2019), 2016), "K3CERM 2019/20")
Exemplo n.º 8
0
 def test_year_minus_05(self):
     self.assertEqual(tk.prepostfix(("CERM", 2011), 2016),
                      "T2OCERM 2011/12")
Exemplo n.º 9
0
 def test_sameyear(self):
     self.assertEqual(tk.prepostfix(("CERM", 2016), 2016), "CERM 2016/17")
Exemplo n.º 10
0
Arquivo: admin.py Projeto: siadyhr/web
 def get_period(self, title):
     return tk.prepostfix((title.get_kind_display(), title.period),
                          config.GFYEAR,
                          prefixtype='unicode')
Exemplo n.º 11
0
Arquivo: admin.py Projeto: siadyhr/web
 def get_display_title(self, title):
     return tk.prepostfix(title, config.GFYEAR, prefixtype='unicode')