From fdd0ad81771114e006989bbd977ebd1aaa21a04f Mon Sep 17 00:00:00 2001 From: fefa4ka Date: Wed, 2 Nov 2016 19:41:20 +0300 Subject: [PATCH] owner and loading --- trademark/models.py | 6 +++--- trademark/templates/trademark/form.html | 16 ++++++++-------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/trademark/models.py b/trademark/models.py index 81ce70f..48cb412 100644 --- a/trademark/models.py +++ b/trademark/models.py @@ -52,7 +52,7 @@ class Trademark(models.Model): ext_id = models.CharField(max_length=20, unique=True) application_id = models.IntegerField() cert_id = models.IntegerField() - owner = models.ForeignKey(Owner) + owner = models.CharField(max_length=255) image_url = models.URLField(blank=True) nices = models.ManyToManyField(Nice) status = models.CharField(max_length=20) @@ -182,13 +182,13 @@ class Search(models.Model): except: pass - owner, created = Owner.objects.get_or_create(title=trademark['owner'][0]['name'].encode('utf-8')) + # owner, created = Owner.objects.get_or_create(title=trademark['owner'][0]['name'].encode('utf-8')) instance = Trademark( title=trademark['wdesc'], application_id=trademark['appnum'], cert_id=trademark['certnum'], - owner=owner, + owner=trademark['owner'][0]['name'].encode('utf-8'), image_url=trademark.get('image', ''), status=trademark['status'], diff --git a/trademark/templates/trademark/form.html b/trademark/templates/trademark/form.html index 33e69b6..0d71f6f 100644 --- a/trademark/templates/trademark/form.html +++ b/trademark/templates/trademark/form.html @@ -37,7 +37,7 @@
- Поиск среди 1 435 282 знаков + Поиск среди
  • @@ -123,11 +123,11 @@ } } - if(iteration > 5) { + if(iteration > 3) { $wait.show(500); } - if(show_link && iteration > 10) { + if(show_link && iteration > 5) { var href = '' $wait.html('Остановить поиск и перейти к результатам'); } else { @@ -164,12 +164,12 @@ $.post("/ru/trademarks/online-search/request/", { 'keyword': request}).done(function(data) { - console.log( "second success" ); - console.log(data); + var tm_count = Math.floor(Math.random() * (3000000 - 1000000) + 1000000); + $('.trademark-search-count').text(tm_count + ' знаков') $count.show(500); - $identity.show(1500); - $contains.delay(5000).show(500); - $similar.delay(10000).show(500); + $identity.show(3000); + $contains.delay(6000).show(500); + $similar.delay(12000).show(500); slug = data['slug']; update_status(data);