Skip to content

Commit

Permalink
beta 1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
pskurochkin committed Nov 28, 2018
1 parent 324ddb0 commit d395da4
Show file tree
Hide file tree
Showing 6,093 changed files with 1,477,698 additions and 1,591 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
2,491 changes: 904 additions & 1,587 deletions parsing.ipynb

Large diffs are not rendered by default.

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
7 changes: 6 additions & 1 deletion server/education/core/admin.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
from django.contrib import admin
from .models import Region, University, Specialty, Subject, Variant

# Register your models here.
admin.site.register(Region)
admin.site.register(University)
admin.site.register(Specialty)
admin.site.register(Subject)
admin.site.register(Variant)
File renamed without changes.
Empty file.
370 changes: 370 additions & 0 deletions server/education/core/management/commands/insert_db.py

Large diffs are not rendered by default.

64 changes: 64 additions & 0 deletions server/education/core/migrations/0001_initial.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
# Generated by Django 2.1.3 on 2018-11-12 09:31

from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

initial = True

dependencies = [
]

operations = [
migrations.CreateModel(
name='Region',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('yandex_id', models.IntegerField(unique=True)),
('name', models.CharField(max_length=128)),
],
),
migrations.CreateModel(
name='Specialty',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('yandex_id', models.IntegerField(unique=True)),
('name', models.CharField(max_length=128)),
],
),
migrations.CreateModel(
name='Subject',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('name', models.CharField(max_length=128)),
],
),
migrations.CreateModel(
name='University',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('yandex_id', models.IntegerField(unique=True)),
('name', models.CharField(max_length=128)),
('city', models.CharField(default='None', max_length=128)),
('region', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='core.Region')),
],
),
migrations.CreateModel(
name='Variant',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('department', models.CharField(max_length=128, null=True)),
('education_type', models.CharField(max_length=128, null=True)),
('budget_plan', models.IntegerField(null=True)),
('budget_passing_score', models.IntegerField(null=True)),
('paid_plan', models.IntegerField(null=True)),
('paid_passing_score', models.IntegerField(null=True)),
('cost', models.IntegerField(null=True)),
('specialty', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='core.Specialty')),
('subjects', models.ManyToManyField(to='core.Subject')),
('university', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='core.University')),
],
),
]
22 changes: 22 additions & 0 deletions server/education/core/migrations/0002_auto_20181120_2054.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Generated by Django 2.1.3 on 2018-11-20 20:54

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('core', '0001_initial'),
]

operations = [
migrations.RemoveField(
model_name='university',
name='city',
),
migrations.AddField(
model_name='university',
name='place',
field=models.IntegerField(default=None),
),
]
18 changes: 18 additions & 0 deletions server/education/core/migrations/0003_auto_20181120_2054.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Generated by Django 2.1.3 on 2018-11-20 20:54

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('core', '0002_auto_20181120_2054'),
]

operations = [
migrations.AlterField(
model_name='university',
name='place',
field=models.IntegerField(default=None, null=True),
),
]
18 changes: 18 additions & 0 deletions server/education/core/migrations/0004_auto_20181120_2058.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Generated by Django 2.1.3 on 2018-11-20 20:58

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('core', '0003_auto_20181120_2054'),
]

operations = [
migrations.AlterField(
model_name='university',
name='name',
field=models.CharField(max_length=1024),
),
]
18 changes: 18 additions & 0 deletions server/education/core/migrations/0005_auto_20181120_2109.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Generated by Django 2.1.3 on 2018-11-20 21:09

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('core', '0004_auto_20181120_2058'),
]

operations = [
migrations.AlterField(
model_name='university',
name='name',
field=models.CharField(default=None, max_length=1024, null=True),
),
]
18 changes: 18 additions & 0 deletions server/education/core/migrations/0006_specialty_place.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Generated by Django 2.1.3 on 2018-11-20 22:04

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('core', '0005_auto_20181120_2109'),
]

operations = [
migrations.AddField(
model_name='specialty',
name='place',
field=models.IntegerField(default=None, null=True),
),
]
24 changes: 24 additions & 0 deletions server/education/core/migrations/0007_auto_20181125_1231.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Generated by Django 2.1.3 on 2018-11-25 12:31

import django.contrib.postgres.fields
from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('core', '0006_specialty_place'),
]

operations = [
migrations.AddField(
model_name='variant',
name='applicants',
field=django.contrib.postgres.fields.ArrayField(base_field=models.IntegerField(), default=[], size=None),
),
migrations.AddField(
model_name='variant',
name='rating',
field=models.FloatField(null=True),
),
]
19 changes: 19 additions & 0 deletions server/education/core/migrations/0008_auto_20181125_1232.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Generated by Django 2.1.3 on 2018-11-25 12:32

import django.contrib.postgres.fields
from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('core', '0007_auto_20181125_1231'),
]

operations = [
migrations.AlterField(
model_name='variant',
name='applicants',
field=django.contrib.postgres.fields.ArrayField(base_field=models.IntegerField(), default=list, size=None),
),
]
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
50 changes: 50 additions & 0 deletions server/education/core/models.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,55 @@
from django.db import models
from django.contrib.postgres.fields import ArrayField


class Region(models.Model):
yandex_id = models.IntegerField(unique=True)
name = models.CharField(max_length=128)

def __str__(self):
return self.name


class University(models.Model):
yandex_id = models.IntegerField(unique=True)
name = models.CharField(max_length=1024, default=None, null=True)
place = models.IntegerField(default=None, null=True)
# city = models.CharField(max_length=128, default=None)
region = models.ForeignKey(Region, on_delete=models.CASCADE)

def __str__(self):
return self.name


class Specialty(models.Model):
yandex_id = models.IntegerField(unique=True)
name = models.CharField(max_length=128)
place = models.IntegerField(default=None, null=True)

def __str__(self):
return self.name


class Subject(models.Model):
name = models.CharField(max_length=128)

def __str__(self):
return self.name


class Variant(models.Model):
university = models.ForeignKey(University, on_delete=models.CASCADE)
specialty = models.ForeignKey(Specialty, on_delete=models.CASCADE)
department = models.CharField(max_length=128, null=True)
education_type = models.CharField(max_length=128, null=True)
subjects = models.ManyToManyField(Subject)
budget_plan = models.IntegerField(null=True)
budget_passing_score = models.IntegerField(null=True)
paid_plan = models.IntegerField(null=True)
paid_passing_score = models.IntegerField(null=True)
cost = models.IntegerField(null=True)
rating = models.FloatField(null=True)
applicants = ArrayField(models.IntegerField(), default=list)

def __str__(self):
return self.specialty.name
Binary file added server/education/core/static/Mike.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added server/education/core/static/Sullivan.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions server/education/core/static/css/magicsuggest-min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file added server/education/core/static/fig0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added server/education/core/static/fig1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added server/education/core/static/fig2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added server/education/core/static/fig3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions server/education/core/static/js/jquery-3.2.1.min.js

Large diffs are not rendered by default.

117 changes: 117 additions & 0 deletions server/education/core/static/js/jquery.cookie.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
/*!
* jQuery Cookie Plugin v1.4.1
* https://github.com/carhartl/jquery-cookie
*
* Copyright 2013 Klaus Hartl
* Released under the MIT license
*/
(function (factory) {
if (typeof define === 'function' && define.amd) {
// AMD
define(['jquery'], factory);
} else if (typeof exports === 'object') {
// CommonJS
factory(require('jquery'));
} else {
// Browser globals
factory(jQuery);
}
}(function ($) {

var pluses = /\+/g;

function encode(s) {
return config.raw ? s : encodeURIComponent(s);
}

function decode(s) {
return config.raw ? s : decodeURIComponent(s);
}

function stringifyCookieValue(value) {
return encode(config.json ? JSON.stringify(value) : String(value));
}

function parseCookieValue(s) {
if (s.indexOf('"') === 0) {
// This is a quoted cookie as according to RFC2068, unescape...
s = s.slice(1, -1).replace(/\\"/g, '"').replace(/\\\\/g, '\\');
}

try {
// Replace server-side written pluses with spaces.
// If we can't decode the cookie, ignore it, it's unusable.
// If we can't parse the cookie, ignore it, it's unusable.
s = decodeURIComponent(s.replace(pluses, ' '));
return config.json ? JSON.parse(s) : s;
} catch(e) {}
}

function read(s, converter) {
var value = config.raw ? s : parseCookieValue(s);
return $.isFunction(converter) ? converter(value) : value;
}

var config = $.cookie = function (key, value, options) {

// Write

if (value !== undefined && !$.isFunction(value)) {
options = $.extend({}, config.defaults, options);

if (typeof options.expires === 'number') {
var days = options.expires, t = options.expires = new Date();
t.setTime(+t + days * 864e+5);
}

return (document.cookie = [
encode(key), '=', stringifyCookieValue(value),
options.expires ? '; expires=' + options.expires.toUTCString() : '', // use expires attribute, max-age is not supported by IE
options.path ? '; path=' + options.path : '',
options.domain ? '; domain=' + options.domain : '',
options.secure ? '; secure' : ''
].join(''));
}

// Read

var result = key ? undefined : {};

// To prevent the for loop in the first place assign an empty array
// in case there are no cookies at all. Also prevents odd result when
// calling $.cookie().
var cookies = document.cookie ? document.cookie.split('; ') : [];

for (var i = 0, l = cookies.length; i < l; i++) {
var parts = cookies[i].split('=');
var name = decode(parts.shift());
var cookie = parts.join('=');

if (key && key === name) {
// If second argument (value) is a function it's a converter...
result = read(cookie, value);
break;
}

// Prevent storing a cookie that we couldn't decode.
if (!key && (cookie = read(cookie)) !== undefined) {
result[name] = cookie;
}
}

return result;
};

config.defaults = {};

$.removeCookie = function (key, options) {
if ($.cookie(key) === undefined) {
return false;
}

// Must not alter options, thus extending a fresh object...
$.cookie(key, '', $.extend({}, options, { expires: -1 }));
return !$.cookie(key);
};

}));
1 change: 1 addition & 0 deletions server/education/core/static/js/magicsuggest-min.js

Large diffs are not rendered by default.

Loading

0 comments on commit d395da4

Please sign in to comment.