Beispiel #1
0
    def handle(self, *args, **options):
        """
        Iterates a command over all registered schemata.
        """
        for domain_name in settings.SCHEMATA_DOMAINS:

            print
            print self.style.NOTICE("=== Switching to domain ") \
                + self.style.SQL_TABLE(domain_name) \
                + self.style.NOTICE(" then calling %s:" % self.COMMAND_NAME)

            # sets the schema for the connection
            connection.set_schemata_domain(domain_name)

            # call the original command with the args it knows
            call_command(self.COMMAND_NAME, *args, **options)
Beispiel #2
0
    def handle(self, *args, **options):
        """
        Iterates a command over all registered schemata.
        """
        for domain_name in settings.SCHEMATA_DOMAINS:

            print
            print self.style.NOTICE("=== Switching to domain ") \
                + self.style.SQL_TABLE(domain_name) \
                + self.style.NOTICE(" then calling %s:" % self.COMMAND_NAME)

            # sets the schema for the connection
            connection.set_schemata_domain(domain_name)

            # call the original command with the args it knows
            call_command(self.COMMAND_NAME, *args, **options)
Beispiel #3
0
 def process_request(self, request):
     hostname_without_port = request.get_host().split(':')[0]
     request.schema_domain_name = hostname_without_port
     request.schema_domain = connection.set_schemata_domain(
         request.schema_domain_name)
Beispiel #4
0
 def process_request(self, request):
     hostname_without_port = request.get_host().split(':')[0]
     request.schema_domain_name = hostname_without_port
     request.schema_domain = connection.set_schemata_domain(request.schema_domain_name)