Skip to content

Conversation

@aaron-junot
Copy link
Member

This addresses #66.

I am thinking we'll probably need to add a parameter to the GET /resources route so that the front end can actually query for resources based on the created_at or last_updated data. Let me know if you want to see that as part of this PR.

I'm willing to have a discussion about whether we should include these timestamps in the data returned by all requests (I wasn't sure so I decided to not include it until we can have a discussion about it).

@aaron-junot
Copy link
Member Author

Query should look like this GET /resources?updated_after=2018-11-24

The model itself should have something like this

created_at = Column(DateTime(timezone=True), server_default=func.now())
last_updated = Column(DateTime(timezone=True), onupdate=func.now())

That way, any changes made on the database (outside the app) will also have timestamps. See here

@aaron-junot
Copy link
Member Author

@wimo7083 I need help writing tests for this. Can you hit me up on slack when you get a chance?

Copy link
Member

@apex-omontgomery apex-omontgomery left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice, looking great.

@apex-omontgomery apex-omontgomery merged commit 6db18ba into OperationCode:master Dec 24, 2018
@aaron-junot aaron-junot deleted the timestamps branch December 28, 2018 00:00
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

Successfully merging this pull request may close these issues.

2 participants