you want date auto genrate ??

On 6 July 2018 at 20:16, 'dtdave' via Django users <
django-users@googlegroups.com> wrote:

> 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 django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> 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
> <https://groups.google.com/d/msgid/django-users/0b7f4d0c-534e-470e-ab35-be6d88acb6e8%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
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/CAAupS99OssdxeCzVYX17356%3DewKvOZN-GUg9%2BTCK2KM5bKCNdg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to