   _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')))


  dirty_from_page: ->
    dirty = []
    $.each $("input[data-k-uuid='" + @uuid + "']"), (i, attr) =>
      dirty_object = {}
      unless $(attr).data("val").toString() == $(attr).val().toString()
        dirty.push(dirty_object[attr] = [$(attr).data("val").toString(), $(attr).val().toStrin])

    if dirty.length
      true

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

      if $input.is(':checkbox')
        @set $input.data("attr"), $input.prop('checked')
      else
        @set $input.data("attr"), $input.val()

      model_data = $("[data-kindred-model]").find("[data-k-uuid='" + @uuid + "']")
      if !isNaN(parseFloat(model_data.data("id"))) && isFinite(model_data.data("id"))
