Skip to content

Conversation

@jbopp
Copy link

@jbopp jbopp commented Feb 18, 2020

DiamondBase is now compatible with Django 3.0.2 and Python 3. Furthermore, Action_Type and Data_Type objects can now be linked to parameters which can be set up dynamically. To make this work, DiamondBase/triggers.sql needs to be incorporated in the SQL database used.

Copy link
Author

@jbopp jbopp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changes which have been made are commented now.

'foundation',
'slack',
'about',
'custom_middleware'
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not needed anymore...

'slack',
'about',
'custom_middleware'
'login_required'
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'login_required'
)

MIDDLEWARE_CLASSES = (
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See above.

'django.middleware.clickjacking.XFrameOptionsMiddleware',
'custom_middleware.middleware.LoginRequiredMiddleware',
)
TEMPLATE_CONTEXT_PROCESSORS=("django.contrib.auth.context_processors.auth",
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Upgrade to Django 3


WSGI_APPLICATION = 'DiamondBase.wsgi.application'

LOGIN_URL = '/login/'
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Configuration of login_required plugin

try: return redirect(obj.url())
except: pass # If not url method, just return this form
context = RequestContext(request,{'obj':obj,
'obj_fields':fields,
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See above.


if type == 'Sample':
form.fields["owner"].queryset = User.objects.filter(is_staff=True).order_by('first_name')
elif type != 'Sample' and type != 'Piece':
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See above.

obj=False
form=''
prompt=''
editable=['Sample','Piece','Action','General','Local','Local_Attachment']
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same changes as in edit.

obj.delete()
try:
obj.delete()
except models.ProtectedError:
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Show proper error message if object cannot be deleted due to on_delete constraint.

type = Data_Type.objects.get(id = attachID)
prompt = 'Filenames will go to notes unless a txt file is supplied. The txt file needs <b>one line per file!</b>'
if request.method == 'POST':
form=ZipForm(type,request.POST,request.FILES)
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See sample_database/models.py on how additional parameters are handled now.

Copy link
Author

@jbopp jbopp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changes which have been made are commented now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant