Skip to content
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

Added Hobbies model and view #38

Merged
merged 4 commits into from
Sep 3, 2024
Merged

Added Hobbies model and view #38

merged 4 commits into from
Sep 3, 2024

Conversation

bartczak-pa
Copy link
Owner

@bartczak-pa bartczak-pa commented Sep 3, 2024

Summary by Sourcery

Add a new 'Hobby' model and integrate it into the portfolio application to dynamically display hobbies on the home page. Refactor the portfolio page to use a new template for rendering hobbies, and update the URL configuration to route requests to the new view.

New Features:

  • Introduce a new 'Hobby' model to store information about hobbies, including name, description, icon, and optional link with link text.
  • Add a new view to fetch and display all hobbies on the home page using the 'Hobby' model.
  • Create a new template 'hobbies.html' to dynamically render the list of hobbies on the portfolio page.

Enhancements:

  • Refactor the portfolio page to include the hobbies section using the new 'hobbies.html' template.

Chores:

  • Add initial migration for the 'Hobby' model to set up the database schema.

Copy link
Contributor

sourcery-ai bot commented Sep 3, 2024

Reviewer's Guide by Sourcery

This pull request implements a new Hobby model and updates the portfolio view to display hobbies dynamically. It includes changes to the database schema, views, templates, and URL routing.

File-Level Changes

Change Details Files
Created a new Hobby model
  • Defined Hobby model with fields: name, description, icon, link, and link_text
  • Added Meta class for plural name
  • Implemented str method
  • Created initial migration for the Hobby model
bartczak_tech/portfolio/models.py
bartczak_tech/portfolio/migrations/0001_initial.py
Updated portfolio view to include hobbies
  • Created home view function to fetch all Hobby objects
  • Passed hobbies to the template context
  • Updated URL routing to use the new home view
bartczak_tech/portfolio/views.py
bartczak_tech/portfolio/urls.py
config/urls.py
Refactored hobbies section in portfolio template
  • Removed static hobbies HTML from portfolio.html
  • Created a new hobbies.html template for dynamic rendering
  • Added include statement in portfolio.html to use the new hobbies template
  • Implemented dynamic rendering of hobbies in hobbies.html
bartczak_tech/templates/portfolio/portfolio.html
bartczak_tech/templates/portfolio/hobbies.html

Tips
  • Trigger a new Sourcery review by commenting @sourcery-ai review on the pull request.
  • Continue your discussion with Sourcery by replying directly to review comments.
  • You can change your review settings at any time by accessing your dashboard:
    • Enable or disable the Sourcery-generated pull request summary or reviewer's guide;
    • Change the review language;
  • You can always contact us if you have any questions or feedback.

Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey @bartczak-pa - I've reviewed your changes - here's some feedback:

Overall Comments:

  • Consider adding docstrings to the new model and view for better documentation.
  • The template should handle cases where only link or link_text is provided, or consider making both fields required.
  • Consider making the icon field required instead of providing a default value.
Here's what I looked at during the review
  • 🟡 General issues: 3 issues found
  • 🟢 Security: all looks good
  • 🟢 Testing: all looks good
  • 🟢 Complexity: all looks good
  • 🟢 Documentation: all looks good

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment to tell me if it was helpful.

bartczak_tech/portfolio/views.py Show resolved Hide resolved
config/urls.py Show resolved Hide resolved
@bartczak-pa bartczak-pa merged commit 281cefa into master Sep 3, 2024
3 checks passed
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.

1 participant