I am new to Pyramid, Python, Jinja2 , jQuery AJAX, MongoDB and mongoengine. I was told to delvelop a system using these technologies. I am at a point where I do not know how to go futher. I have searched the web for answers, but found nothing that is helpful.
I do not know what to do with AJAX $.post data. I do not know how to store that data in MongoDB as a Document.

my AJAX:

var url = "{{'add_candidate'|route_url}}";
    $("form[name='is_submitted']").submit(function(e) {
        e.preventDefault();
        var data = $('form').serialize();
        $.post(url, data).success(function(data, status) {
            alert("Data: " + data + "\nStatus: " + status);
        });
    });

my views.py:

@view_config(
route_name="add_candidate",
renderer="templates/add_candidate.jinja2",
permission="admin",
)
@view_config(
    renderer="json",
    route_name="candidates.json",
    )                                  # is it correct to use two view_config decorators like this?
def add_candidate(request, context):
  # do something here with AJAX data???
    country = country_codes()
    return {"countries" : country}  

I am not sure what I must do from here? or even if this is correct? If you want to see my model.py Ill post it, but I don't think I have to change or add anything to it?
Any help would be greatly appreciated.
Thank you.