You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would like to make some modifications to imported data using the _post_import signal.
My code looks like this:
class OligoImportResource(resources.ModelResource):
created_by = fields.Field(
column_name='created_by',
attribute='created_by',
widget=ForeignKeyWidget(User, field='username')
)
class Meta:
model = Oligo
I would also like to access request to get the user id during import which someone else here mentioned was possible using kwargs but I can't get that to work either. Any help is appreciated.
The text was updated successfully, but these errors were encountered:
My problem is that _post_import signal is not being called.
@receiver(post_import, dispatch_uid='balabala...')def_post_import(model, **kwargs):
# model is the actual model instance which after importprint(model)
Hi all,
I would like to make some modifications to imported data using the _post_import signal.
My code looks like this:
Based on the documentation the
model
argument should be giving me an instance of my model, but when I try to confirm import I get the following error:I would also like to access
request
to get the user id during import which someone else here mentioned was possible usingkwargs
but I can't get that to work either. Any help is appreciated.The text was updated successfully, but these errors were encountered: