           z.set("#{key}", self.get(back))
           #TODO: logs
 
-
+    #TODO: refactor this
     for klass in @has_one()
       do(klass) ->
         self["_#{klass}"] = null


      SiriusApplication.adapter.element(tag, value, clone)

  @from_json: (json = {}) ->
    m = new @
    json = JSON.parse(json)

          m.set(attr, json[attr])
    m

  # Generate a new model instance from form
  # @note not support a relations
  @from_html: () ->
    #FIXME
    form_name = @.form_name || @.name.replace(/([A-Z])/g, '_$1').replace(/^_/,"").toLowerCase()

    @.from_json(SiriusApplication.adapter.form_to_json("form[name='#{form_name}'"))

