Compare commits
No commits in common. "f6a4745dfd4d96441dc0d31920c1f4fe3ca3702d" and "3cc8af47e5ccb28c929cfb17dddf22e952792364" have entirely different histories.
f6a4745dfd
...
3cc8af47e5
2 changed files with 3 additions and 4 deletions
|
@ -20,7 +20,7 @@ class Camera(models.Model):
|
|||
info = models.CharField(max_length=100, null=True)
|
||||
|
||||
def __str__(self):
|
||||
return f"{self.flash} - {str(self.megapixel)} - {self.info}"
|
||||
return f" {self.flash} - {str(self.megapixel)} - {self.info}"
|
||||
|
||||
class Screen(models.Model):
|
||||
size = models.CharField(max_length=500, null=True)
|
||||
|
@ -31,7 +31,7 @@ class Screen(models.Model):
|
|||
technology = models.CharField(max_length=100)
|
||||
|
||||
def __str__(self):
|
||||
return f"{str(self.size_in)} - {str(self.density)} - {str(self.technology)}"
|
||||
return f"{self.size_in} - {self.density} - {self.technology}"
|
||||
|
||||
class Device(models.Model):
|
||||
#architecture = models.JSONField(default=dict)
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
from rest_framework import serializers
|
||||
|
||||
from suitablephones.models import Bluetooth, Camera, Device, Screen
|
||||
from suitablephones.models import Bluetooth, Camera, Device
|
||||
|
||||
|
||||
class CameraSerializer(serializers.ModelSerializer):
|
||||
|
@ -22,7 +22,6 @@ class ScreenSerializer(serializers.ModelSerializer):
|
|||
class DeviceSerializer(serializers.ModelSerializer):
|
||||
bluetooth = BluetoothSerializer(many=False, read_only=True)
|
||||
cameras = CameraSerializer(many=True, read_only=True)
|
||||
screen = ScreenSerializer(many=True, read_only=True)
|
||||
|
||||
class Meta:
|
||||
model = Device
|
||||
|
|
Loading…
Reference in a new issue