Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

version 2.0.0 error with ListUnion/ListRemove #202

Closed
trungtin opened this issue Apr 4, 2023 · 5 comments
Closed

version 2.0.0 error with ListUnion/ListRemove #202

trungtin opened this issue Apr 4, 2023 · 5 comments

Comments

@trungtin
Copy link

trungtin commented Apr 4, 2023

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?

@trungtin
Copy link
Author

trungtin commented Apr 4, 2023

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())  

@ADR-007
Copy link
Collaborator

ADR-007 commented Apr 4, 2023

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']

@trungtin
Copy link
Author

trungtin commented Apr 4, 2023

Sorry, my stupid ass thought I was running on the master branch but not.

Anyway, do we have a new version release soon?

@ADR-007
Copy link
Collaborator

ADR-007 commented Apr 4, 2023

This is a question for @AxeemHaider :)

@AxeemHaider
Copy link
Contributor

New version 2.1.0 is available with the help of @ADR-007 :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants