v/pol
1
0
mirror of https://github.com/taroved/pol synced 2025-05-21 08:30:24 -07:00

'Create' button + db models

This commit is contained in:
Alexandr Nesterenko 2016-02-09 07:44:25 -08:00
parent 20114d0f42
commit e1c5b3849b
5 changed files with 72 additions and 0 deletions

View File

@ -0,0 +1,16 @@
[
{
"fields": {
"name": "title"
},
"model": "frontend.field",
"pk": 1
},
{
"fields": {
"name": "description"
},
"model": "frontend.field",
"pk": 2
}
]

View File

@ -0,0 +1,41 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
]
operations = [
migrations.CreateModel(
name='Feed',
fields=[
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
('uri', models.CharField(max_length=2000)),
('xpath', models.CharField(max_length=2000)),
],
),
migrations.CreateModel(
name='FeedField',
fields=[
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
('xpath', models.CharField(max_length=2000)),
('feed', models.ForeignKey(to='frontend.Feed')),
],
),
migrations.CreateModel(
name='Field',
fields=[
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
('name', models.CharField(max_length=200)),
],
),
migrations.AddField(
model_name='feedfield',
name='field',
field=models.ForeignKey(to='frontend.Field'),
),
]

View File

View File

@ -0,0 +1,14 @@
from django.db import models
class Feed(models.Model):
uri = models.CharField(max_length=2000)
xpath = models.CharField(max_length=2000)
class Field(models.Model):
name = models.CharField(max_length=200)
class FeedField(models.Model):
feed = models.ForeignKey(Feed, on_delete=models.CASCADE)
field = models.ForeignKey(Field, on_delete=models.CASCADE)
xpath = models.CharField(max_length=2000)

View File

@ -8,6 +8,7 @@
<button id="st-title" class="btn btn-large btn-primary disabled has-tooltip" title="Click on the button and move cursor to the below document and pick item you interested in." <button id="st-title" class="btn btn-large btn-primary disabled has-tooltip" title="Click on the button and move cursor to the below document and pick item you interested in."
data-trigger="hover focus manual" data-animation="true">Title</button> and data-trigger="hover focus manual" data-animation="true">Title</button> and
<button id="st-description" class="btn btn-large btn-info disabled">Description</button>. <button id="st-description" class="btn btn-large btn-info disabled">Description</button>.
<button id="create" class="btn btn-large btn-primary" style="padding-right: 13px; float:right">Create <i class="icon-arrow-right icon-white" style="margin-top: 3px"></i></button>
</h2> </h2>
</div> </div>