46 lines
1.4 KiB
Python
46 lines
1.4 KiB
Python
|
|
from django.db import migrations, models
|
||
|
|
|
||
|
|
|
||
|
|
def build_default_layout():
|
||
|
|
return {
|
||
|
|
"input_block_count": 1,
|
||
|
|
"default_full_farm": True,
|
||
|
|
"algorithm_status": "pending",
|
||
|
|
"blocks": [
|
||
|
|
{
|
||
|
|
"block_code": "block-1",
|
||
|
|
"order": 1,
|
||
|
|
"source": "default",
|
||
|
|
"needs_subdivision": None,
|
||
|
|
"sub_blocks": [],
|
||
|
|
}
|
||
|
|
],
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
class Migration(migrations.Migration):
|
||
|
|
|
||
|
|
dependencies = [
|
||
|
|
("location_data", "0007_ndviobservation"),
|
||
|
|
]
|
||
|
|
|
||
|
|
operations = [
|
||
|
|
migrations.AddField(
|
||
|
|
model_name="soillocation",
|
||
|
|
name="block_layout",
|
||
|
|
field=models.JSONField(
|
||
|
|
blank=True,
|
||
|
|
default=build_default_layout,
|
||
|
|
help_text="ساختار بلوکهای زمین. بهصورت پیشفرض کل زمین یک بلوک است و بعداً الگوریتم میتواند برای هر بلوک زیربلوک تعریف کند.",
|
||
|
|
),
|
||
|
|
),
|
||
|
|
migrations.AddField(
|
||
|
|
model_name="soillocation",
|
||
|
|
name="input_block_count",
|
||
|
|
field=models.PositiveIntegerField(
|
||
|
|
default=1,
|
||
|
|
help_text="تعداد بلوکهای اولیهای که کشاورز برای زمین ثبت میکند.",
|
||
|
|
),
|
||
|
|
),
|
||
|
|
]
|