title: Field 'person_id' expected a number but got ''
body: <p>i want to ask about my error , exactly the problem is that i pass a parameter <code>myid</code> to my method <code>newpost</code> , it is working good and i can print it before <code>if request.POST.get('postsubmit')</code> but after this if, when i print it or try to use it, it appears as blank <code>''</code>
  i really did not understand the problem
  please help</p>
  <pre><code>def newpost (request , myid ):
      
      print(myid)
      assert isinstance(request, HttpRequest)
      if request.method == 'POST' &amp; request.POST.get('postsubmit') :
           print(myid) 
           if request.POST.get('postsubmit'):
                print( myid)
                if myid not in blockedperson :
                  print (&quot;not blocked&quot;)
                  savepost=post()
                  savepost.person_id= myid
                  savepost.content=request.POST.get('postcontent')
                  savepost.p_date=dt.datetime.now()
                  savepost.save() 
                else :
                  blocked=&quot;sorry you are blocked , you can not share posts, contact with IT to more information at 437819147@kku.edu.sa&quot;
                  return render (request,'home.html',{'block':blocked})
      allpost=post.objects.all()
      allperson=person.objects.all()
      allstudent=student.objects.all()
      allteacher=teacher.objects.all()
      allcomp=company_rep.objects.all()
  
      return render (request,'home.html',{'posts':allpost , 'person':allperson,'student':allstudent,'teacher':allteacher,'comp':allcomp})
         
  </code></pre>
  <p>error is here (my id is 437819147) to be clear</p>
  <pre><code>Performing system checks...
  
  System check identified some issues:
  
  WARNINGS:
  app.company_rep.comp_id: (fields.W122) 'max_length' is ignored when used with IntegerField.
          HINT: Remove 'max_length' from field
  app.person.person_id: (fields.W122) 'max_length' is ignored when used with IntegerField.
          HINT: Remove 'max_length' from field
  app.post.person_id: (fields.W122) 'max_length' is ignored when used with IntegerField.
          HINT: Remove 'max_length' from field
  app.post.post_code: (fields.W122) 'max_length' is ignored when used with AutoField.
          HINT: Remove 'max_length' from field
  app.student.stu_id: (fields.W122) 'max_length' is ignored when used with IntegerField.
          HINT: Remove 'max_length' from field
  app.student.year_of_graduat: (fields.W122) 'max_length' is ignored when used with IntegerField.
          HINT: Remove 'max_length' from field
  app.teacher.teach_id: (fields.W122) 'max_length' is ignored when used with IntegerField.
          HINT: Remove 'max_length' from field
  
  System check identified 7 issues (0 silenced).
  
  You have 21 unapplied migration(s). Your project may not work properly until you apply the migrations for app(s): admin, auth, contenttypes, redirects, sessions, sites.
  Run 'python manage.py migrate' to apply them.
  April 05, 2021 - 17:13:00
  Django version 3.1.7, using settings 'kkuproject.settings'
  Starting development server at http://127.0.0.1:57872/
  Quit the server with CTRL-BREAK.
  [05/Apr/2021 17:13:01] &quot;GET / HTTP/1.1&quot; 200 7718
  Not Found: /favicon.ico
  [05/Apr/2021 17:13:01] &quot;GET /favicon.ico HTTP/1.1&quot; 404 2775
  437819147
  [05/Apr/2021 17:13:08] &quot;POST / HTTP/1.1&quot; 200 13734
  [05/Apr/2021 17:13:09] &quot;GET /static/css/Stylesheet1.css HTTP/1.1&quot; 200 3419
  [05/Apr/2021 17:13:09] &quot;GET /static/css/img/signout.png HTTP/1.1&quot; 200 14211
  [05/Apr/2021 17:13:09] &quot;GET /static/css/img/kku.png HTTP/1.1&quot; 200 86406
  [05/Apr/2021 17:13:09] &quot;GET /static/css/img/message.png HTTP/1.1&quot; 200 25921
  [05/Apr/2021 17:13:09] &quot;GET /static/css/img/search.png HTTP/1.1&quot; 200 7673
  [05/Apr/2021 17:13:09] &quot;GET /static/css/img/back.jpg HTTP/1.1&quot; 200 174108
  
  
  
  not blocked
  Internal Server Error: /0/
  Traceback (most recent call last):
    File &quot;C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python36_64\lib\site-packages\django\db\models\fields\__init__.py&quot;, line 1774, in get_prep_value
      return int(value)
  ValueError: invalid literal for int() with base 10: ''
  
  The above exception was the direct cause of the following exception:
  
  Traceback (most recent call last):
    File &quot;C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python36_64\lib\site-packages\django\core\handlers\exception.py&quot;, line 47, in inner
      response = get_response(request)
    File &quot;C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python36_64\lib\site-packages\django\core\handlers\base.py&quot;, line 181, in _get_response
      response = wrapped_callback(request, *callback_args, **callback_kwargs)
    File &quot;D:\kkuproject\kkuproject\app\views.py&quot;, line 176, in newpost
      savepost.save()
    File &quot;C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python36_64\lib\site-packages\django\db\models\base.py&quot;, line 754, in save
      force_update=force_update, update_fields=update_fields)
    File &quot;C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python36_64\lib\site-packages\django\db\models\base.py&quot;, line 792, in save_base
      force_update, using, update_fields,
    File &quot;C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python36_64\lib\site-packages\django\db\models\base.py&quot;, line 895, in _save_table
      results = self._do_insert(cls._base_manager, using, fields, returning_fields, raw)
    File &quot;C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python36_64\lib\site-packages\django\db\models\base.py&quot;, line 935, in _do_insert
      using=using, raw=raw,
    File &quot;C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python36_64\lib\site-packages\django\db\models\manager.py&quot;, line 85, in manager_method
      return getattr(self.get_queryset(), name)(*args, **kwargs)
    File &quot;C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python36_64\lib\site-packages\django\db\models\query.py&quot;, line 1254, in _insert
      return query.get_compiler(using=using).execute_sql(returning_fields)
    File &quot;C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python36_64\lib\site-packages\django\db\models\sql\compiler.py&quot;, line 1396, in execute_sql
      for sql, params in self.as_sql():
    File &quot;C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python36_64\lib\site-packages\django\db\models\sql\compiler.py&quot;, line 1341, in as_sql
      for obj in self.query.objs
    File &quot;C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python36_64\lib\site-packages\django\db\models\sql\compiler.py&quot;, line 1341, in &lt;listcomp&gt;
      for obj in self.query.objs
    File &quot;C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python36_64\lib\site-packages\django\db\models\sql\compiler.py&quot;, line 1340, in &lt;listcomp&gt;
      [self.prepare_value(field, self.pre_save_val(field, obj)) for field in fields]
    File &quot;C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python36_64\lib\site-packages\django\db\models\sql\compiler.py&quot;, line 1281, in prepare_value
      value = field.get_db_prep_save(value, connection=self.connection)
    File &quot;C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python36_64\lib\site-packages\django\db\models\fields\__init__.py&quot;, line 823, in get_db_prep_save
      return self.get_db_prep_value(value, connection=connection, prepared=False)
    File &quot;C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python36_64\lib\site-packages\django\db\models\fields\__init__.py&quot;, line 818, in get_db_prep_value
      value = self.get_prep_value(value)
    File &quot;C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python36_64\lib\site-packages\django\db\models\fields\__init__.py&quot;, line 1778, in get_prep_value
      ) from e
  ValueError: Field 'person_id' expected a number but got ''.
  [05/Apr/2021 17:13:13] &quot;POST /0/ HTTP/1.1&quot; 500 139491
  
  </code></pre>