title: Model Placement
body: <p>It is necessary to place posts on the site so that they can be created and edited, but in the site design the posts are separated by sliders and other elements, how is it possible to implement this in such a way that the other layout elements are, so to speak, ignored?</p>
  
  <p>I tried to solve this problem by creating additional models, that is, the posts before the separating elements (sliders in this case) should be taken in one class, and the subsequent ones in another and further edited in such a way. Of course this is a crutch, but I don’t know how to configure it, because together these models are not displayed for me, that is, either one or the other. I also created a separate class for the Main Post, because it has a different design and, as a matter of fact, always hangs in the top, but of course it’s ideal to implement such that the model has such an attribute that you can indicate to a specific post that it is the main and most located at the beginning of the site.</p>
  
  <p>Here is my code (let's say that we added Posts_one, Posts_two, if we talk about the case of using a crutch, which I also failed):</p>
  
  <p><strong>models.py</strong>:</p>
  
  <pre><code>    from django.conf import settings
      from django.db import models
      from django.utils import timezone
      from django.contrib.auth.models import User
  
      class Toppost(models.Model):
          title = models.CharField(max_length=200)
          caption = models.CharField(max_length=150, default='краткое описание поста')
          text = models.TextField()
          created_date = models.DateTimeField(default=timezone.now)
          published_date = models.DateTimeField(blank=True, null=True)
  
          def publish(self):
              self.published_date = timezone.now()
              self.save()
  
          def __str__(self):
              return self.title
  
  
      class Post(models.Model):
          title = models.CharField(max_length=200)
          caption = models.CharField(max_length=150, default='краткое описание поста')
          text = models.TextField()
          created_date = models.DateTimeField(default=timezone.now)
          published_date = models.DateTimeField(blank=True, null=True)
  
          def publish(self):
              self.published_date = timezone.now()
              self.save()
  
          def __str__(self):
              return self.title
  </code></pre>
  
  <p><strong>views.py</strong>:</p>
  
  <pre><code>from django.shortcuts import render, get_object_or_404
  from django.utils import timezone
  from .models import Post, Toppost
  
  def posts_list(request):
      posts = Post.objects.filter(published_date__lte=timezone.now()).order_by('published_date')
      return render(request, 'blog/posts_list.html', {'posts': posts})
  
      topposts = Toppost.objects.filter(published_date__lte=timezone.now()).order_by('published_date')
      return render(request, 'blog/posts_list.html', {'topposts': topposts})
  </code></pre>
  
  <p>I also attach a screenshot with a diagram of how it should look.  Ideally, of course, it’s interesting to know how this can be implemented so that all this is one Post model and does not destroy the layout of the site and that you can select any post as Main_Post.</p>
  
  <p><a href="https://i.stack.imgur.com/2ZXJL.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/2ZXJL.png" alt="enter image description here"></a></p>