Search Results

Search found 2 results on 1 pages for 'amann'.

Page 1/1 | 1 

  • Exception with Subsonic 2.2, SQLite and Migrations

    - by Holger Amann
    Hi, I'm playing with Migrations and created a simple migration like public class Migration001 : Migration { public override void Up() { TableSchema.Table testTable = CreateTableWithKey("TestTable"); } public override void Down() { } } after executing sonic.exe migrate I'm getting the following output: Setting ConfigPath: 'App.config' Building configuration from c:\tmp\MigrationTest\MigrationTest\App.config Adding connection to SQLiteProvider Found 1 migration files Current DB Version is 0 Migrating to 001_Init (1) There was an error running migration (001_Init): SQLite error near "IDENTITY": syntax error Stack Trace: at System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] argum ents, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner) at System.RuntimeMethodHandle.InvokeMethodFast(Object target, Object[] argume nts, Signature sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwn er) at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invoke Attr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisib ilityChecks) at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invoke Attr, Binder binder, Object[] parameters, CultureInfo culture) at SubSonic.CodeRunner.RunAndExecute(ICodeLanguage lang, String sourceCode, S tring methodName, Object[] parameters) in D:\@SubSonic\SubSonic\SubSonic.Migrati ons\CodeRunner.cs:line 95 at SubSonic.Migrations.Migrator.ExecuteMigrationCode(String migrationFile) in D:\@SubSonic\SubSonic\SubSonic.Migrations\Migrator.cs:line 177 at SubSonic.Migrations.Migrator.Migrate() in D:\@SubSonic\SubSonic\SubSonic.M igrations\Migrator.cs:line 141 Any hints?

    Read the article

  • How to get the related_name of a many-to-many-field?

    - by amann
    I am trying to get the related_name of a many-to-many-field. The m2m-field is located betweeen the models "Group" and "Lection" and is declared in the group-model as following: lections = models.ManyToManyField(Lection, blank=True) The field looks like this: <django.db.models.fields.related.ManyToManyField object at 0x012AD690> The print of field.__dict__ is: {'_choices': [], '_m2m_column_cache': 'group_id', '_m2m_name_cache': 'group', '_m2m_reverse_column_cache': 'lection_id', '_m2m_reverse_name_cache': 'lection', '_unique': False, 'attname': 'lections', 'auto_created': False, 'blank': True, 'column': 'lections', 'creation_counter': 71, 'db_column': None, 'db_index': False, 'db_table': None, 'db_tablespace': '', 'default': <class django.db.models.fields.NOT_PROVIDED at 0x00FC8780>, 'editable': True, 'error_messages': {'blank': <django.utils.functional.__proxy__ object at 0x00FC 7B50>, 'invalid_choice': <django.utils.functional.__proxy__ object at 0x00FC7A50>, 'null': <django.utils.functional.__proxy__ object at 0x00FC7 A70>}, 'help_text': <django.utils.functional.__proxy__ object at 0x012AD6F0>, 'm2m_column_name': <function _curried at 0x012A88F0>, 'm2m_db_table': <function _curried at 0x012A8AF0>, 'm2m_field_name': <function _curried at 0x012A8970>, 'm2m_reverse_field_name': <function _curried at 0x012A89B0>, 'm2m_reverse_name': <function _curried at 0x012A8930>, 'max_length': None, 'name': 'lections', 'null': False, 'primary_key': False, 'rel': <django.db.models.fields.related.ManyToManyRel object at 0x012AD6B0>, 'related': <RelatedObject: mymodel:group related to lections>, 'related_query_name': <function _curried at 0x012A8670>, 'serialize': True, 'unique_for_date': None, 'unique_for_month': None, 'unique_for_year': None, 'validators': [], 'verbose_name': 'lections'} Now the field should be accessed via a lection-instance. So this is done by lection.group_set But i need to access it dynamically, so there is the need to get the related_name attribute from somewhere. Here in the documentation, there is a note that it is possible to access ManyToManyField.related_name, but this doesn't work for my somehow.. Help would be a lot appreciated. Thanks in advance.

    Read the article

1