Retrieving a list of strings is seen as listmodel that can't be saved back

Bug #1483614 reported by Didier Roche-Tolomelli
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
U1DB Qt/ QML
New
Undecided
Unassigned
u1db-qt (Ubuntu)
New
Undecided
Unassigned

Bug Description

If you push a document that contains property being a list of strings, like:

{
  'attachements': ["/path/to/foo1.png", "/path/to/foo2.png"]
}

Retrieving it is making the attachements a ListModel through the QML type system (outside of u1db's scope thus). The ListModel contains ObjectModel and it's useful to attach that to Repeater/Grid.

However, when we try to store those data back (from the same object), the ListModel/ObjectModel aren't storable in u1db, so we end up with:
{
  'attachments: [null, null]
}

So getting the object don't enable to save it back, we have to manually typecast it and create some json objects from it, which is quite ugly and cumbersome: https://github.com/didrocks/splitthebill/commit/9d1e72131f7a2842bea08b4e144895ef0a06f4d2#diff-63dd6639b235200e552147bf0a9003b8R59.

Any idea if u1db-qt can typecast it back to something that can be stored, or anything to make the developer's life easier?

Tags: devexp
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.