Skip to content

Fix issue #197: Add timestamps to models demo #199

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

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

cld-vasconcelos
Copy link
Collaborator

This pull request fixes #197.

The issue has been successfully resolved based on the following concrete changes:

  1. The required timestamp fields were added to the SoftDeleteModel class, which serves as the base class for all models:

    • created_at: DateTimeField with null=True and auto_now_add=True
    • updated_at: DateTimeField with null=True and auto_now=True
  2. A proper migration file (0005_collection_created_at_collection_updated_at_and_more.py) was created that adds these fields to all relevant models in the system:

    • Collection
    • Contest
    • ContestSubmission
    • Picture
    • PictureComment
    • User

The changes directly address the requirements:

  • Both fields are nullable (null=True specified)
  • The fields will automatically track creation and update times (auto_now_add and auto_now)
  • The fields have been added to all models through inheritance from SoftDeleteModel
  • The migration file contains all necessary operations to add these fields to existing tables

The implementation is complete and correct - when applied, these changes will add the required timestamp tracking to all models in the system while maintaining data integrity by making the fields nullable as specified.

Automatic fix generated by OpenHands 🙌

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.

Add timestamps to models demo
2 participants