Commit 0af10064 authored by Ole Gabor Husebø's avatar Ole Gabor Husebø
Browse files

Gir challanges et navn, gir persons mulighet til å "ha" utfordringer.

parent fcd9168b
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<module type="PYTHON_MODULE" version="4"> <module type="PYTHON_MODULE" version="4">
<component name="NewModuleRootManager"> <component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$" /> <content url="file://$MODULE_DIR$" />
<orderEntry type="jdk" jdkName="Python 3.8" jdkType="Python SDK" /> <orderEntry type="jdk" jdkName="Python 3.7 (58)" jdkType="Python SDK" />
<orderEntry type="sourceFolder" forTests="false" /> <orderEntry type="sourceFolder" forTests="false" />
</component> </component>
</module> </module>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="DataSourceManagerImpl" format="xml" multifile-model="true">
<data-source source="LOCAL" name="db" uuid="cb8d3a08-b97d-4b53-ab1e-0baa3d8adf79">
<driver-ref>sqlite.xerial</driver-ref>
<synchronize>true</synchronize>
<jdbc-driver>org.sqlite.JDBC</jdbc-driver>
<jdbc-url>jdbc:sqlite:$PROJECT_DIR$/rodTraa/db.sqlite3</jdbc-url>
<driver-properties>
<property name="enable_load_extension" value="true" />
</driver-properties>
</data-source>
</component>
</project>
\ No newline at end of file
...@@ -3,5 +3,5 @@ ...@@ -3,5 +3,5 @@
<component name="JavaScriptSettings"> <component name="JavaScriptSettings">
<option name="languageLevel" value="ES6" /> <option name="languageLevel" value="ES6" />
</component> </component>
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.8" project-jdk-type="Python SDK" /> <component name="ProjectRootManager" version="2" project-jdk-name="Python 3.7 (58)" project-jdk-type="Python SDK" />
</project> </project>
\ No newline at end of file
...@@ -8,6 +8,11 @@ ...@@ -8,6 +8,11 @@
<img style=" max-width: 100%; max-height: 400px " src="{{ post.image.url }}"> <img style=" max-width: 100%; max-height: 400px " src="{{ post.image.url }}">
</div> </div>
<div style="display: block; margin-left: auto; margin-right: auto; width: 60% ">{{ post.text }}</div> <div style="display: block; margin-left: auto; margin-right: auto; width: 60% ">{{ post.text }}</div>
<div style="display: block; margin-left: auto; margin-right: auto; padding-top: 50px; width:60%">
<form>
<button type="submit" onClick="window.location.reload()"> Prøv Utfordring </button>
</form>
</div>
</div> </div>
{% endfor %} {% endfor %}
{% endblock %} {% endblock %}
\ No newline at end of file
...@@ -9,6 +9,7 @@ class PostForm(forms.ModelForm): ...@@ -9,6 +9,7 @@ class PostForm(forms.ModelForm):
exclude = ("time", "post_owner") exclude = ("time", "post_owner")
class ChallengeForm(forms.ModelForm): class ChallengeForm(forms.ModelForm):
class Meta: class Meta:
model = Challange model = Challange
fields = ("text", "image") fields = ("text", "image")
......
...@@ -13,6 +13,7 @@ class Post(models.Model): ...@@ -13,6 +13,7 @@ class Post(models.Model):
post_owner = models.ForeignKey(User, on_delete= models.CASCADE, null=True) post_owner = models.ForeignKey(User, on_delete= models.CASCADE, null=True)
class Challange(models.Model): class Challange(models.Model):
challangeName = models.CharField(default = "",null=False, blank=False,max_length=100)
text = models.TextField(null=True, blank=True, max_length=4000) text = models.TextField(null=True, blank=True, max_length=4000)
image = models.ImageField(null=False) image = models.ImageField(null=False)
time = models.DateTimeField(null=True) time = models.DateTimeField(null=True)
......
from django.db import models from django.db import models
from django.contrib.auth.models import User from django.contrib.auth.models import User
from apps.feed.models import Challange
# Create your models here. # Create your models here.
...@@ -8,6 +9,7 @@ class PrivatePerson(models.Model): ...@@ -8,6 +9,7 @@ class PrivatePerson(models.Model):
user = models.ForeignKey(User, on_delete= models.CASCADE, null= False) user = models.ForeignKey(User, on_delete= models.CASCADE, null= False)
profilePicture = models.ImageField(null=True, blank=True) profilePicture = models.ImageField(null=True, blank=True)
about = models.TextField(null=True, blank=True, max_length=400) about = models.TextField(null=True, blank=True, max_length=400)
currentChallenge = models.ForeignKey(Challange, on_delete=models.SET_NULL, null=True) #gir privat person en mulighet til å "ha" en utfordring
class Company(models.Model): class Company(models.Model):
user = models.ForeignKey(User, on_delete= models.CASCADE, null=False) user = models.ForeignKey(User, on_delete= models.CASCADE, null=False)
......
Supports Markdown
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