Models #1

Open
wants to merge 4 commits into
base: master
from
File filter...
Filter file types
Jump to file or symbol
Failed to load files and symbols.
+80 −1
Diff settings

Always

Just for now

Prev

added models

  • Loading branch information...
Rguy
Rguy committed Dec 7, 2018
commit 9ddbee4ccd03fb7c35b9636276e874f60d2646ac
Copy path View file
@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="PYTHON_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$" />
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
<component name="TemplatesService">
<option name="TEMPLATE_FOLDERS">
<list>
<option value="$MODULE_DIR$/reddit_clone_project/client/node_modules/@svgr/core/lib/templates" />
</list>
</option>
</component>
<component name="TestRunnerService">
<option name="PROJECT_TEST_RUNNER" value="Unittests" />
</component>
</module>
Copy path View file
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Encoding" addBOMForNewFiles="with NO BOM" />
</project>
Copy path View file
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="JavaScriptSettings">
<option name="languageLevel" value="ES6" />
</component>
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.7" project-jdk-type="Python SDK" />
</project>
Copy path View file
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/django-reddit-clone.iml" filepath="$PROJECT_DIR$/.idea/django-reddit-clone.iml" />
</modules>
</component>
</project>
Copy path View file
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$" vcs="Git" />
</component>
</project>
Copy path View file
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectFrameBounds">
<option name="x" value="530" />
<option name="y" value="23" />
<option name="width" value="1049" />
<option name="height" value="772" />
</component>
<component name="PropertiesComponent">
<property name="WebServerToolWindowFactoryState" value="false" />
<property name="last_opened_file_path" value="$PROJECT_DIR$" />
</component>
</project>
@@ -1,3 +1,26 @@
from datetime import date

from django.db import models

# Create your models here.

class Posts(models.Model):
created_At = models.DateField(default=date.today)
title = models.CharField(max_length=100)
photo_url = models.TextField()
content = models.TextField()
site_url = models.TextField()
vote_total = models.TextField()

def __str__(self):
return self.name


class Comments(models.Model):
created_At = models.DateField(default=date.today)
content = models.TextField()
vote_total = models.TextField()
post = models.ForeignKey(Posts, on_delete=models.CASCADE, related_name='posts')

def __str__(self):
return self.name

ProTip! Use n and p to navigate between commits in a pull request.