is not json serializable request.session variables in django
<p>I want to store some values in a request.session variables in django, but it throws an error saying that specifically "supplier_value" and "old_validity_date" are not json serializable...the others work well...any idea ?, here's the code :</p>

<pre><code>class CostItemsSet(View):
    template_name='cost_control_app/cost_item_control.html'

    def get(self, request, *args, **kwargs):
        cost_items = get_object_or_404(CostItems, cost_item = kwargs["cost_item_id"])
        request.session["desc"] = cost_items.description
        request.session["usd"] = cost_items.usd_value
        request.session["rer_value"] = cost_items.rer
        request.session["pesos"] = cost_items.pesos_value
        request.session["supplier_value"] = cost_items.supplier
        request.session["old_validity_date"] = cost_items.validity_date
        form_group = GroupsForm()
        form_cost_items_update= CostItemsForm(
                                        instance =  cost_items,
                                        initial={}
                                        )
        form_subgroup= SubGroupsForm()
        form_cost_item = CostItemsForm()
        form_cost_elements= CostElementsForm()
        form_request= RequestsForm()
        lista = definetree(request.user.groups.all()[0].name, request.user.id)
        return render(request, self.template_name,{
                                                    "form_group" : form_group,
                                                    "form_subgroup" : form_subgroup,
                                                    "form_cost_item" : form_cost_item,
                                                    "form_cost_elements" : form_cost_elements,
                                                    "form_request" : form_request,
                                                    "form_cost_items_update":form_cost_items_update,
                                                    "groups":lista[0],
                                                    "subgroups":lista[1] ,
                                                    "sub_subgroups":lista[2],
                                                    "cost_items":lista[3],
                                                    }) 
</code></pre>

<p>Thanks for your help !</p>