Referencing objects that don't exist that will be created in forms

2017-10-19 Thread Chris Wedgwood
Hi I have the following scenario in my forms.py: UNIVERSITY_CHOICES = University.objects.values_list('id', 'name') class UniversityForm(forms.Form): name = forms.CharField(widget=forms.Select(attrs={"class": "selectpicker", "data-live-search": "true","title": "find university..."},choices=UN

Re: Referencing objects that don't exist that will be created in forms

2017-10-19 Thread Chris Wedgwood
cts that will be parsed before they exist On Thursday, 19 October 2017 10:23:36 UTC+1, Chris Wedgwood wrote: > > Hi > > I have the following scenario in my forms.py: > > UNIVERSITY_CHOICES = University.objects.values_list('id', 'name') > > class Univ

Re-runnable sql scripts in the migrations framework

2017-11-02 Thread Chris Wedgwood
Hi As part of my deployment process I want to be able to have some db scripts that are re-runnable For example I have some internal configuration tables that I would like to be able to change values with a merge statement in the same file but not have to create a new migration file I suppose my

Adding stored procedures

2018-04-17 Thread Chris Wedgwood
Hi All I am using SQL SERVER in my latest django project and I am going to be using some stored procedures. My question is about how to go about deploying stored procedure changes with django. I have looked through the migrations documentation which looks very specific to model changes. Has anyo

Re: Adding stored procedures

2018-04-19 Thread Chris Wedgwood
stored procedure is going to be used for an import task that isn't actually related to Django so probably needs to be deployed by another mechanism and I should leave migrations for only DJango specific changes thanks Chris On Wednesday, 18 April 2018 07:50:52 UTC+1, Chris Wedgwood

Correct pattern to call external api during form saving

2017-08-21 Thread Chris Wedgwood
Hi My requirement is 1)User adds postcode to form 2)I call external api with postcode to get details of the postcode,local authority,MP etc 3) save this data into another model My question is what is the correct pattern for doing this? Where should I call the api? Should this be done before the

Re: {% csrf_token %}

2017-09-27 Thread Chris Wedgwood
Hi Alex Try this: return render_to_string('home.html', request=request) cheers Chris On Tuesday, 26 September 2017 18:29:15 UTC+1, Alex Kleider wrote: > > I'm using test driven development (going through Harry J.W. Percival's > book) and have found that the following code fails because the t

Docker performance on Mac OS X

2019-09-23 Thread Chris Wedgwood
Hi All I generally use the Django Cookiecutter project to start my projects and have started using *docker* for my local development. However I have started to get some really awful performance with pageloads taking 30-40 seconds. I am know considering stopping using docker entirely. Has anyone

Re: Docker performance on Mac OS X

2019-09-23 Thread Chris Wedgwood
Hi Jason Thank you for your response. I misdaignosed my issue. It actually had nothing to do with Docker and instead was a slow performing form in the django admin that had a widget referencing a foreign key which was taking forever to build. I fixed it with raw_id_fields, so am now back on do

Re: How to best secure environment variables (secret key, passwords etc.) stored in .yml files?

2020-01-30 Thread Chris Wedgwood
Hi Tom You are definitely not overthinking this. it's important. This is an area that has baked my noodle for a while now and I always am left wondering "Do I have this right?" "Am I vulnerable to attack?" . and I still haven't figured it out completely. It's like static files I never rea