Commit db641388 authored by Vasyl Bodnaruk's avatar Vasyl Bodnaruk

fix bug in get_tag()

parent 1588d44a
<?xml version="1.0" encoding="UTF-8"?>
<module type="PYTHON_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$" />
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
<component name="TestRunnerService">
<option name="PROJECT_TEST_RUNNER" value="Unittests" />
</component>
</module>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.4.2 virtualenv at ~/work/exa/ENV (1)" project-jdk-type="Python SDK" />
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/exa.iml" filepath="$PROJECT_DIR$/.idea/exa.iml" />
</modules>
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$" vcs="Git" />
</component>
</project>
\ No newline at end of file
/*----------------------------------------------------------------------------------------------------
General styling
----------------------------------------------------------------------------------------------------*/
@-webkit-keyframes fstAnimationEnter {
from {
opacity: 0;
-webkit-transform: translate3d(0, -1em, 0); }
to {
opacity: 1;
-webkit-transform: translate3d(0, 0, 0); } }
@-moz-keyframes fstAnimationEnter {
from {
opacity: 0;
-moz-transform: translate3d(0, -1em, 0); }
to {
opacity: 1;
-moz-transform: translate3d(0, 0, 0); } }
@keyframes fstAnimationEnter {
from {
opacity: 0;
-webkit-transform: translate3d(0, -1em, 0);
-moz-transform: translate3d(0, -1em, 0);
-ms-transform: translate3d(0, -1em, 0);
-o-transform: translate3d(0, -1em, 0);
transform: translate3d(0, -1em, 0); }
to {
opacity: 1;
-webkit-transform: translate3d(0, 0, 0);
-moz-transform: translate3d(0, 0, 0);
-ms-transform: translate3d(0, 0, 0);
-o-transform: translate3d(0, 0, 0);
transform: translate3d(0, 0, 0); } }
.fstElement {
position: relative;
border: 1px solid #D7D7D7;
border-radius: 5px;
box-sizing: border-box;
color: #232323;
background-color: #fff; }
.fstElement > select,
.fstElement > input {
position: absolute;
left: -999em; }
.fstToggleBtn {
display: block;
position: relative;
box-sizing: border-box;
padding: .5rem .75rem;
min-width: 14.28571em;
cursor: pointer; }
.fstToggleBtn:after {
position: absolute;
content: "";
right: 0.71429em;
top: 50%;
margin-top: -0.17857em;
border: 0.35714em solid transparent;
border-top-color: #cacaca; }
.fstQueryInput {
-webkit-appearance: none;
-moz-appearance: none;
-ms-appearance: none;
-o-appearance: none;
appearance: none;
outline: none;
box-sizing: border-box;
background: transparent;
border: 0; }
.fstResults {
position: absolute;
left: -1px;
top: 100%;
right: -1px;
max-height: 30em;
overflow-x: hidden;
overflow-y: auto;
-webkit-overflow-scrolling: touch;
border: 1px solid #D7D7D7;
border-top: 0;
background-color: #FFF;
display: none; }
.fstResultItem {
display: block;
padding: 0.5em 0.71429em;
margin: 0;
cursor: pointer;
border-top: 1px solid #fff; }
.fstResultItem.fstUserOption {
color: #707070; }
.fstResultItem.fstFocused {
color: #fff;
background-color: #43A2F3;
border-color: #73baf6; }
.fstResultItem.fstSelected {
color: #fff;
background-color: #2694f1;
border-color: #73baf6; }
.fstGroupTitle {
display: block;
padding: 0.5em 0.71429em;
margin: 0;
font-weight: bold; }
.fstGroup {
padding-top: 1em; }
.fstGroup:first-child {
padding-top: 0; }
.fstNoResults {
display: block;
padding: 0.71429em 0.71429em;
margin: 0;
color: #999; }
/*----------------------------------------------------------------------------------------------------
Single Mode
----------------------------------------------------------------------------------------------------*/
.fstSingleMode .fstControls {
position: absolute;
left: -1px;
right: -1px;
top: 100%;
padding: 0.5em;
border: 1px solid #D7D7D7;
background-color: #fff;
display: none; }
.fstSingleMode .fstQueryInput {
display: block;
width: 100%;
padding: 0.5em 0.35714em;
color: #999;
border: 1px solid #D7D7D7; }
.fstSingleMode.fstActive {
z-index: 100; }
.fstSingleMode.fstActive.fstElement,
.fstSingleMode.fstActive .fstControls,
.fstSingleMode.fstActive .fstResults {
box-shadow: 0 0.2em 0.2em rgba(0, 0, 0, 0.1); }
.fstSingleMode.fstActive .fstControls {
display: block; }
.fstSingleMode.fstActive .fstResults {
display: block;
z-index: 10;
margin-top: -1px; }
/*----------------------------------------------------------------------------------------------------
Multiple mode
----------------------------------------------------------------------------------------------------*/
.fstChoiceItem {
display: inline-block;
position: relative;
margin: 0 0.41667em 0.41667em 0;
padding: 0em 0.33333em 0em 1.5em;
float: left;
border-radius: 0.25em;
border: 1px solid #43A2F3;
cursor: auto;
color: #fff;
background-color: #43A2F3;
-webkit-animation: fstAnimationEnter 0.2s;
-moz-animation: fstAnimationEnter 0.2s;
animation: fstAnimationEnter 0.2s; }
.fstChoiceItem.mod1 {
background-color: #F9F9F9;
border: 1px solid #D7D7D7;
color: #232323; }
.fstChoiceItem.mod1 > .fstChoiceRemove {
color: #a4a4a4; }
.fstChoiceRemove {
margin: 0;
padding: 0;
border: 0;
cursor: pointer;
background: none;
position: absolute;
left: 0;
top: 50%;
width: 1.28571em;
line-height: 1.28571em;
margin-top: -0.64286em;
text-align: center;
color: #fff; }
.fstChoiceRemove::-moz-focus-inner {
padding: 0;
border: 0; }
.fstMultipleMode .fstControls {
box-sizing: border-box;
padding: .5rem .75rem 0rem;
overflow: hidden;
cursor: text; }
.fstMultipleMode .fstQueryInput {
float: left;
margin: 0 0 0.45em 0;
width: 2em;
color: #999; }
.fstMultipleMode .fstQueryInputExpanded {
float: none;
width: 100%;
}
.fstMultipleMode.fstActive,
.fstMultipleMode.fstActive .fstResults {
box-shadow: 0 0.2em 0.2em rgba(0, 0, 0, 0.1); }
.fstMultipleMode.fstActive .fstResults {
display: block;
z-index: 10;
border-top: 1px solid #D7D7D7; }
/* Actions */
.actions {
display: flex;
}
.actions-form {
display: flex;
margin-left: 35px;
}
.actions-form > * {
margin: 0 5px;
}
.actions-select {
width: 150px;
}
/* Action block */
.divider {
opacity: 0.2;
}
.action-block {
padding-left: 17px;
}
.action-block-delete {
color: #d9534f;
}
.action-block-view {
color: #5bc0de;
}
.action-block-edit {
color: #0275d8;
}
.action-block-delete:hover {
color: #c9302c;
}
.action-block-view:hover {
color: #31b0d5;
}
.action-block-edit:hover {
color: #025aa5;
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.6/css/bootstrap.min.css" integrity="sha384-rwoIResjU2yc3z8GV/NPeZWAv56rSmLldC3R/AZzGRnGxQQKnKkoFVhFQhNUwEyJ" crossorigin="anonymous">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datepicker/1.6.4/css/bootstrap-datepicker3.min.css">
<link rel="stylesheet" href="css/fastselect.css">
<title>Document</title>
</head>
<body>
<main class="pt-5 pb-5">
<div class="container">
<form class="form">
<section class="mb-5">
<h2 class="offset-1 display-4 mb-5">Add new</h2>
<!-- Title -->
<div class="form-group row">
<label for="title" class="offset-1 col-2 col-form-label">Title</label>
<div class="col-6">
<input class="form-control" type="text" placeholder="Some title..." id="title" name="title">
</div>
</div>
<!-- Description -->
<div class="form-group row">
<label for="description" class="offset-1 col-2 col-form-label">Description</label>
<div class="col-6">
<textarea class="form-control" type="text" placeholder="Some description..." id="description" name="description"></textarea>
</div>
</div>
<!-- Url -->
<div class="form-group row">
<label for="url" class="offset-1 col-2 col-form-label">Url</label>
<div class="col-6">
<input class="form-control" type="text" placeholder="Some url..." id="url" name="url">
</div>
</div>
<!-- Entity -->
<div class="form-group row has-success">
<label for="entity" class="offset-1 col-2 col-form-label">Entity</label>
<div class="col-6">
<input class="form-control form-control-success" type="text" placeholder="Write entity..." id="entity" name="entity">
<div class="form-control-feedback">Additional message</div>
</div>
<!--<div class="col-3">
<button class="btn btn-primary">Add entity</button>
</div>-->
</div>
<!-- Radar -->
<div class="form-group row">
<label for="radar" class="offset-1 col-2 col-form-label">Radar</label>
<div class="col-6">
<input
type="text"
id="radar"
data-url="json/radar.json"
data-load-once="true"
class="multiselect"
name="radar"/>
</div>
</div>
<!-- Industry -->
<div class="form-group row">
<label for="industry" class="offset-1 col-2 col-form-label">Industry</label>
<div class="col-6">
<input
type="text"
id="industry"
class="multiselect"
data-url="json/industry.json"
data-load-once="true"
name="industry"/>
</div>
</div>
<!-- Function -->
<div class="form-group row">
<label for="function" class="offset-1 col-2 col-form-label">Function</label>
<div class="col-6">
<input
type="text"
id="function"
class="multiselect"
data-url="json/function.json"
data-load-once="true"
name="function"/>
</div>
</div>
<!-- Media -->
<div class="form-group row">
<label for="media" class="offset-1 col-2 col-form-label">Media</label>
<div class="col-6">
<div class="row">
<div class="col-12">
<input
type="text"
id="media"
class="multiselect"
data-url="json/media.json"
data-load-once="true"
name="media"/>
</div>
<!--<div class="col-3">
<button class="btn btn-primary">Add media</button>
</div>-->
</div>
</div>
</div>
<!-- Industry -->
<div class="form-group row">
<label for="technology" class="offset-1 col-2 col-form-label">Technology</label>
<div class="col-6">
<input
type="text"
id="technology"
class="multiselect"
data-url="json/technology.json"
data-load-once="true"
name="technology"/>
</div>
</div>
<!-- Type -->
<div class="form-group row">
<label for="type" class="offset-1 col-2 col-form-label">Type</label>
<div class="col-3">
<input
type="text"
id="type"
class="multiselect"
data-url="json/type.json"
data-load-once="true"
name="type"/>
</div>
</div>
<!-- Region -->
<div class="form-group row">
<label for="region" class="offset-1 col-2 col-form-label">Region</label>
<div class="col-3">
<input
type="text"
id="region"
class="multiselect"
data-url="json/region.json"
data-load-once="true"
name="region"/>
</div>
</div>
<!-- Publish Date -->
<div class="form-group row">
<label for="publish-date" class="offset-1 col-2 col-form-label">Publish Date</label>
<div class="col-3">
<input id="publish-date" type="text" class="form-control" placeholder="Choose a date" name="date">
</div>
</div>
<!-- Tag -->
<div class="form-group row">
<label for="tag" class="offset-1 col-2 col-form-label">Tag</label>
<div class="col-6">
<input
type="text"
multiple
id="tag"
class="multiselect"
data-url="json/tags.json"
data-load-once="true"
name="tags"/>
</div>
</div>
<!-- Submit -->
<div class="form-group row">
<div class="offset-7 col-2">
<button type="submit" class="form-control btn btn-primary">Add</button>
</div>
</div>
</section>
</form>
</div>
</main>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datepicker/1.6.4/js/bootstrap-datepicker.min.js"></script>
<script src="http://dbrekalo.github.io/fastselect/dist/fastselect.standalone.js"></script>
<script src="js/script.js"></script>
</body>
</html>
\ No newline at end of file
This diff is collapsed.
// Table page
$(document).ready(function() {
// ------------------------------
// Settings
// ------------------------------
var AJAX_URL = 'https://localhost:3002';
var selectAllChk = '#select-all';
var chk = '.checkbox';
var counter = '.actions-delete-counter';
var deleteBtn = '.js-delete-items';
// Action block
var actionView = '.action-block-view';
var actionEdit = '.action-block-edit';
var actionDelete = '.action-block-delete';
function actionData(element) {
var id = $(element).closest('tr').find('.checkbox').prop('id');
var type = $(element).data().type;
var elementDetails = {
id: id,
type: type
};
return elementDetails;
}
function updateCounter() {
var count = 0;
var presentSelected = $('.checkbox:checked').length > 0 ? false : true;
var selectedLength = $('.checkbox').each(function(index, item) {
$(item).prop('checked') === true
? count++
: ''
});
$(counter).text(count);
$(deleteBtn).prop('disabled', presentSelected);
}
function deleteData() {
var items = {
id: [],
type: 'deleteAll'
};
var selectedLength = $('.checkbox').each(function(index, item) {
$(item).prop('checked') === true
? items.id.push($(item).prop('id'))
: ''
});
return items;
}
function ajaxPost(url, data) {
$.ajax({
type: "POST", //rest Type
dataType: 'jsonp', //mispelled
data: JSON.stringify(data),
url: url,
async: false,
contentType: "application/json; charset=utf-8",
success: function (msg) {
console.log(msg);
}
})
}
updateCounter();
$(selectAllChk).click(function () {
$(chk).prop('checked', $(this).prop('checked'));
updateCounter();
});
$(chk).on('click', updateCounter);
$(deleteBtn).on('click', function() {
var data = deleteData();
ajaxPost(AJAX_URL, data);
});
$(actionView).on('click', function(e) {
e.preventDefault();
var data = actionData(this);
ajaxPost(AJAX_URL, data);
});
$(actionEdit).on('click', function(e) {
e.preventDefault();
var data = actionData(this);
ajaxPost(AJAX_URL, data);
});
$(actionDelete).on('click', function(e) {
e.preventDefault();
var data = actionData(this);
ajaxPost(AJAX_URL, data);
});
});
// Index Page
$(document).ready(function() {
$('.multiselect').fastselect();
$('#publish-date').datepicker();
});
\ No newline at end of file
[
{"text": "Func1", "value" : "Func1"},
{"text": "Func2", "value" : "Func2"},
{"text": "Func3", "value" : "Func3"},
{"text": "Func4", "value" : "Func4"},
{"text": "Func5", "value" : "Func5"}
]
\ No newline at end of file
[
{"text": "Algeria", "value" : "Algeria"},
{"text": "Angola", "value" : "Angola"},
{"text": "Angola", "value" : "as"},
{"text": "Angola", "value" : "dsda"},
{"text": "Angola", "value" : "aasdadsd"}
]
\ No newline at end of file
[
{"text": "Algeria", "value" : "Algeria"},
{"text": "Angola", "value" : "Angola"},
{"text": "Angola", "value" : "as"},
{"text": "Angola", "value" : "dsda"},
{"text": "Angola", "value" : "aasdadsd"}
]
\ No newline at end of file
[
{"text": "Algeria", "value" : "Algeria"},
{"text": "Angola", "value" : "Angola"},
{"text": "Angola", "value" : "as"},
{"text": "Angola", "value" : "dsda"},
{"text": "Angola", "value" : "aasdadsd"}
]
\ No newline at end of file
[
{"text": "Algeria", "value" : "Algeria"},
{"text": "Angola", "value" : "Angola"},
{"text": "Angola", "value" : "as"},
{"text": "Angola", "value" : "dsda"},
{"text": "Angola", "value" : "aasdadsd"}
]
\ No newline at end of file
[
{"text": "Algeria", "value" : "Algeria"},
{"text": "Angola", "value" : "Angola"},
{"text": "Angola", "value" : "as"},
{"text": "Angola", "value" : "dsda"},
{"text": "Angola", "value" : "aasdadsd"}
]
\ No newline at end of file
[
{"text": "Algeria", "value" : "Algeria"},
{"text": "Angola", "value" : "Angola"},
{"text": "Angola", "value" : "as"},
{"text": "Angola", "value" : "dsda"},
{"text": "Angola", "value" : "aasdadsd"}
]
\ No newline at end of file
[
{"text": "Algeria", "value" : "Algeria"},
{"text": "Angola", "value" : "Angola"},
{"text": "Angola", "value" : "as"},
{"text": "Angola", "value" : "dsda"},
{"text": "Angola", "value" : "aasdadsd"}
]
\ No newline at end of file
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.6/css/bootstrap.min.css" integrity="sha384-rwoIResjU2yc3z8GV/NPeZWAv56rSmLldC3R/AZzGRnGxQQKnKkoFVhFQhNUwEyJ" crossorigin="anonymous">
<title>Document</title>
</head>
<body>
<div class="container mt-5">
<h1>Bla-bla-bla. La-la-la. Blu-lu-lu. A-a-a. Opa-cha-opa-cha.</h1>
<a href="#" class="btn btn-primary mt-3">Edit</a>
<div class="new-content mt-5">
<div class="new-content-field mb-4">
<h5 class="new-content-title">- NY</h5>
</div>
<div class="new-content-field mb-4">
<h5 class="new-content-title">EntityURL</h5>
<div class="new-content-description">Lorem ipsum dolor sit amet, consectetur adipisicing elit. Molestias quia aliquid praesentium ratione at eos ut earum quam, distinctio hic voluptatum tempora porro eligendi, blanditiis illum modi debitis, eum culpa.</div>
</div>
<div class="new-content-field mb-4">
<h5 class="new-content-title">Media</h5>
<div class="new-content-description">
<div>TechCrunch</div>
<a href="#">http://techcrunch.com</a>
</div>
</div>
</div>
</div>
</body>
</html>
\ No newline at end of file
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.6/css/bootstrap.min.css" integrity="sha384-rwoIResjU2yc3z8GV/NPeZWAv56rSmLldC3R/AZzGRnGxQQKnKkoFVhFQhNUwEyJ" crossorigin="anonymous">
<link rel="stylesheet" href="css/style.css">
<title>Document</title>
</head>
<body>
<nav class="navbar navbar-toggleable-md navbar-light bg-faded">
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarTogglerDemo01" aria-controls="navbarTogglerDemo01" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarTogglerDemo01">
<div class="actions mr-auto">
<button class="js-delete-items btn btn-danger">
<span>Delete items (</span><span class="actions-delete-counter">0</span><span>)</span>
</button>
<form class="actions-form">
<select class="form-control actions-select">
<option>Default</option>
<option>2</option>
<option>3</option>
<option>4</option>
<option>5</option>
</select>
<select class="form-control actions-select">
<option>Default</option>
<option>2</option>
<option>3</option>
<option>4</option>
<option>5</option>
</select>
<button type="submit" class="btn btn-success">Filter</button>
</form>
</div>
<a href="/" class="btn btn-primary">Add News</a>
</div>
</nav>
<form class="form">
<table class="table table-hover">
<thead class="thead-inverse">
<tr>
<th>
<span><input id="select-all" type="checkbox"></span>
<span>Title</span>
</th>
<th>Media</th>
<th>Type</th>
<th>Region</th>
<th>Publish date</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<span><input id="chk-1" class="checkbox" type="checkbox"></span>
<span><a href="index.html">Mark</a></span>
<div class="action-block">
<a href="#" data-type="view" class="action-block-view"><strong>View</strong></a>
<span class="divider">|</span>
<a href="#" data-type="edit" class="action-block-edit"><strong>Edit</strong></a>
<span class="divider">|</span>
<a href="#" data-type="delete" class="action-block-delete"><strong>Delete</strong></a>
</div>
</td>
<td>TechCrunch</td>
<td>Startup</td>
<td>NA</td>
<td>2016-08-25 00:00:00</td>
</tr>
<tr>
<td>
<span><input id="chk-2" class="checkbox" type="checkbox"></span>
<span><a href="index.html">Mark</a></span>
<div class="action-block">
<a href="#" data-type="view" class="action-block-view"><strong>View</strong></a>
<span class="divider">|</span>
<a href="#" data-type="edit" class="action-block-edit"><strong>Edit</strong></a>
<span class="divider">|</span>
<a href="#" data-type="delete" class="action-block-delete"><strong>Delete</strong></a>
</div>
</td>
<td>TechCrunch</td>
<td>Startup</td>
<td>NA</td>
<td>2016-08-25 00:00:00</td>
</tr>
</tbody>
</table>
</form>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.0.0-alpha.6/js/bootstrap.min.js"></script>
<script src="js/script.js"></script>
</body>
</html>
\ No newline at end of file
File added
This diff is collapsed.
File added
File added
-- phpMyAdmin SQL Dump
-- version 4.2.12deb2+deb8u2
-- http://www.phpmyadmin.net
--
-- Хост: localhost
-- Час створення: Трв 25 2017 р., 11:17
-- Версія сервера: 5.5.54-0+deb8u1
-- Версія PHP: 5.6.29-0+deb8u1
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
--
-- База даних: `esi`
--
-- --------------------------------------------------------
--
-- Структура таблиці `wp_esi_entity`
--
CREATE TABLE IF NOT EXISTS `wp_esi_entity` (
`id` int(11) NOT NULL,
`name` varchar(255) NOT NULL,
`description` text NOT NULL,
`url` varchar(2083) NOT NULL,
`is_investor` tinyint(1) NOT NULL,
`country` varchar(2) NOT NULL,
`city` varchar(255) NOT NULL,
`entity_type_id` int(11) NOT NULL,
`founded_in` date NOT NULL DEFAULT '0000-00-00',
`employees` int(11) NOT NULL DEFAULT '0',
`acquired_by` int(11) DEFAULT NULL,
`acquired_at` date NOT NULL DEFAULT '0000-00-00',
`acquired_amount` int(11) DEFAULT NULL,
`total_raised` int(11) DEFAULT NULL,
`latest_round_type` int(11) DEFAULT NULL,
`facebook_link` text NOT NULL,
`twitter_link` text NOT NULL,
`linkedin_link` text NOT NULL,
`status` smallint(1) NOT NULL DEFAULT '1'
) ENGINE=InnoDB AUTO_INCREMENT=15957 DEFAULT CHARSET=utf8;
--
-- Індекси збережених таблиць
--
--
-- Індекси таблиці `wp_esi_entity`
--
ALTER TABLE `wp_esi_entity`
ADD PRIMARY KEY (`id`);
--
-- AUTO_INCREMENT для збережених таблиць
--
--
-- AUTO_INCREMENT для таблиці `wp_esi_entity`
--
ALTER TABLE `wp_esi_entity`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=15957;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
This diff is collapsed.
File added
File added
...@@ -14,8 +14,8 @@ ...@@ -14,8 +14,8 @@
<div class="actions mr-auto"> <div class="actions mr-auto">
<form class="actions-form" method="get" action="{% url 'list_news' %}"> <form class="actions-form" method="get" action="{% url 'list_news' %}">
<label>Date: </label> <label>Date: </label>
<input type="date" name="from_date" value="{{ date.record_date__min }}"> <input type="date" name="from_date" value="{{ date.publish_date__min }}">
<input type="date" name="to_date" value="{{ date.record_date__max }}"> <input type="date" name="to_date" value="{{ date.publish_date__max }}">
<label>Media:</label> <label>Media:</label>
<select class="form-control actions-select" name="media"> <select class="form-control actions-select" name="media">
<option>All</option> <option>All</option>
......
This diff is collapsed.
# -*- coding: utf-8 -*-
# Generated by Django 1.11.1 on 2017-05-31 11:50
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('webapp', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='news',
name='function_id',
field=models.BigIntegerField(blank=True, default=None, null=True),
),
migrations.AddField(
model_name='news',
name='industry_id',
field=models.BigIntegerField(blank=True, default=None, null=True),
),
migrations.AddField(
model_name='news',
name='radar_id',
field=models.BigIntegerField(blank=True, default=None, null=True),
),
migrations.AddField(
model_name='news',
name='tags_id',
field=models.CharField(blank=True, default=None, max_length=255, null=True),
),
migrations.AddField(
model_name='news',
name='technology_id',
field=models.BigIntegerField(blank=True, default=None, null=True),
),
]
# -*- coding: utf-8 -*-
# Generated by Django 1.11.1 on 2017-06-02 12:33
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('webapp', '0002_auto_20170531_1150'),
]
operations = [
migrations.AlterField(
model_name='news',
name='description',
field=models.TextField(blank=True, default=None, null=True),
),
migrations.AlterField(
model_name='news',
name='media_id',
field=models.IntegerField(blank=True, default=None, null=True),
),
migrations.AlterField(
model_name='news',
name='post_id',
field=models.BigIntegerField(blank=True, default=None, null=True),
),
migrations.AlterField(
model_name='news',
name='publish_date',
field=models.DateTimeField(blank=True, default=None, null=True),
),
migrations.AlterField(
model_name='news',
name='record_date',
field=models.DateTimeField(blank=True, default=None, null=True),
),
migrations.AlterField(
model_name='news',
name='region_id',
field=models.IntegerField(blank=True, default=None, null=True),
),
migrations.AlterField(
model_name='news',
name='title',
field=models.CharField(blank=True, default=None, max_length=255, null=True),
),
migrations.AlterField(
model_name='news',
name='type_id',
field=models.IntegerField(blank=True, default=None, null=True),
),
migrations.AlterField(
model_name='news',
name='url',
field=models.TextField(blank=True, default=None, max_length=2083, null=True),
),
]
# -*- coding: utf-8 -*-
# Generated by Django 1.11.1 on 2017-06-02 12:34
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('webapp', '0003_auto_20170602_1233'),
]
operations = [
migrations.AlterField(
model_name='news',
name='company_id',
field=models.BigIntegerField(blank=True, default=None, null=True),
),
]
# -*- coding: utf-8 -*-
# Generated by Django 1.11.1 on 2017-06-02 12:44
from __future__ import unicode_literals
import datetime
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('webapp', '0004_auto_20170602_1234'),
]
operations = [
migrations.AlterField(
model_name='news',
name='publish_date',
field=models.DateTimeField(blank=True, default=datetime.datetime.now, null=True),
),
]
...@@ -38,7 +38,7 @@ class News(models.Model): ...@@ -38,7 +38,7 @@ class News(models.Model):
def get_tags(self): def get_tags(self):
if self.tags_id: if self.tags_id:
tags = json.loads(self.tags_id) tags = json.loads(self.tags_id)
return WpEsiTechnology.objects.filter(id__in=tags) return WpEsiTag.objects.filter(id__in=tags)
return None return None
def get_tags_json(self): def get_tags_json(self):
......
...@@ -37,9 +37,9 @@ class ListNewsView(ListView): ...@@ -37,9 +37,9 @@ class ListNewsView(ListView):
if media: if media:
news = self._filter_by_media(news, media) news = self._filter_by_media(news, media)
media = WpEsiMedia.objects.all() media = WpEsiMedia.objects.all()
min_max_date = News.objects.aggregate(Min('record_date'), Max('record_date')) min_max_date = News.objects.aggregate(Min('publish_date'), Max('publish_date'))
min_max_date['record_date__min'] = str(min_max_date['record_date__min'].date()) min_max_date['publish_date__min'] = str(min_max_date['publish_date__min'].date())
min_max_date['record_date__max'] = str(min_max_date['record_date__max'].date()) min_max_date['publish_date__max'] = str(min_max_date['publish_date__max'].date())
return render(request, self.template_name, {'news': news, return render(request, self.template_name, {'news': news,
'media': media, 'media': media,
...@@ -94,12 +94,9 @@ class EditNewsView(DetailView): ...@@ -94,12 +94,9 @@ class EditNewsView(DetailView):
return render(request, self.template_name, {'news': news}) return render(request, self.template_name, {'news': news})
def post(self, request, *args, **kwargs): def post(self, request, *args, **kwargs):
radar = request.POST.get('cancel')
form = NewsUpdate(request.POST) form = NewsUpdate(request.POST)
if form.is_valid(): if form.is_valid():
form.update() form.update()
if radar:
print("hghhjfhgfhg", radar)
return HttpResponseRedirect('/news') return HttpResponseRedirect('/news')
......
This diff is collapsed.
This diff is collapsed.
-- phpMyAdmin SQL Dump
-- version 4.2.12deb2+deb8u2
-- http://www.phpmyadmin.net
--
-- Хост: localhost
-- Час створення: Трв 22 2017 р., 17:36
-- Версія сервера: 5.5.54-0+deb8u1
-- Версія PHP: 5.6.29-0+deb8u1
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
--
-- База даних: `esi`
--
--
-- Дамп даних таблиці `wp_esi_news_entity`
--
INSERT INTO `wp_esi_news_entity` (`news_id`, `entity_id`) VALUES
(277, 3),
(278, 3),
(279, 3),
(280, 3),
(281, 3),
(282, 3),
(283, 3),
(284, 3),
(285, 3),
(286, 3),
(287, 20),
(288, 21),
(289, 21),
(290, 21),
(291, 21),
(292, 26),
(293, 21),
(294, 26),
(295, 26),
(296, 33),
(297, 33),
(298, 21),
(299, 33),
(300, 21),
(301, 35),
(302, 35),
(303, 21),
(304, 21),
(305, 39),
(306, 35),
(307, 40),
(308, 21),
(309, 40),
(310, 35),
(311, 40),
(312, 39),
(313, 35),
(314, 40),
(315, 39),
(316, 21),
(317, 45),
(318, 21),
(319, 43),
(320, 40),
(321, 47),
(322, 35),
(323, 21),
(324, 40),
(325, 35),
(326, 21),
(327, 43),
(328, 45),
(329, 35),
(330, 49),
(331, 43),
(332, 45),
(333, 47),
(334, 43),
(335, 45),
(336, 47),
(337, 40),
(338, 51),
(339, 35),
(340, 21),
(341, 45),
(342, 47),
(343, 39),
(344, 40),
(345, 51),
(346, 21),
(347, 40),
(348, 51),
(349, 35),
(350, 21),
(351, 39),
(352, 40),
(353, 51),
(354, 47),
(355, 45),
(356, 43),
(357, 39),
(358, 51),
(359, 45),
(360, 43),
(361, 39),
(362, 51),
(363, 35),
(364, 21),
(365, 45),
(366, 43),
(367, 39),
(368, 40),
(369, 51),
(370, 47),
(371, 21),
(372, 45),
(373, 43),
(374, 40),
(375, 51),
(376, 47),
(377, 45),
(378, 43),
(379, 39),
(380, 40),
(381, 45),
(382, 43),
(383, 40),
(384, 35),
(385, 21),
(386, 45),
(387, 51),
(388, 35),
(389, 21),
(390, 45),
(391, 43),
(392, 51),
(393, 35),
(394, 21),
(395, 45),
(396, 43),
(397, 40),
(398, 39),
(399, 51),
(400, 35),
(401, 21),
(402, 45),
(403, 43),
(404, 40),
(405, 39),
(406, 51),
(407, 35),
(408, 21),
(409, 40),
(410, 39),
(411, 51),
(412, 35),
(413, 40),
(414, 39),
(415, 51),
(416, 35),
(417, 43),
(418, 45),
(419, 40),
(420, 39),
(421, 51),
(422, 21),
(423, 43),
(424, 45),
(425, 40),
(426, 39),
(427, 51),
(428, 21),
(429, 43),
(430, 45),
(431, 40),
(432, 39),
(433, 21),
(434, 43),
(435, 45),
(436, 40),
(437, 39),
(438, 35),
(439, 21),
(440, 43),
(441, 45),
(442, 40),
(443, 39),
(444, 35),
(445, 43),
(446, 35),
(447, 21),
(448, 43),
(449, 35),
(450, 21),
(451, 43),
(452, 39),
(453, 40),
(454, 35),
(455, 43),
(456, 39),
(457, 40),
(458, 35),
(459, 21),
(460, 43),
(461, 39),
(462, 40),
(463, 35),
(464, 39),
(465, 40),
(466, 35),
(467, 39),
(468, 40),
(469, 43),
(470, 21),
(471, 39),
(472, 40),
(473, 43),
(474, 21),
(475, 39),
(476, 40),
(477, 35),
(478, 43),
(479, 39),
(480, 40),
(481, 35),
(482, 43),
(483, 39),
(484, 40),
(485, 43),
(486, 21),
(487, 39),
(488, 35),
(489, 43),
(490, 21),
(491, 35),
(492, 43),
(493, 21),
(494, 40),
(495, 35),
(496, 43),
(497, 21),
(498, 39),
(499, 40),
(500, 35),
(501, 43),
(502, 21),
(503, 39),
(504, 40),
(505, 35),
(506, 39),
(507, 40),
(508, 39),
(509, 40),
(510, 39),
(511, 40),
(512, 43),
(513, 39),
(514, 40),
(515, 35),
(516, 43),
(517, 35),
(518, 43),
(519, 21),
(520, 39),
(521, 40),
(522, 35),
(523, 43),
(524, 21),
(525, 39),
(526, 40),
(527, 35),
(528, 43),
(529, 21),
(530, 39),
(531, 35),
(532, 43),
(533, 21),
(534, 35),
(535, 43),
(536, 21),
(537, 40),
(538, 103),
(539, 35),
(540, 43),
(541, 21),
(542, 39),
(543, 40),
(544, 103),
(545, 35),
(546, 43),
(547, 39),
(548, 105),
(549, 40),
(550, 35),
(551, 43),
(552, 39),
(553, 40),
(554, 103),
(555, 21),
(556, 39),
(557, 40),
(558, 21),
(559, 108),
(560, 39),
(561, 40),
(562, 43),
(563, 35),
(564, 21),
(565, 39),
(566, 40),
(567, 43),
(568, 35),
(569, 21),
(570, 39),
(571, 40),
(572, 43),
(573, 35),
(574, 39),
(575, 40),
(576, 43),
(577, 35),
(578, 21),
(579, 40),
(580, 43),
(581, 35),
(582, 21),
(583, 43),
(584, 35),
(585, 21),
(586, 43),
(587, 35),
(588, 21),
(589, 40),
(590, 43),
(591, 35),
(592, 40),
(593, 43),
(594, 35),
(595, 35),
(596, 21),
(597, 21),
(598, 43),
(599, 21),
(600, 35),
(601, 43),
(602, 21),
(603, 43),
(604, 21),
(605, 35),
(606, 43),
(607, 21),
(608, 35),
(609, 43),
(610, 21),
(611, 35),
(612, 43),
(613, 21),
(614, 35),
(615, 43),
(616, 21),
(617, 35),
(618, 43),
(619, 21),
(620, 35),
(621, 43),
(622, 35),
(623, 43),
(624, 21),
(625, 43),
(626, 35),
(627, 21),
(628, 43),
(629, 35),
(630, 21),
(631, 43),
(632, 35),
(633, 21),
(634, 43),
(635, 35),
(636, 21),
(637, 43),
(638, 35),
(639, 21),
(640, 43),
(641, 35),
(642, 21),
(643, 43),
(644, 35),
(645, 21),
(646, 43),
(647, 35),
(648, 43),
(649, 35),
(650, 43),
(651, 35),
(652, 21),
(653, 21),
(654, 21),
(655, 35),
(656, 43),
(657, 21),
(658, 35),
(659, 43),
(660, 21),
(661, 43),
(662, 21),
(663, 43),
(664, 21),
(665, 43),
(666, 21),
(667, 43),
(668, 21),
(669, 43),
(670, 21),
(671, 43),
(672, 21),
(673, 21),
(674, 21),
(675, 21),
(676, 21),
(677, 21),
(678, 21),
(679, 21),
(680, 21),
(681, 21),
(682, 21),
(683, 21),
(684, 21),
(685, 21),
(686, 21),
(687, 21),
(688, 21),
(689, 21),
(690, 21),
(691, 21),
(692, 21),
(693, 21),
(694, 185),
(695, 21),
(696, 21),
(697, 21),
(698, 189),
(699, 21),
(700, 21),
(701, 21),
(702, 193),
(703, 21),
(704, 21),
(705, 21),
(706, 21),
(707, 21),
(708, 21),
(709, 21),
(710, 21),
(711, 21),
(712, 21),
(713, 21),
(714, 21),
(715, 21),
(716, 21),
(717, 21),
(718, 21),
(719, 21),
(720, 218),
(721, 218),
(722, 21),
(723, 218),
(724, 21),
(725, 218),
(726, 21),
(727, 218),
(728, 21),
(729, 218),
(730, 21),
(731, 21),
(732, 21),
(733, 227),
(734, 21),
(735, 21),
(736, 21),
(737, 21),
(738, 21),
(739, 21),
(740, 21),
(741, 21),
(742, 21),
(743, 21),
(744, 21),
(745, 21),
(746, 21),
(747, 21),
(748, 21),
(749, 21),
(750, 21),
(751, 21),
(752, 21),
(753, 21),
(754, 21),
(755, 21),
(756, 21),
(757, 21),
(758, 21),
(759, 21),
(760, 21),
(761, 21),
(762, 21),
(763, 21),
(764, 21),
(765, 21),
(766, 21),
(767, 21),
(768, 21),
(769, 21),
(770, 21),
(771, 21),
(772, 21),
(773, 21),
(774, 21),
(775, 21),
(776, 282),
(777, 282),
(778, 21),
(779, 21),
(780, 21),
(781, 21),
(782, 21),
(783, 21),
(784, 21),
(785, 21),
(786, 21);
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
http://52.40.106.7:80
\ No newline at end of file
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