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,
|
||||
validators=[FileExtensionValidator(['png', 'svg'])])
|
||||
keywords = models.TextField(blank=False, null=False)
|
||||
match_all_keywords = models.BooleanField(blank=True, default=False)
|
||||
|
||||
|
||||
class FeedEntry(models.Model):
|
||||
|
||||
@ -14,7 +14,7 @@
|
||||
<mat-label>Gesuchte Stichwörter</mat-label>
|
||||
<input matInput formControlName="keywords" placeholder="Spiel,Spaß,Schokolade">
|
||||
</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 class="input-row text-left">
|
||||
<mat-form-field class="col">
|
||||
|
||||
@ -20,6 +20,7 @@ export class EditierenComponent implements OnInit {
|
||||
feedForm: FormGroup;
|
||||
url: String;
|
||||
active = true;
|
||||
match_all_keywords = false;
|
||||
icon: File;
|
||||
keywords: String;
|
||||
|
||||
@ -44,7 +45,8 @@ export class EditierenComponent implements OnInit {
|
||||
url: this.url,
|
||||
active: this.active,
|
||||
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();
|
||||
form.append('url', feedData.url);
|
||||
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) {
|
||||
form.append('keywords', feedData.keywords);
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user