Ejemplo n.º 1
0
def create_csv_export_format(sender, **kwargs):
    name = 'CSV'
    try:
        Format.objects.get(name = name)
    except Format.DoesNotExist:
        csv_format = Format(name=name,
                            file_ext="csv",
                            mime="text/csv",
                            template="data_exports/ptree.csv")
        csv_format.save()
Ejemplo n.º 2
0
def create_html_export_format(sender, **kwargs):
    name = 'HTML'
    try:
        Format.objects.get(name = name)
    except Format.DoesNotExist:
        html_format = Format(name=name,
                            file_ext="html",
                            mime="text/html",
                            template="data_exports/ptree.html")
        html_format.save()