Re: Bulk db insert with a file through admin form

2013-01-29 Thread MNG1138
What I ended up doing is customizing the ModelAdmin for the Product class. I went this route instead of adding a new form because I wanted to be able to use the admin form to search for a particular product or products, and once located, upload the serialized product file. The admin effectivel

Re: Bulk db insert with a file through admin form

2012-12-04 Thread Chris Cogdon
My suggestion is to not have any kind of model-linked-file. Use a standard Form that accepts a file, then as part of the POST processing, you open the file, do all the necessary reading and object creation, then return a render/redirect for success. You might want to wrap the entire view in a c

Re: Bulk db insert with a file through admin form

2012-12-04 Thread Avraham Serour
I also have a case where I would need to bulk add items from a file, the client receives an excel file with products (up to a couple of hundreds). I still haven't implemented nothing yet as the feature doesn't have priority, in any case I thought adding a file upload option on the admin, or maybe a

Bulk db insert with a file through admin form

2012-12-03 Thread MNG1138
Say I've got a model like this: class Product(models.Model): name = models.CharField(max_length=200) class ProductItem(models.Model): product = models.ForeignKey(Product) serialnumber = models.charField() sold = models.BooleanField(default=False) ProductItem represents physical p