    def get_nextautoincrement( mymodel ):
        from django.db import connection
        cursor = connection.cursor()
        cursor.execute( "SELECT Auto_increment FROM information_schema.tables WHERE table_name='%s';" % \
                        mymodel._meta.db_table)
        row = cursor.fetchone()
        cursor.close()
        return row[0]