Esempio 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!')
Esempio n. 2
0
 def full_year_number(self):
     from request.helpers import helpers
     return helpers.combine_full_date_number(self.date_fa, self.number)
Esempio n. 3
0
 def test_combine_full_date_number7(self):
     res = helpers.combine_full_date_number("1381-01-15", 800001)
     self.assertEqual(res, 13810001)
Esempio n. 4
0
 def test_combine_full_date_number6(self):
     res = helpers.combine_full_date_number("1398-01-15", 790000)
     self.assertEqual(res, 790000)
Esempio n. 5
0
 def test_combine_full_date_number5(self):
     res = helpers.combine_full_date_number("1400-01-15", 99345)
     self.assertEqual(res, 14000345)
Esempio n. 6
0
 def test_combine_full_date_number4(self):
     res = helpers.combine_full_date_number("1400-01-15", 98754000005)
     self.assertEqual(res, 140098754000005)
Esempio n. 7
0
 def test_combine_full_date_number3(self):
     res = helpers.combine_full_date_number("1400-01-15", 250)
     self.assertEqual(res, 14000250)
Esempio n. 8
0
 def test_combine_full_date_number2(self):
     res = helpers.combine_full_date_number("1399-10-10", 994242)
     self.assertEqual(res, 13994242)
Esempio n. 9
0
 def test_combine_full_date_number1(self):
     res = helpers.combine_full_date_number("1399-10-10", 250)
     self.assertEqual(res, 13990250)