Closed trungtin closed 1 year ago
In fact, the issue is still there in the master branch.
If I define the schema like this, no error
class User(Model):
subjects = ListField()
u = User()
u.subjects = ['English', 'Math']
But with this (just like in the documentation), the error appears.
subjects = ListField(TextField())
Hi @trungtin,
Could you please describe how to reproduce the issue?
I just tried this on master branch and it works:
from fireo import ListUnion
from fireo.fields import ListField, TextField
from fireo.models import Model
class User(Model):
subjects = ListField()
class User2(Model):
subjects = ListField(TextField())
def test():
u = User()
u.subjects = ['English', 'Math']
u.save()
u.subjects = ListUnion(['Geography', 'History'])
u.update()
u.refresh()
assert u.subjects == ['English', 'Math', 'Geography', 'History']
def test2():
u = User2()
u.subjects = ['English', 'Math']
u.save()
u.subjects = ListUnion(['Geography', 'History'])
u.update()
u.refresh()
assert u.subjects == ['English', 'Math', 'Geography', 'History']
Sorry, my stupid ass thought I was running on the master branch but not.
Anyway, do we have a new version release soon?
This is a question for @AxeemHaider :)
New version 2.1.0
is available with the help of @ADR-007 :)
The released version 2.0.0 throw the error ListUnion object is not iterable. I saw that it had been fixed in the main branch. Could you release the new version?