I want to use groupby() function from pandas, but dont know how to get file before export. I've tried dehydrate, but I dont think it's what i want.
phone = Field()
class Meta:
model = Phones
# exclude = ('id', )
def dehydrate_url(self,phone):
If you need to get hold of the file data before import, it is easy, just use the before_import() method:
This needs to be declared in your Resource, for example:
class BookResource(resources.ModelResource):
def before_import(self, dataset, using_transactions, dry_run, **kwargs):
for row in dataset.dict:
print(row)