django-pb-model
django-pb-model copied to clipboard
repeated sintax on proto appears a string instead of empty array after migration
i have a proto :
enumx{
VALUE1 = 0;
VALUE2 = 0;
}
proto_test{
repeated enumx variable_test;
}
django model
class modelx(ProtoBufMixin, Model):
pb_model = proto_test_pb2.model
pb_2_dj_fields = "__all__"
when i do a migration , I expected as a result to created an empty array on variable_test
, however after the migration I got a empty string. How can I solve this problem? .
As you can see the default on migration shows as empty array, however I got a empty string
class Migration(migrations.Migration):
dependencies = [
('bla', '0054_xxxx'),
]
operations = [
migrations.AddField(
model_name='modeltext',
name='variable',
field=pb_model.fields.ArrayField(default=[]),
preserve_default=False,
),
]
result:
{'_state': <django.db.models.base.ModelState at 0x7f94aab7f090>,
'id': 34fssd35,
'created_time': datetime.datetime(2022, 1, 3, 14, 1, 15, 528382),
'updated_time': datetime.datetime(2022, 1, 3, 21, 22, 36, 303208),
'description': 'automatically created with default configurations',
'company_id': 232,
'validity_start_time': datetime.datetime(2022, 1, 3, 0, 0),
'billing_mode': 1,
'billing_cycle': 4,
'fiscal_document_files_to_exclude': ""}
I'm not sure about which field in result, is it 'fiscal_document_files_to_exclude' ?
´fiscal_document_files_to_exclude´ is an empty array defined in proto.