Does migrate --fake updates django_migrations?

2024-03-22 Thread Jean-Baptiste Pressac
Hello, The doc says about migrate --fake: *Marks the migrations up to the target one (following the rules above) as applied, but without actually running the SQL to change your database schema. * But what is the operations behind this "marks"? Modifications to the django_migrations database t

dictsort with null values not working with Django 1.11

2018-03-16 Thread Jean-Baptiste Pressac
Hello, I am trying to migrate from Python 2, Django 1.8 to Python 3, Django 1.11 and I have a little problem with dictsort filter whith Null values. The following code was working on *Django 1.8, Python 2* : *Extract from models.py:* class Edition(models.Model): titre = models.CharField(max

Re: Display the __str__ or __unicode__ of an objet on deletion of one of its ManyToManyField

2016-12-02 Thread Jean-Baptiste Pressac
-02 15:06 GMT+01:00 Carlos Andre : > def __unicode__(self): > return "{0} [{1}]".format(self.titre[:200], self.id).__str__ > > def __unicode__(self): > return self.intitule.__str__ > > > 2016-12-02 10:03 GMT-03:00 Jean-Baptiste Pressac : > >&

Display the __str__ or __unicode__ of an objet on deletion of one of its ManyToManyField

2016-12-02 Thread Jean-Baptiste Pressac
Hello, On Django 1.8 + Python 2.7.11, I have declared in Django admin.py an oeuvre class with a ManyToManyField (types) to an TypeOeuvre class. class Oeuvre(models.Model): titre = models.CharField(max_length=510) types = models.ManyToManyField('TypeOeuvre',

Other side of a ManyToManyField through self field

2013-11-26 Thread Jean-Baptiste Pressac
Hello, I have a Person model with a ManyToManyField with itself through a Relation model to declare relations like Paul is Julie's uncle : class Relations(models.Model): id_person= models.ForeignKey('Person', related_name='relation_id_person') id_relation = models.ForeignKey('Person',