Django

Code

Ticket #708: 708-1.diff

File 708-1.diff, 0.6 kB (added by mattmcc, 1 year ago)
  • django/db/backends/postgresql/operations.py

    old new  
    2727    def deferrable_sql(self): 
    2828        return " DEFERRABLE INITIALLY DEFERRED" 
    2929 
     30    def field_cast_sql(self, db_type): 
     31        if db_type == 'inet': 
     32            return 'CAST(%s AS TEXT)' 
     33        return '%s' 
     34 
    3035    def last_insert_id(self, cursor, table_name, pk_name): 
    3136        cursor.execute("SELECT CURRVAL('\"%s_%s_seq\"')" % (table_name, pk_name)) 
    3237        return cursor.fetchone()[0]