Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: learn-co-curriculum/python-p3-freebie-tracker
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: main
Choose a base ref
...
head repository: silvanos-eric/python-p3-freebie-tracker
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: main
Choose a head ref
Checking mergeability… Don’t worry, you can still create the pull request.
  • 8 commits
  • 9 files changed
  • 1 contributor

Commits on Sep 19, 2024

  1. feat: add Freebie model and seed script

    - Add Faker package to Pipfile
    - Create Alembic migration for Freebie model
    - Define Freebie model in models.py
    - Implement seed script to generate fake data for Freebie model
    codexshell committed Sep 19, 2024
    Configuration menu
    Copy the full SHA
    be93f41 View commit details
    Browse the repository at this point in the history
  2. feat(models): add association table for companies and devs

    - Create a new Alembic migration to add the `companies_devs` association table.
    - Update `models.py` to define the `companies_devs` table and add relationships between `Company`
      and `Dev`.
    - Modify `seed.py` to include seeding logic for `Company` and `Dev` models and establish
      many-to-many relationships through `companies_devs`.
    
    This change enhances the database schema to support many-to-many relationships between companies and
    developers, facilitating more complex queries and data associations.
    codexshell committed Sep 19, 2024
    Configuration menu
    Copy the full SHA
    0a72d49 View commit details
    Browse the repository at this point in the history
  3. feat: make company_id non-nullable

    - Updated freebies.db binary file.
    - Created migration to make company_id non-nullable.
    - Updated Freebie model to set company_id as non-nullable.
    - Modified seed script to delete all Company and Dev entries before seeding data and to assign
      random company_id to Freebie objects.
    codexshell committed Sep 19, 2024
    Configuration menu
    Copy the full SHA
    0d4399e View commit details
    Browse the repository at this point in the history
  4. feat(models): add session management and new methods

    - Import `create_engine` and `sessionmaker` from SQLAlchemy
    - Create engine and session for database interactions
    - Add `oldest_company` class method to `Company` model
    - Add `give_freebie` method to `Company` model with type checks and error handling
    - Define `FreebieAlreadyGivenError` exception
    codexshell committed Sep 19, 2024
    Configuration menu
    Copy the full SHA
    c2a8198 View commit details
    Browse the repository at this point in the history
  5. feat(models): add methods to give away and check receipt of freebies

    - Added `received_one` method to check if a `Dev` has received a specific item
    - Added `give_away` method to transfer a freebie to another `Dev`
    - Added `FreebieNotMineToGiveError` exception for unauthorized transfer attempts
    codexshell committed Sep 19, 2024
    Configuration menu
    Copy the full SHA
    a29372c View commit details
    Browse the repository at this point in the history
  6. feat(debug): enhance debug script with session management and queries

    Added session management using SQLAlchemy's sessionmaker to the `debug.py`. Included queries to:
    1. Retrieve and print the company name for the first freebie.
    2. Retrieve and print a collection of all freebies for the first company.
    codexshell committed Sep 19, 2024
    Configuration menu
    Copy the full SHA
    9f428a2 View commit details
    Browse the repository at this point in the history
  7. feat(debug): enhance debug script with error handling and give_freebi…

    …e tests
    
    - Import FreebieAlreadyGivenError and FreebieNotMineToGiveError in debug.py
    - Add tests for FreebieNotMineToGiveError and give_freebie function in debug.py
    - Fix give_freebie method in models.py to include self parameter and raise FreebieNotMineToGiveError
    codexshell committed Sep 19, 2024
    Configuration menu
    Copy the full SHA
    93b2d29 View commit details
    Browse the repository at this point in the history
  8. docs: add docstrings to models.py methods and improve existing ones

    Added and improved docstrings for methods in the `Company`, `Dev`, and
    `Freebie` classes in `models.py` to enhance code readability and provide
    detailed information about method functionality, parameters, and
    exceptions.
    
    - Added detailed docstrings to `Company.oldest_company` and `Company.give_freebie`
    - Added detailed docstrings to `Dev.received_one` and `Dev.give_away`
    - Improved existing docstrings to follow a consistent format
    - Added type hints and descriptions for parameters and return values
    - Added exception descriptions for methods that raise exceptions
    codexshell committed Sep 19, 2024
    Configuration menu
    Copy the full SHA
    3f03b06 View commit details
    Browse the repository at this point in the history
Loading