-
-
Notifications
You must be signed in to change notification settings - Fork 791
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
Exporting fields with changed column_name
doesn't work in v4
#1846
Comments
@PetrDlouhy - I can't reproduce it exactly in the way you have it.
|
@matthewhegarty I think, that test is too specific for to test the actual problem. The test runs only I expect that it behaves like if the checkbox for a field was not selected. I will try to investigate further and make the appropriate test. |
Hi Petr When I export the Ebook, I see: The export file I get is:
So it's possibly a bug that the Export HTML doesn't show the name of the field name to be exported ("Email of the author"), but other than that it looks ok... Am I missing something? |
@matthewhegarty I didn't touch that part and I am not sure, which variant is correct. The original field name can be more readable for the user as it is/can be consistent across multiple resources. Maybe we should display both values like |
@matthewhegarty I have added that functionality as separate PR #1857. Please check it and decide if you like this style or if I should prefer only one variant. |
I notice that if I add the attribute name, then the test in #1857 passes:
This is similar to what was reported here this could be a v4 regression, I'll test in v3. |
I tested in v3 (added test here). This passes in v3, so we have a regression in v4 when the attribute name is not supplied. |
@matthewhegarty I don't understand entirely. The test in will pass after applying #1856 (not #1857). Is there something that needs to be fixed in either of those commits? |
Hi, I am still looking into it. I think there are a couple of things going on with other parts of the code which need addressing. I'll write a more detailed response tomorrow. |
hi Petr The reason this works is because the This also fixes an issue I uncovered whilst testing (#1860). I propose that I merge this PR instead of yours. What do you think? |
@matthewhegarty That seems to be a better solution. I tested it and it seems to be working. The PR is missing the refactoring made in this commit: 9d2cab3 |
I only removed the change so that I could be sure that changes to There is some duplication in those methods, so feel free to submit a new PR to make the code clearer. I would recommend to hide any shared logic in a protected method. I also wasn't comfortable with the new Field attribute called Thanks again for all your help in identifying and fixing this issue 👍 |
Yeah, the |
@matthewhegarty Everything seems to be working. Thank you very much for your attention and all the work you put into this project. |
np - thanks for your input! |
Describe the bug
Fields like
email = Field(column_name="recipientEmail")
from myModelResource
are missing in the CSV.To Reproduce
Steps to reproduce the behavior:
ModelResource
like:amount
andtype
(those that didn't change name of the column).Versions (please complete the following information):
Expected behavior
All columns should be exported.
Additional context
Seems that the column name is not correctly matched in this case. @matthewhegarty I expect this would be easy for you to find the problem and fix it, but if not I can do some more digging and fixing.
The text was updated successfully, but these errors were encountered: