title: Django pre-save
body: <p>I'm working on my first project with Django ,it's a personal blog</p>
  <p>the story model has 'beginning' filed that is first 100 characters of the story itself</p>
  <p>I want to create beginning with pre_save but I got error always : in admin section when I add a story and leave the beginning blank ,Django say 'this field is required'!!</p>
  <p>this works very good in another file</p>
  <p>here is the code :</p>
  <pre><code>from django.db import models
  from django.db.models.signals import pre_save
  
  from my_blog_tags.models import Tag
  
  
  # Create your models here.
  
  class Story(models.Model):
      title = models.CharField(max_length=75)
      story = models.TextField()
      beginning = models.CharField(max_length=100)
      tags = models.ManyToManyField(Tag, blank=True)
      active = models.BooleanField(default=True)
      views = models.IntegerField(default=0)
  
      def __str__(self):
          return self.title
  
      class Meta:
          verbose_name = &quot;story&quot;
          verbose_name_plural = &quot;stories&quot;
  
  
  def story_pre_save(sender, instance: Story, *args, **kwargs):
      if not instance.beginning:
          story = str(instance.story)
          instance.beginning = story[:100]
  
  
  pre_save.connect(story_pre_save, sender=Story)
  
  </code></pre>
  <p>Screenshot from admin section:</p>
  <p><a href="https://uupload.ir/files/lo1i_screenshot_from_2020-12-20_20-25-04.png" rel="nofollow noreferrer"><img src="https://uupload.ir/files/lo1i_screenshot_from_2020-12-20_20-25-04.png" alt="1" /></a></p>