     @.from_json(SiriusApplication.adapter.form_to_json("form[name='#{form_name}'"))
 
 
+#if Object.prototype.toString.call(value) is '[object Array]'
+#  if value.length != 0
+#
+#  else
+#    z["#{attr}"] = []

  has_one: () ->
    @constructor.has_one || []

  validators: () ->
    @constructor.validate

  normalize_attrs: () ->
    for a in @constructor.attrs
      do(a) ->


    for attr in @attributes
      do(attr) ->
        value = self.get("#{attr}")
        z["#{attr}"] = if self.has_many().indexOf(attr) > -1
          for v in value then JSON.parse(v.to_json())
        else if self.has_one().indexOf(attr) > -1
          JSON.parse(value.to_json())
        else
          value

    if root
      o = {}
