diff --git a/a_stardust_truce/settings.py b/a_stardust_truce/settings.py index 1da634e..26df11b 100644 --- a/a_stardust_truce/settings.py +++ b/a_stardust_truce/settings.py @@ -32,7 +32,6 @@ INSTALLED_APPS = [ 'main_app', - 'coverage', 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', diff --git a/main_app/dependencies.py b/main_app/dependencies.py index 5e96221..bd2dafc 100644 --- a/main_app/dependencies.py +++ b/main_app/dependencies.py @@ -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!' \ No newline at end of file +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 \ No newline at end of file diff --git a/main_app/views.py b/main_app/views.py index 42992de..537db55 100644 --- a/main_app/views.py +++ b/main_app/views.py @@ -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