Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #11 from sorrelbri/sj_fixtures
sj fixtures
- Loading branch information
Showing
12 changed files
with
298 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,9 @@ | ||
from django.contrib import admin | ||
from main_app.models import * | ||
|
||
# Register your models here. | ||
admin.site.register(Code_Block) | ||
admin.site.register(Resource) | ||
admin.site.register(Element) | ||
admin.site.register(Property) | ||
admin.site.register(Method) | ||
admin.site.register(Data_Structure) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
[{ | ||
"model": "main_app.code_block", | ||
"pk": 1, | ||
"fields": { | ||
"name": "single-link-node", | ||
"python": "class Node:\r\n def __init__(self, val, next):\r\n self.val = val\r\n self.next = next", | ||
"javascript": "class Node {\r\n constructor(val, next) {\r\n this.val = val;\r\n this.next = next;\r\n }\r\n}" | ||
} | ||
}, { | ||
"model": "main_app.code_block", | ||
"pk": 2, | ||
"fields": { | ||
"name": "list-head", | ||
"python": "self.head = None", | ||
"javascript": "const addListHead = (obj, prop) => obj[prop] = none;\r\n\r\n// within class factory function\r\n\r\n addListHead(obj, 'head');" | ||
} | ||
}, { | ||
"model": "main_app.code_block", | ||
"pk": 3, | ||
"fields": { | ||
"name": "list-size", | ||
"python": "self.size = 0", | ||
"javascript": "const addListSize(obj, prop) => obj[prop] = 0;" | ||
} | ||
}, { | ||
"model": "main_app.code_block", | ||
"pk": 4, | ||
"fields": { | ||
"name": "list-push", | ||
"python": "def push(self, val):\r\n new_node = Node(val, self.head)\r\n self.size += 1", | ||
"javascript": "const methAddFirst = (obj, meth) => {\r\n return obj[meth] = node => {\r\n node = new Node(node);\r\n node.next = obj.first, obj.first = node;\r\n }\r\n}\r\n\r\n// class body\r\n methAddFirst(obj, 'push');" | ||
} | ||
}, { | ||
"model": "main_app.code_block", | ||
"pk": 5, | ||
"fields": { | ||
"name": "list-pop", | ||
"python": "# some python", | ||
"javascript": "const methDestroyFirst = (obj, meth) => {\r\n return obj[meth] = () => {\r\n first = obj.first;\r\n obj.first = first.next;\r\n return first.val;\r\n }\r\n}\r\n\r\n// in class factory function\r\n\r\n methDestroyFirst(obj, 'pop');" | ||
} | ||
}, { | ||
"model": "main_app.code_block", | ||
"pk": 6, | ||
"fields": { | ||
"name": "list-peek", | ||
"python": "# some py", | ||
"javascript": "const methPeekFirst = (obj, meth) => {\r\n return obj[meth] = () => {\r\n return obj.first.val;\r\n }\r\n}\r\n\r\n// \r\n\r\n addPeekFirst(obj, 'peekShift');" | ||
} | ||
}, { | ||
"model": "main_app.code_block", | ||
"pk": 7, | ||
"fields": { | ||
"name": "list-is-empty", | ||
"python": "# some py", | ||
"javascript": "// some js" | ||
} | ||
}] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
[{ | ||
"model": "main_app.data_structure", | ||
"pk": 1, | ||
"fields": { | ||
"name": "single-link-list-stack", | ||
"description": "A single link linked list implementation of a LIFO structure.", | ||
"element": 1, | ||
"user": 1, | ||
"properties": [1, 2], | ||
"methods": [1, 2, 3, 4] | ||
} | ||
}] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
[{ | ||
"model": "main_app.element", | ||
"pk": 1, | ||
"fields": { | ||
"name": "single_link_node", | ||
"type": "NO", | ||
"dimension": 1, | ||
"code_block": 1, | ||
"resource": 1 | ||
} | ||
}] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
[{ | ||
"model": "main_app.method", | ||
"pk": 1, | ||
"fields": { | ||
"name": "list-push", | ||
"code_block": 4, | ||
"resource": 4 | ||
} | ||
}, { | ||
"model": "main_app.method", | ||
"pk": 2, | ||
"fields": { | ||
"name": "list-pop", | ||
"code_block": 5, | ||
"resource": 5 | ||
} | ||
}, { | ||
"model": "main_app.method", | ||
"pk": 3, | ||
"fields": { | ||
"name": "list-peek", | ||
"code_block": 6, | ||
"resource": 6 | ||
} | ||
}, { | ||
"model": "main_app.method", | ||
"pk": 4, | ||
"fields": { | ||
"name": "list-is-empty", | ||
"code_block": 7, | ||
"resource": 7 | ||
} | ||
}] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
[{ | ||
"model": "main_app.property", | ||
"pk": 1, | ||
"fields": { | ||
"name": "list-head", | ||
"type": "sca", | ||
"code_block": 2, | ||
"resource": 2 | ||
} | ||
}, { | ||
"model": "main_app.property", | ||
"pk": 2, | ||
"fields": { | ||
"name": "list-size", | ||
"type": "int", | ||
"code_block": 3, | ||
"resource": 3 | ||
} | ||
}] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
[{ | ||
"model": "main_app.resource", | ||
"pk": 1, | ||
"fields": { | ||
"name": "single_link_node", | ||
"description": "This is a node that contains one reference point to another node in memory", | ||
"img_url": "https://upload.wikimedia.org/wikipedia/commons/5/5d/Single_node1.jpg" | ||
} | ||
}, { | ||
"model": "main_app.resource", | ||
"pk": 2, | ||
"fields": { | ||
"name": "list-head", | ||
"description": "The first element in a linked list", | ||
"img_url": "https://media.geeksforgeeks.org/wp-content/cdn-uploads/gq/2013/03/Linkedlist.png" | ||
} | ||
}, { | ||
"model": "main_app.resource", | ||
"pk": 3, | ||
"fields": { | ||
"name": "list-size", | ||
"description": "List size is an integer value that initializes at 0 and is iterated upwards by 1 for every new value carrying node that is added to the list and iterated downward by 1 for every value carrying node that is removed from the list.", | ||
"img_url": "http://web.augsburg.edu/~crockett/210/graphics/linked_list_four_nodes.jpg" | ||
} | ||
}, { | ||
"model": "main_app.resource", | ||
"pk": 4, | ||
"fields": { | ||
"name": "list-push", | ||
"description": "Add element to end of list", | ||
"img_url": "https://picsum.photos/id/605/100/100" | ||
} | ||
}, { | ||
"model": "main_app.resource", | ||
"pk": 5, | ||
"fields": { | ||
"name": "list-pop", | ||
"description": "list-pop description", | ||
"img_url": "https://picsum.photos/id/605/100/100" | ||
} | ||
}, { | ||
"model": "main_app.resource", | ||
"pk": 6, | ||
"fields": { | ||
"name": "list-peek", | ||
"description": "See the value of the head element of a list without removing it from the list", | ||
"img_url": "https://picsum.photos/id/605/100/100" | ||
} | ||
}, { | ||
"model": "main_app.resource", | ||
"pk": 7, | ||
"fields": { | ||
"name": "list-is-empty", | ||
"description": "Determines whether linked list has any value bearing elements and returns a boolean", | ||
"img_url": "https://picsum.photos/id/605/100/100" | ||
} | ||
}] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# Generated by Django 2.2.3 on 2019-09-13 22:24 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('main_app', '0004_data_structure_user'), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name='code_block', | ||
name='name', | ||
field=models.CharField(default='single-link-node', max_length=50), | ||
preserve_default=False, | ||
), | ||
migrations.AddField( | ||
model_name='resource', | ||
name='name', | ||
field=models.CharField(default='single-link-node', max_length=50), | ||
preserve_default=False, | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# Generated by Django 2.2.3 on 2019-09-13 22:51 | ||
|
||
from django.db import migrations | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('main_app', '0005_auto_20190913_2224'), | ||
] | ||
|
||
operations = [ | ||
migrations.AlterModelOptions( | ||
name='property', | ||
options={'verbose_name': 'Property', 'verbose_name_plural': 'Properties'}, | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Generated by Django 2.2.3 on 2019-09-13 22:57 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('main_app', '0006_auto_20190913_2251'), | ||
] | ||
|
||
operations = [ | ||
migrations.AlterField( | ||
model_name='property', | ||
name='type', | ||
field=models.CharField(choices=[('str', 'String'), ('int', 'Integer'), ('float', 'Float'), ('sca', 'Scalar')], default='int', max_length=5), | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# Generated by Django 2.2.3 on 2019-09-13 23:01 | ||
|
||
from django.db import migrations | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('main_app', '0007_auto_20190913_2257'), | ||
] | ||
|
||
operations = [ | ||
migrations.AlterModelOptions( | ||
name='code_block', | ||
options={'verbose_name': 'Code Block'}, | ||
), | ||
migrations.AlterModelOptions( | ||
name='data_structure', | ||
options={'verbose_name': 'Data Structure'}, | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters