Skip to content

Commit

Permalink
Merge pull request #10 from sorrelbri/sj_dependencies_check
Browse files Browse the repository at this point in the history
import depency checks to views.py
  • Loading branch information
simpleCodify committed Sep 13, 2019
2 parents 7b2b9be + df97a1b commit c919291
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 10 deletions.
1 change: 0 additions & 1 deletion a_stardust_truce/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@

INSTALLED_APPS = [
'main_app',
'coverage',
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
Expand Down
19 changes: 10 additions & 9 deletions main_app/dependencies.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,15 @@
}

# to search for dependencies of property

# if data_structure['element'] in dependences['properities'][some_prop]:
# return 'That Property Can be added to this Data Structure!'
# else:
# return 'Sorry, that Property Can\'t Be added to this Data Structure!'
def checkProperty(property, data_structure, success, failure):
if data_structure['element'] in dependencies['properities'][property]:
return success
else:
return failure

# search for dependencies of method
# if data_structure['element'] in dependences['methods'][some_method]['element'] and data_structure['property'] in dependences['methods'][some_method]['property']:
# return 'That Property Can be added to this Data Structure!'
# else:
# return 'Sorry, that Property Can\'t Be added to this Data Structure!'
def checkMethod(method, data_structure, success, failure):
if data_structure['element'] in dependencies['methods'][method]['element'] and data_structure['property'] in dependencies['methods'][method]['property']:
return success
else:
return failure
4 changes: 4 additions & 0 deletions main_app/views.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
from django.shortcuts import render, redirect
from django.views.generic import ListView, DetailView
from main_app.dependencies import checkMethod, checkProperty

# checkComponent signature
# checkComponent(component, data_structure, on_success, on_failure)

# Account Functionality
from django.contrib.auth import login
Expand Down

0 comments on commit c919291

Please sign in to comment.