Exemplo n.º 1
0
def populate_year_number(apps, schema_editor):
    Requests = apps.get_model('request', 'requests')
    for order in Requests.objects.all():
        order.year_number = str(
            helpers.combine_full_date_number(order.date_fa, order.number))
        order.save()
        print(order.pk, ' Done!')
Exemplo n.º 2
0
 def full_year_number(self):
     from request.helpers import helpers
     return helpers.combine_full_date_number(self.date_fa, self.number)
Exemplo n.º 3
0
 def test_combine_full_date_number7(self):
     res = helpers.combine_full_date_number("1381-01-15", 800001)
     self.assertEqual(res, 13810001)
Exemplo n.º 4
0
 def test_combine_full_date_number6(self):
     res = helpers.combine_full_date_number("1398-01-15", 790000)
     self.assertEqual(res, 790000)
Exemplo n.º 5
0
 def test_combine_full_date_number5(self):
     res = helpers.combine_full_date_number("1400-01-15", 99345)
     self.assertEqual(res, 14000345)
Exemplo n.º 6
0
 def test_combine_full_date_number4(self):
     res = helpers.combine_full_date_number("1400-01-15", 98754000005)
     self.assertEqual(res, 140098754000005)
Exemplo n.º 7
0
 def test_combine_full_date_number3(self):
     res = helpers.combine_full_date_number("1400-01-15", 250)
     self.assertEqual(res, 14000250)
Exemplo n.º 8
0
 def test_combine_full_date_number2(self):
     res = helpers.combine_full_date_number("1399-10-10", 994242)
     self.assertEqual(res, 13994242)
Exemplo n.º 9
0
 def test_combine_full_date_number1(self):
     res = helpers.combine_full_date_number("1399-10-10", 250)
     self.assertEqual(res, 13990250)