Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple relations of the same model seems not supported #6

Open
danaki opened this issue May 17, 2022 · 2 comments
Open

Multiple relations of the same model seems not supported #6

danaki opened this issue May 17, 2022 · 2 comments

Comments

@danaki
Copy link

danaki commented May 17, 2022

class VwUiPosting(models.Model):
    posting_id = models.BigIntegerField(primary_key=True)
    posting_currency = models.ForeignKey(Currency, models.DO_NOTHING, blank=True, null=True, related_name='backend_posting_vw_ui_posting_currency')
    fee_currency = models.ForeignKey(Currency, models.DO_NOTHING, blank=True, null=True, related_name='backend_posting_vw_ui_fee_currency')
class VwUiPostingAdmin(ModelAdmin):
    actions = [csvexport]
    csvexport_export_fields = [
        'posting_id',
        'posting_currency.currency_code',
        'fee_currency.currency_code',
    ]
    csvexport_selected_fields = [
        'posting_id',
        'posting_currency.currency_code',
        'fee_currency.currency_code',
    ]

Field 'fee_currency.currency_code' appears two times in the resulting csv.

@thomst
Copy link
Owner

thomst commented Aug 3, 2022

Hi @danaki . Thanks a lot for your contribution. Actually I can't reproduce the error you described. I've build a test that sould cover the issue as I understood it and pushed it into the branch issue6. But it just passes fine.

Could you please clarify the misbehavior that you are observing. And would it be able for you to overwork the my test case so that it actually cover your issue?

@ignaciora
Copy link

@thomst hi! I have the same issue. Your issue6's test model is not representing the same model descripted by @danaki where "posting_currency" and "fee_currency" are foreing keys of the same model.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants