-
Notifications
You must be signed in to change notification settings - Fork 31
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
Implement --recent flag on import_votes_cast command #818
Comments
@symroe was going to start writing up that issue as discussed on stand up but then saw this - so it is not the As I see it the changes required are the following:
|
Yep, that sounds like a reasonable set of actions! I think before all of that we need to audit the YNR models to see if they are storing the timestamp. e.g, Ballot isn't at the moment. |
Good point. This has also made me think a bit more about how the updated_at timestamp actually works in practice - for example, if a candidacy is added to a ballot, would that update the ballot timestamp? I'm not sure it well, but we probably need it to for the ballot importer to work effectively. So I'll look in to this along with auditing YNR models as the first step. |
@symroe something else I have noticed, some models such as |
Good catch! I'm not sure I mind what one of the two models we keep, but I agree that we should move to only using one! If it's helpful to think about:
That's not really an argument either way I guess, but it might help when thinking about it! |
I think it's worth changing to use the Another thing that's come up when trying to add it to a new class with existing objects, is that the
What do you think? |
I think you're right that we're not going to care about Of course the modified date will be whenever the migration was run, meaning that our first |
@symroe Had a thought about the issue of keeping the An alternative is to handle it through our filtering - so that when an API request is made to filter on That would then save us from the issue of multiple calls to save that might hinder performance elsewhere in the site? But it would tie the logic specifically to filtering through the API, so couldn't then be used elsewhere. |
At the moment
import_votes_cast
takes--since
with a date. This doesn't work well, as the response since a given date gets longer over time, when the data hasn't changed.This ends up taking a long time to import data we have already.
Rather, we should implement a
--recent
flag that imports and results added or updated in YNR since the last result entry we have in WCIVF.This should copy the way the person import's
--recent
flag works.It might also require more filters in YNR - see DemocracyClub/yournextrepresentative#1078
The text was updated successfully, but these errors were encountered: