LFS provides a generic export engine for products (see here for more). In this tutorial you will learn how to create your own scripts to format the data like you want to.
First you need to create a default Django application (or use an existing one).
If you do not know how to do this, please refer to the excellent Django tutorial.
Within the __init__.py of your application create a function that will return the products, like so:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | # python imports
import csv
# django imports
from django.http import HttpResponse
from django.core.mail import send_mail
# lfs imports
from lfs.export.utils import register
def export(request, export):
"""Export method for acme.com
"""
response = HttpResponse(mimetype="text/csv")
response["Content-Disposition"] = "attachment; filename=acme.txt"
writer = csv.writer(response, delimiter=";", quotechar='"', quoting=csv.QUOTE_ALL)
for product in export.get_products():
writer.writerow(product.id, product.get_name())
return response
register(export, "acme.com")
|
The code explained
Now you can go the management interface, create a new export, select the products and your newly script and call it via the Export button (See here for more).