Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pull request1 #12

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ staticfiles
local_settings.py
db.sqlite3
*~
*.env
*.py[co]
settings_secret.py
.idea/*
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,3 @@ later works in same gallery group are available, you get links to scroll over to
The live website has been deployed to Heroku and can be viewed at
https://paivisuomela.herokuapp.com


38 changes: 16 additions & 22 deletions gallery/migrations/0001_initial.py
Original file line number Diff line number Diff line change
@@ -1,41 +1,35 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
# Generated by Django 4.2.3 on 2023-07-11 20:55

from django.db import models, migrations
from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

initial = True

dependencies = [
]

operations = [
migrations.CreateModel(
name='Artwork',
name='GalleryGroup',
fields=[
('id', models.AutoField(serialize=False, primary_key=True, verbose_name='ID', auto_created=True)),
('title', models.CharField(max_length=200)),
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('title', models.CharField(default='', max_length=100)),
('description', models.TextField()),
('published_date', models.DateTimeField(null=True, blank=True)),
('art', models.ImageField(upload_to='media/art')),
('slug', models.SlugField(unique=True)),
],
options={
},
bases=(models.Model,),
),
migrations.CreateModel(
name='Group',
name='Artwork',
fields=[
('id', models.AutoField(serialize=False, primary_key=True, verbose_name='ID', auto_created=True)),
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('title', models.CharField(max_length=200)),
('description', models.TextField()),
('published_date', models.DateTimeField(blank=True)),
('art', models.ImageField(upload_to='art')),
('group', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='gallery.gallerygroup')),
],
options={
},
bases=(models.Model,),
),
migrations.AddField(
model_name='artwork',
name='group',
field=models.ForeignKey(to='gallery.Group'),
preserve_default=True,
),
]
18 changes: 18 additions & 0 deletions gallery/migrations/0002_alter_artwork_description.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Generated by Django 4.2.3 on 2023-07-12 00:26

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('gallery', '0001_initial'),
]

operations = [
migrations.AlterField(
model_name='artwork',
name='description',
field=models.TextField(default=''),
),
]
26 changes: 0 additions & 26 deletions gallery/migrations/0002_auto_20150427_1134.py

This file was deleted.

18 changes: 18 additions & 0 deletions gallery/migrations/0003_alter_gallerygroup_description.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Generated by Django 4.2.3 on 2023-07-12 00:27

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('gallery', '0002_alter_artwork_description'),
]

operations = [
migrations.AlterField(
model_name='gallerygroup',
name='description',
field=models.TextField(default=''),
),
]
19 changes: 0 additions & 19 deletions gallery/migrations/0003_auto_20150427_1134.py

This file was deleted.

23 changes: 23 additions & 0 deletions gallery/migrations/0004_alter_artwork_description_and_more.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Generated by Django 4.2.3 on 2023-07-12 00:27

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('gallery', '0003_alter_gallerygroup_description'),
]

operations = [
migrations.AlterField(
model_name='artwork',
name='description',
field=models.TextField(blank=True, default=''),
),
migrations.AlterField(
model_name='gallerygroup',
name='description',
field=models.TextField(blank=True, default=''),
),
]
33 changes: 0 additions & 33 deletions gallery/migrations/0004_auto_20150427_1254.py

This file was deleted.

19 changes: 19 additions & 0 deletions gallery/migrations/0005_artwork_featured.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Generated by Django 4.2.3 on 2023-07-12 00:51

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('gallery', '0004_alter_artwork_description_and_more'),
]

operations = [
migrations.AddField(
model_name='artwork',
name='featured',
field=models.BooleanField(default=False, help_text='Feature this artwork on the home page'),
preserve_default=False,
),
]
20 changes: 0 additions & 20 deletions gallery/migrations/0005_gallerygroup_slug.py

This file was deleted.

19 changes: 0 additions & 19 deletions gallery/migrations/0006_auto_20150428_1116.py

This file was deleted.

19 changes: 0 additions & 19 deletions gallery/migrations/0007_auto_20150428_1131.py

This file was deleted.

10 changes: 5 additions & 5 deletions gallery/models.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
from django.db import models
from django.core.urlresolvers import reverse
from django.urls import reverse
from django.template.defaultfilters import slugify


class GalleryGroup(models.Model):

title = models.CharField(max_length=100, default='')
description = models.TextField()
description = models.TextField(blank=True, default='')
slug = models.SlugField(unique=True)

def __str__(self):
Expand All @@ -22,10 +21,11 @@ def get_absolute_url(self):

class Artwork(models.Model):
title = models.CharField(max_length=200)
description = models.TextField()
description = models.TextField(blank=True, default='')
published_date = models.DateTimeField(blank=True)
art = models.ImageField(upload_to="art")
group = models.ForeignKey('GalleryGroup')
group = models.ForeignKey('GalleryGroup', on_delete=models.CASCADE)
featured = models.BooleanField(help_text='Feature this artwork on the home page')

def publish(self):
self.save()
Expand Down
3 changes: 1 addition & 2 deletions gallery/templates/404.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{% extends 'blog/base.html' %}

{% extends 'base.html' %}

{% block content %}
<p><br/><p>
Expand Down
Loading