Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Organiza metadados de campos #466

Merged
merged 10 commits into from
Oct 9, 2020
14 changes: 14 additions & 0 deletions core/migrations/0026_auto_20201007_1704.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Generated by Django 3.1.1 on 2020-10-07 20:04

from django.db import migrations


class Migration(migrations.Migration):

dependencies = [
("core", "0025_auto_20201007_1702"),
]

operations = [
migrations.RenameField(model_name="table", old_name="search", new_name="search_fields",),
]
6 changes: 5 additions & 1 deletion core/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ class Table(models.Model):
options = models.JSONField(null=True, blank=True)
ordering = ArrayField(models.CharField(max_length=63), null=False, blank=False)
filtering_fields = ArrayField(models.CharField(max_length=63), null=True, blank=True)
search = ArrayField(models.CharField(max_length=63), null=True, blank=True)
search_fields = ArrayField(models.CharField(max_length=63), null=True, blank=True)
version = models.ForeignKey(Version, on_delete=models.CASCADE, null=False, blank=False)
import_date = models.DateTimeField(null=True, blank=True)
description = MarkdownxField(null=True, blank=True)
Expand Down Expand Up @@ -326,6 +326,10 @@ def db_table(self):
def fields(self):
return self.field_set.all()

@property
def search(self):
return self.search_fields
turicas marked this conversation as resolved.
Show resolved Hide resolved

@property
def enabled(self):
return not self.hidden
Expand Down