Commit 6a561ed4 authored by Jan Ericsson Ong Ang's avatar Jan Ericsson Ong Ang

Jan

Updated the models.py in the homepage too fit the Lab 2 specs
parent 3697ef8a
models.py
\ No newline at end of file
......@@ -4,7 +4,7 @@
<content url="file://$MODULE_DIR$">
<excludeFolder url="file://$MODULE_DIR$/myenv" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="jdk" jdkName="Python 3.10" jdkType="Python SDK" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
<component name="PyDocumentationSettings">
......
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.10 (janang_music) (2)" project-jdk-type="Python SDK" />
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.10" project-jdk-type="Python SDK" />
<component name="PyCharmProfessionalAdvertiser">
<option name="shown" value="true" />
</component>
......
from django.db import models
# Create your models here.
class IndexCard(models.Model):
artist_name=models.CharField(max_length=420)
monthly_listeners = models.IntegerField(default=0)
class Artist(models.Model):
artist_name = models.CharField(max_length=50)
monthly_listeners = models.IntegerField(default = 0)
birth_name = models.CharField(max_length= 50, default = "")
bio = models.CharField(max_length = 700, default = "")
def __str__(self):
return self.artist_name
class Album(models.Model):
album_name = models.CharField(max_length=50)
artist = models.CharField(max_length=50)
description = models.CharField(max_length=500)
release_date = models.DateTimeField("date released")
label = models.CharField(max_length= 50, default = "")
song_count = models.CharField(max_length= 50, default = "")
def __str__(self):
return self.album_name
class Song(models.Model):
song_title = models.CharField(max_length = 50)
artist = models.CharField(max_length = 50)
album = models.CharField(max_length = 50)
song_length = models.IntegerField()
\ No newline at end of file
song_length = models.IntegerField(default = 0)
music_video = models.BooelanField(default = False)
lyrics = models.TextField(default = "")
def __str__(self):
return self.song_title
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment