Skip to content

Conversation

@drakeredwind01
Copy link
Member

Fixes #48

What changes did you make?

added the Accomplishment model with code for the API

Why did you make the changes (we will use this info to test)?

asked to in an issue

Neecolaa and others added 5 commits November 4, 2024 15:56
Added new template for changing tables
updated the update template
Updated update table template
@github-project-automation github-project-automation bot moved this to PR Needs review (automated column, do not place items here manually) in P: PD: Project Board Mar 7, 2025
@fyliu
Copy link
Member

fyliu commented Mar 10, 2025

I think the extra commits in your PR is something I did. I redid some of those commits for formatting after you sync'd your code to them. But that's fine. I or you can get rid of them later.

I think you skipped some of the steps in the tutorial. Most of that document is not optional. The tests have some flexibility if you know better ways to test.

@fyliu fyliu marked this pull request as draft March 28, 2025 00:37
@drakeredwind01
Copy link
Member Author

removed fields
created_date and
updated_at

@drakeredwind01
Copy link
Member Author

Closes #48

Overview:
This Pull Request addresses Issue #48 by implementing the Accomplishment model and its associated API endpoints. The goal is to establish a shared data store for accomplishments across HackforLA projects.

Key Changes:

  1. Accomplishment Model:

    • Created the Accomplishment model in app/core/models.py with the following fields, aligning with the "Data Fields" section of Issue Create Table: Accomplishment #48:
      • project_id (ForeignKey to Project)
      • title
      • description
      • url
      • accomplished_on
    • Note on created_date and updated_at: As per commit message, the created_at and updated_at fields were not explicitly added to the Accomplishment model definition as they are inherited from AbstractBaseModel. The created_date field mentioned in the issue was addressed by the existing created_at in the base model. A commented-out updated_at was also removed from AbstractBaseModel as it conflicts with auto_now=True in the base class.
  2. API Integration:

    • Integrated the Accomplishment model into the API by:
      • Creating AccomplishmentSerializer in app/core/api/serializers.py.
      • Creating AccomplishmentViewSet in app/core/api/views.py.
      • Registering the accomplishment endpoint in app/core/api/urls.py.
  3. Basic API Unit Test:

    • Added a basic test in app/core/tests/test_api.py to verify the creation of an accomplishment via the API endpoint.

Addressing Issue #48 Action Items:

  • Identified and documented table description: The model aligns with the spreadsheet definition.
  • Compared and checked off data fields against ERD: All specified fields are included.
  • Created a single model in Django (defining schema): Accomplishment model created.
  • Wrote an API end point: AccomplishmentViewSet and URL routing implemented.
  • Wrote API unit tests: Basic test for creation added.

@drakeredwind01 drakeredwind01 marked this pull request as ready for review June 19, 2025 01:38
@ExperimentsInHonesty ExperimentsInHonesty marked this pull request as draft June 27, 2025 00:20
@drakeredwind01 drakeredwind01 marked this pull request as ready for review June 27, 2025 21:32
- id: flake8
exclude: "^app/core/migrations/|^app/data/migrations/|^app/core/scripts"
args: [--max-line-length=119, --max-complexity=4, --pytest-fixture-no-parentheses]
args: [--max-line-length=119, --max-complexity=4, --pytest-fixture-no-parentheses, --extend-ignore=EXE002]
Copy link
Member

Choose a reason for hiding this comment

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

Note: This change is fine since flake8's file check of "executable scripts should start with shebang" is broken for Windows filesystem.

@drakeredwind01 has the repo checked out to his Windows filesystem D:\ drive and NTFS has no notion of the executable bit. So it tells flake8 that all files are executable, including ones like app/core/admin.py that's not executable under POSIX. So flake8 complains and says it should have a shebang, which is wrong.

Anyway, pre-commit has its own check for this that does work with NTFS and we already have it enabled - id: check-executables-have-shebangs, so the flake8 one is redundant.

Copy link
Member

Choose a reason for hiding this comment

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

@drakeredwind01 you should delete this file too. I think you deleted the one in the other PR earlier.

@fyliu
Copy link
Member

fyliu commented Aug 5, 2025

Hi @drakeredwind01

I don't remember if this is ready for review or an in-progress PR that you wanted me to comment on. If it's in-progress, you should select "Convert to draft" in the top of the right sidebar on this page.

It looks like you're still missing some changes such as registering the model with the admin site, and model tests.

@drakeredwind01
Copy link
Member Author

I tried. really hard several times. can't figure out how to do the rebase yet. i'll just copy everything. delete the commits and try again. hoping i get it in before someone else submits anything else.

@fyliu
Copy link
Member

fyliu commented Aug 28, 2025

@drakeredwind01 you can start again if it's easier. But we do have guides for resolving merge conflicts involving database migrations.
The trick is to not pull new code from main until you're done with working on the issue. That way, you only have to deal with any merging issues one time at the end of the process.

@fyliu fyliu requested review from dmartin4820 and removed request for del9ra and dmartin4820 September 5, 2025 01:11
@fyliu
Copy link
Member

fyliu commented Sep 5, 2025

Closing since #530 supersedes this.

@fyliu fyliu closed this Sep 5, 2025
@github-project-automation github-project-automation bot moved this from PR Needs review (automated column, do not place items here manually) to ✅Done in P: PD: Project Board Sep 5, 2025
@drakeredwind01 drakeredwind01 mentioned this pull request Oct 30, 2025
18 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: ✅Done

Development

Successfully merging this pull request may close these issues.

Create Table: Accomplishment

4 participants