R
R
Rustem Vorozheikin2015-09-07 20:06:28
Django
Rustem Vorozheikin, 2015-09-07 20:06:28

What does user.save(using=self._db) mean?

Good afternoon.
Went through part of the django documentation yesterday. There is an example at the very bottom.
In general, I can’t understand what the parameter and its value mean using=self._dbin the code:

...
 def create_superuser(self, email, date_of_birth, password):
        """
        Creates and saves a superuser with the given email, date of
        birth and password.
        """
        user = self.create_user(email,
            password=password,
            date_of_birth=date_of_birth
        )
        user.is_admin = True
        user.save(using=self._db)
        return user
....

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question