Commit 72672389 authored by Mario Chirinos's avatar Mario Chirinos

migrations delete

parent a6b9ba4a
# -*- coding: utf-8 -*-
# Generated by Django 1.11.10 on 2018-02-14 15:48
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Publisher',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('name', models.CharField(max_length=128)),
('shortName', models.CharField(default='', max_length=32)),
('crawler', models.CharField(default='', max_length=64)),
('type', models.CharField(default='', max_length=32)),
('url', models.URLField(default='')),
],
options={
'verbose_name': 'Medio',
'verbose_name_plural': 'Medios',
'ordering': ('name',),
},
),
]
# -*- coding: utf-8 -*-
# Generated by Django 1.11.10 on 2018-02-14 15:49
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('catalog', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='Topic',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('name', models.CharField(max_length=256, verbose_name='Tema')),
],
options={
'verbose_name': 'Tema',
'verbose_name_plural': 'Temas',
'ordering': ('name',),
},
),
]
# -*- coding: utf-8 -*-
# Generated by Django 1.11.10 on 2018-02-14 15:49
from __future__ import unicode_literals
import django.contrib.postgres.indexes
import django.contrib.postgres.search
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('catalog', '0002_topic'),
]
operations = [
migrations.CreateModel(
name='News',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('title', models.CharField(max_length=512)),
('date', models.DateTimeField(verbose_name='Publication Date')),
('text', models.TextField(blank=True, default='', verbose_name='News Text')),
('url', models.URLField(max_length=512, verbose_name='URL')),
('search_vector', django.contrib.postgres.search.SearchVectorField(null=True)),
('publisher', models.ForeignKey(default='', on_delete=django.db.models.deletion.CASCADE, to='catalog.Publisher')),
('topic', models.ManyToManyField(blank=True, to='catalog.Topic', verbose_name='Topic(s)')),
],
options={
'verbose_name': 'Noticia',
'verbose_name_plural': 'Noticias',
'ordering': ('date',),
},
),
migrations.AddIndex(
model_name='news',
index=django.contrib.postgres.indexes.GinIndex(fields=['search_vector'], name='catalog_new_search__62ed1c_gin'),
),
]
# -*- coding: utf-8 -*-
# Generated by Django 1.11.10 on 2018-02-14 15:49
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),
('catalog', '0003_auto_20180214_1549'),
]
operations = [
migrations.CreateModel(
name='Search',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('startDate', models.DateTimeField(verbose_name='Start Date')),
('endDate', models.DateTimeField(verbose_name='End Date')),
('text', models.CharField(blank=True, max_length=128)),
('publishers', models.ManyToManyField(blank=True, to='catalog.Publisher')),
('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
],
),
]
# -*- coding: utf-8 -*-
# Generated by Django 1.11.10 on 2018-02-14 15:50
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),
('catalog', '0004_search'),
]
operations = [
migrations.CreateModel(
name='Profile',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('subscriptions', models.ManyToManyField(to='catalog.Publisher')),
('user', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
],
),
]
# -*- coding: utf-8 -*-
# Generated by Django 1.11.10 on 2018-02-14 15:50
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('catalog', '0005_profile'),
]
operations = [
migrations.CreateModel(
name='audioTime',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('startDate', models.DateTimeField(verbose_name='Start Date')),
('minutes', models.BigIntegerField(default=0)),
('publisher', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='catalog.Publisher')),
],
),
]
# -*- coding: utf-8 -*-
# Generated by Django 1.11.18 on 2019-01-24 19:37
from __future__ import unicode_literals
from django.db import migrations, models
import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [
('catalog', '0006_audiotime'),
]
operations = [
migrations.AddField(
model_name='audiotime',
name='endDate',
field=models.DateTimeField(default=django.utils.timezone.now, verbose_name='End Date'),
preserve_default=False,
),
]
...@@ -50,6 +50,7 @@ from stop_words import get_stop_words ...@@ -50,6 +50,7 @@ from stop_words import get_stop_words
#from django.contrib.postgres.lookups import Unaccent #from django.contrib.postgres.lookups import Unaccent
AUDIOPATH = "/home/geoint/M3_NFS/recordings/" AUDIOPATH = "/home/geoint/M3_NFS/recordings/"
from django.contrib.postgres.search import SearchQuery
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
...@@ -114,8 +115,8 @@ def getNewsByRequest(request, values=None): ...@@ -114,8 +115,8 @@ def getNewsByRequest(request, values=None):
if "text" in request.GET and request.GET['text']!="None" and request.GET['text']!="": if "text" in request.GET and request.GET['text']!="None" and request.GET['text']!="":
# myQuery &= Q(text__search=request.GET['text']) # myQuery &= Q(text__search=request.GET['text'])
# myQuery &= Q(search_vector=request.GET['text']) myQuery &= Q(search_vector=request.GET['text'])
myQuery &= Q.filter(search=request.GET['text']) # myQuery &= Q(search=request.GET['text'])
print (myQuery) print (myQuery)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment