Custom Dialog Docfields

How would I control and validate docfields from python when they are created in a custom dialog:

var d = new frappe.ui.Dialog({
		'title': 'Harvest this Animal?',
		'fields': [
        {'label': 'Harvest Weight in Pounds', 'fieldname': 'harvest_weight', 'fieldtype': 'Float'},
				{'label': 'Date of Harvest', 'fieldname': 'harvest_date', 'fieldtype': 'Date', 'default':frappe.datetime.nowdate()},
				{'label': 'Time of Harvest', 'fieldname': 'harvest_time', 'fieldtype': 'Time'}
    primary_action: function(){{
				method: "submit_harvest",
				doc: cur_frm.doc

I’d like to be able to act on self.harvest_date on the server side. What am I missing?
Do I need to append fields_dict? If so, what is correct the schema?

Hi, sorry my formatting doesn’t look nice
I think you need something like this:

Thanks @NMyshuk. I was able to construct a callback like yours and successfully call a frappe.msgprint test. When I try to operate on self.havest_date I get the error ‘Animal’ object has no attribute ‘harvest_date’.
harvest_date is not a docfield. I know I can add it to make this work, but I think it’d be better to do it dynamically. Does the dialog class not have a way to do this? Should I be looking at another method?

Sorry, I am not sure that I can understand what do you want, just for my clarification.
when you open dialog you need to add value in the harvest_date dialog view from python script?
Also as I’ve understood how Dialog works it has temporary fields, they can be present in the Doctype or cannot be it’s your choice

Thanks @NMyshuk, I think you understood me correctly. The options for docfields seems to be 1) make them a part of your doctype or 2) have them exist temporarily only as part of your dialog. I want 3) to add docfields to the doctype based on the dialog’s docfields.
Back to the drawing board.

So, I suppose you can make something like this

{'label': 'Date of Harvest', 'fieldname': 'harvest_date', 'fieldtype': 'Date', 'default': your_script_name()},

your_script_name = function(cur_frm) {