How can I declare the previous or next attributes pointing to the same class type ?
I couln't find the answer in official documentation
In the models.py below I have just written "scenes" for previous and next
from pickle import TRUE
from django.db import models
from django.contrib.auth.models import User
class scenes(models.Model):
name = models.CharField('Event name', max_length=120)
record_date = models.DateTimeField('Event date')
manager = models.ForeignKey(User, blank=True, null=True, on_delete=models.SET_NULL)
description = models.TextField(blank=True)
previous = models.ForeignKey(scenes, blank=True, null=True, on_delete=models.SET_NULL)
next = models.ForeignKey(scenes, blank=True, null=True, on_delete=models.SET_NULL)
def __str__(self):
return self.name