This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Backend Developer Interview Task - Crypto Price Tracker | |
TASK: | |
Build a FastAPI application that fetches cryptocurrency prices from an external API | |
and stores them in a database with analytical endpoints. | |
TIME: 45 minutes | |
SETUP: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.db import models | |
class Phone(models.Model): | |
MANUFACTURERS = {'samsung': 'PhoneSamsung', | |
'apple': 'PhoneApple'} | |
name = models.CharField(max_length=128) | |
manufacturer = models.CharField(max_length=128, default='samsung') | |
unique_params = models.ForeignKey(MANUFACTURERS[str(manufacturer)], | |
on_delete=models.CASCADE) |