I have one more problem, the code below is not working
zdjecia = Gallery.objects.get(title=Artykul.tytul).public()
It's my Models:
class Artykul(models.Model):
tytul = models.CharField(max_length=30, null=False, blank=False)
and it's photologue models:
class Gallery(models.Model):
date_added = models.DateTimeField(_('date published'),
default=now)
title = models.CharField(_('title'),
max_length=250,
unique=True)
I imported in Views:
from photologue.models import Gallery
but it's still wrong:
issue #1:
type object 'Artykul' has no attribute 'tytul'
I add apostrophes like that: 'Artykul.tytul'
issue #2
Gallery matching query does not exist.
but i have article (Artykul) named jol and gallery with the same name
Gallery.title=Artykul.tytul giving issue #3:
File "/home/mateusz/projekt/artykul/views.py", line 25
zdjecia = Gallery.objects.get(Gallery.title=Artykul.tytul).public()
^
SyntaxError: keyword can't be an expression