Project-Stage-Academy / UA1244_beta

1 stars 0 forks source link

Define Django Models for Startups, and Investors #63

Open mehalyna opened 3 weeks ago

mehalyna commented 3 weeks ago

Define Django Models for Startups, and Investors

Create Django models for the User, Startup, and Investor entities that reflect the provided database schema. Ensure all fields and relationships are accurately represented within the Django ORM.

Task Description:

  1. Define the Startup Model

    • Action: In your startups app, define a Startup model with fields as per the schema and a foreign key relationship to the User model (user_id).
    • Fields:
      • Use models.ForeignKey to link user_id to the User model with on_delete=models.CASCADE.
      • For the startup_logo field, consider using models.ImageField or models.BinaryField depending on how you wish to handle image data.
      • Use appropriate field types for other fields, such as models.CharField and models.TextField.
  2. Define the Investor Model

    • Action: In your investors app, create an Investor model that includes the necessary fields and a foreign key to User.
    • Fields:
      • As with the Startup model, ensure there is a models.ForeignKey linking to the User model.
      • Decide whether to use models.ImageField or models.BinaryField for investor_logo.
      • Use suitable field types for other attributes, mirroring the structure used in the Startup model.
  3. Define the Project Model

    • Action: Assuming a projects app exists, define a Project model including a foreign key to both Startup and Investor.
    • Fields:
      • Define two models.ForeignKey relationships, one to Startup and one to Investor.
      • Include fields for description, business_plan (could be a models.FileField if storing documents), media_files, status, created_at, last_update, and duration.

Considerations:

Deliverables: