title: create many to many relationship in shell
body: <p>here is my model :<br>
  I would like to initialise it with a script<br>
  A page contain a template <br>
  </p>
  
  <pre><code>class Template(models.Model):
      Nom = models.CharField(max_length=200, blank=True)
      contenu = models. TextField(max_length=80000, blank=True)
      Note_divers = models.ManyToManyField('note.Note_divers', related_name='Template_Note_divers_notes_Note_divers', blank=True)
  
      def ___str__(self):
          return self.Nom
  
      def __unicode__(self):
          return self.Nom
  
  
  class Page(models.Model):
      Template = models.ManyToManyField(Template, null=True, blank=True)
      self_url = models.ManyToManyField('lien.Lien', related_name='pages_lien_self', null=True, blank=True)
      Categorie = models.ManyToManyField(Categorie_Page, null=True, blank=True)
      Liens = models.ManyToManyField('lien.Lien', related_name="Liens sur la page", null=True, blank=True)
      Nom = models.CharField(max_length=200)
  </code></pre>
  
  <p>and my initialisation script :<br>
  The main goal is to create certain pages<br></p>
  
  <pre class="lang-py prettyprint-override"><code>    import os
  
      os.environ['DJANGO_SETTINGS_MODULE'] = 'settings'
  
      from django.db.models.loading import cache as model_cache
  
      if not model_cache.loaded:
          model_cache.get_models()
  
      from pages.models import Page, Template
      import settings
  
      t1 = Template(Nom="template_index",contenu="""bienvenue&lt;br&gt;&lt;a href="../logout/"&gt;logout&lt;/a&gt;""")
      t1.save()
      p = Page(Nom="index",Template=t1)
      p.save()
  
      t2 = Template(Nom="template_indexvide", contenu="""
              &lt;form method="post" action="."&gt;{% csrf_token %}
              &lt;input type="text" name="username"&gt;
              &lt;input type="password" name="password"&gt;
              &lt;input type="submit" value="login" /&gt;
              &lt;/form&gt;"""
          )
      t2.save()
      p = Page(Nom="indexvide",Template=t2)
      p.save()
  </code></pre>
  
  <p>And it gave to me :</p>
  
  <pre><code>   TypeError: 'Template' is an invalid keyword argument for this function
  </code></pre>
  
  <p>Regards
  Bussiere</p>