[Patchew-devel] [PATCH 07/16] model: Introduce WatchedQuery

Paolo Bonzini pbonzini at redhat.com
Fri Nov 23 14:45:43 UTC 2018


On 21/11/18 03:08, Fam Zheng wrote:
> Every user can have a record in WatchedQuery. The query in this record
> is going to be run against every new series, and if matched, the patches
> will be added to the 'watched' queue, making this the 3rd specially
> purposed queue.

Why not one-to-many?  (That is a user can have >1 record in
WatchedQuery).  This can come in handy when people go on vacation...

Paolo

> Signed-off-by: Fam Zheng <famz at redhat.com>
> ---
>  api/migrations/0042_watchedquery.py | 26 ++++++++++++++++++++++++++
>  api/models.py                       |  6 ++++++
>  2 files changed, 32 insertions(+)
>  create mode 100644 api/migrations/0042_watchedquery.py
> 
> diff --git a/api/migrations/0042_watchedquery.py b/api/migrations/0042_watchedquery.py
> new file mode 100644
> index 0000000..3c0fd76
> --- /dev/null
> +++ b/api/migrations/0042_watchedquery.py
> @@ -0,0 +1,26 @@
> +# -*- coding: utf-8 -*-
> +# Generated by Django 1.11.16 on 2018-11-20 10:37
> +from __future__ import unicode_literals
> +
> +from django.conf import settings
> +from django.db import migrations, models
> +import django.db.models.deletion
> +
> +
> +class Migration(migrations.Migration):
> +
> +    dependencies = [
> +        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
> +        ('api', '0041_auto_20181120_0636'),
> +    ]
> +
> +    operations = [
> +        migrations.CreateModel(
> +            name='WatchedQuery',
> +            fields=[
> +                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
> +                ('query', models.TextField(help_text='Watched query')),
> +                ('user', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
> +            ],
> +        ),




More information about the Patchew-devel mailing list