Ticket #12728: unenlightened_workaround.diff

File unenlightened_workaround.diff, 810 bytes (added by pragmar, 14 years ago)

workaround to achieve successful loaddata given GenericRelation and abstract class.

  • .py

    old new  
    122122                        style.SQL_TABLE(qn(model._meta.db_table))))
    123123                    break # Only one AutoField is allowed per model, so don't bother continuing.
    124124            for f in model._meta.many_to_many:
    125                 if not f.rel.through:
     125                if not f.rel.through and not f.__class__.__name__ == 'GenericRelation':
    126126                    output.append("%s setval('%s', coalesce(max(%s), 1), max(%s) %s null) %s %s;" % \
    127127                        (style.SQL_KEYWORD('SELECT'),
    128128                        style.SQL_FIELD(qn('%s_id_seq' % f.m2m_db_table())),
Back to Top