wlanslovenija / PiplMesh

A social info portal for wireless networks.
http://dev.wlan-si.net/wiki/PiplMesh
Other
39 stars 19 forks source link

Better model for panels settings - order and collapse status #278

Open NejcZupec opened 12 years ago

NejcZupec commented 12 years ago

Main page panels are now draggable and droppable (issue #160), but a model is very simple. It has only two dicts, one is for collapsed status and the second one is for order. It would be better, if we have more semantic model.

For example, something like that:

class PanelState(mongoengine.EmbeddedDocument):
    collapsed = mongoengine.BooleanField()
    column = mongoengine.IntField()
    order = mongoengine.IntField()

class Panel(mongoengine.EmbeddedDocument):
    layout = mongoengine.MapField(mongoengine.EmbeddedDocumentField(PanelState))

class User(auth.User):
    panels = mongoengine.MapField(mongoengine.EmbeddedDocumentField(Panel))

You can also define a different model, if you wan't.