   _append_data_model_to_page: ->
     model_div = "<div data-k-uuid=" + @uuid + " data-id=" + @id + " data-class=" + @snake_name + " data-parent-type=" + @parent + " data-parent-id=" + @parent_id + "></div>"
     $("[data-kindred-model]").append(model_div)
+
+  _input_dirty: (input) ->
+    (input.data("val").toString() == input.val().toString())
+
+  _checkbox_dirty: (input) ->
+    (input.is(':checkbox') && (input.data("val") == input.prop('checked')))

    $.each @attributes, (key, value) =>
      input = $($template).find("input[data-attr='" + key + "']")
      if input.length
        input = $template.find("input[data-attr='" + key + "']")
        input.val(value)

    @_append_data_model_to_page()



  dirty_from_page: ->
    dirty = []
    $.each $("input[data-k-uuid='" + @uuid + "']"), (i, input) =>
      $input = $(input)

      dirty_object = {}
      attr = $input.data("attr")

      unless @_input_dirty($input) || @_checkbox_dirty($input)
        dirty.push(dirty_object[attr] = [$input.data("val").toString(), $input.val().toStrin])

    if dirty.length
      true
