Many thanks for the help on this. I have implemented the following:
models.py
start_date = models.DateField(null=True, blank=True,)
asap = models.BooleanField(default=False)

I have amend my manager so the order is right on the template.
The template is where I am going wrong.
This what I have started with in my template;
{% if 'job.asap' == 'True' %}
<p>Start Date: {{job.asap}}</p>
{% else %}

<p>Start Date:{{job.start_date}}</p>
{% endif %}

The start dates are listed in the correct date order but any of those tasks 
with an ASAP start show None as the start date in the template.
I know the answer is probably obvious, but for smoe raeson I cannot fathom 
it out at the moment.
Again thanks for all the help

On Thursday, 5 July 2018 20:08:30 UTC+1, Melvyn Sopacua wrote:
>
> On donderdag 5 juli 2018 19:05:47 CEST 'dtdave' via Django users wrote: 
>
> > However, now I have been asked to change this so that some projects have 
> a 
> > start date of ASAP and others have date. 
> > These then need to be listed in my template with ASAP tasks coming first 
> > and then those with a start date coming in descending order. 
> > 
> > I am at a loss as to how to achieve this so would welcome any pointers 
> or 
> > ideas. 
>
>
> Asap field is a boolean. Date field needs to be able to be blank and null. 
> Then: 
>
>         tasks = Task.objects.order_by('asap', '-start_date') 
>
> Done :) 
> -- 
> Melvyn Sopacua 
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/0b7f4d0c-534e-470e-ab35-be6d88acb6e8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to