Add search all keywords in model
This commit is contained in:
parent
86f1692660
commit
28749401e3
@ -16,6 +16,7 @@ class Feed(models.Model):
|
|||||||
icon = models.FileField(upload_to='feed-icons', blank=True, null=True,
|
icon = models.FileField(upload_to='feed-icons', blank=True, null=True,
|
||||||
validators=[FileExtensionValidator(['png', 'svg'])])
|
validators=[FileExtensionValidator(['png', 'svg'])])
|
||||||
keywords = models.TextField(blank=False, null=False)
|
keywords = models.TextField(blank=False, null=False)
|
||||||
|
match_all_keywords = models.BooleanField(blank=True, default=False)
|
||||||
|
|
||||||
|
|
||||||
class FeedEntry(models.Model):
|
class FeedEntry(models.Model):
|
||||||
|
|||||||
@ -14,7 +14,7 @@
|
|||||||
<mat-label>Gesuchte Stichwörter</mat-label>
|
<mat-label>Gesuchte Stichwörter</mat-label>
|
||||||
<input matInput formControlName="keywords" placeholder="Spiel,Spaß,Schokolade">
|
<input matInput formControlName="keywords" placeholder="Spiel,Spaß,Schokolade">
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
<mat-checkbox>Alle Stichworte müssen enthalten sein</mat-checkbox>
|
<mat-checkbox formControlName="match_all_keywords">Alle Stichworte müssen enthalten sein</mat-checkbox>
|
||||||
</div>
|
</div>
|
||||||
<div class="input-row text-left">
|
<div class="input-row text-left">
|
||||||
<mat-form-field class="col">
|
<mat-form-field class="col">
|
||||||
|
|||||||
@ -20,6 +20,7 @@ export class EditierenComponent implements OnInit {
|
|||||||
feedForm: FormGroup;
|
feedForm: FormGroup;
|
||||||
url: String;
|
url: String;
|
||||||
active = true;
|
active = true;
|
||||||
|
match_all_keywords = false;
|
||||||
icon: File;
|
icon: File;
|
||||||
keywords: String;
|
keywords: String;
|
||||||
|
|
||||||
@ -44,7 +45,8 @@ export class EditierenComponent implements OnInit {
|
|||||||
url: this.url,
|
url: this.url,
|
||||||
active: this.active,
|
active: this.active,
|
||||||
icon: [undefined, [FileValidator.maxContentSize(this.maxSize)]],
|
icon: [undefined, [FileValidator.maxContentSize(this.maxSize)]],
|
||||||
keywords: this.keywords
|
keywords: this.keywords,
|
||||||
|
match_all_keywords: this.match_all_keywords
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -60,6 +62,8 @@ export class EditierenComponent implements OnInit {
|
|||||||
const form: FormData = new FormData();
|
const form: FormData = new FormData();
|
||||||
form.append('url', feedData.url);
|
form.append('url', feedData.url);
|
||||||
form.append('active', feedData.active);
|
form.append('active', feedData.active);
|
||||||
|
form.append('match_all_keywords', feedData.match_all_keywords);
|
||||||
|
console.log('Match all: ' + feedData.match_all_keywords);
|
||||||
if (feedData.keywords != null) {
|
if (feedData.keywords != null) {
|
||||||
form.append('keywords', feedData.keywords);
|
form.append('keywords', feedData.keywords);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user