irongit

A parser inspired by the django orm.

gparser/main.py
17 lines299 BPython
1import parsers
2
3
4class Test(parsers.Parser):
5 a = parsers.BooleanField()
6 b = parsers.HourMinuteIntField()
7
8 def __str__(self):
9 return f'{self.id} {self.a}'
10
11
12t1 = Test(a='23', b='02:32')
13t1.save()
14t2 = Test(a='', b='2342')
15t2.save()
16for obj in Test.objects.all():
17 print(obj.a)