Ticket #5000: table-prefix.diff

File table-prefix.diff, 740 bytes (added by vitja <dummylink@…>, 8 years ago)
  • db/models/options.py

     
    7878
    7979        # If the db_table wasn't provided, use the app_label + module_name.
    8080        if not self.db_table:
    81             self.db_table = "%s_%s" % (self.app_label, self.module_name)
     81            try:
     82                prefix = settings.DATABASE_TABLE_PREFIX
     83            except AttributeError:
     84                prefix = ''
     85
     86            self.db_table = "%s%s_%s" % (prefix, self.app_label, self.module_name)
    8287            self.db_table = truncate_name(self.db_table,
    8388                                          backend.get_max_name_length())
    8489
Back to Top