These are chat archives for django/django

18th
Jul 2017
Roel
@roelzkie15
Jul 18 2017 07:01

Can anyone help me how to query this certain problem?

here is an example model:

class Diagnosis(models.Model):
    is_success= models.BooleanField()
    created_at = models.DateTimeField(auto_now_add=True)

Here is the implementation:

d1 = Diagnosis.objects.create(is_success = False)
d2 = Diagnosis.objects.create(is_success=False)
d3 = Diagnosis.objects.create(is_success=True)
d4 = Diagnosis.objects.create(is_success=False)
d5 = Diagnosis.objects.create(is_success=False)
d6 = Diagnosis.objects.create(is_success=False)
d7 = Diagnosis.objects.create(is_success=True)

Now what i would like to filter is returns a multi dimensional collection(array) from the is_success=True to its previous is_success=False:

I am struggling to get this output example:

[
   [d1(False),  d2(False),  d3(True)],
   [d4(False), d5(False), d6(False), d7(True)]
]
Miracle Ayodele
@iammiracle
Jul 18 2017 14:24
hi any one here available?
J. Dalton Childers
@jdaltonchilders
Jul 18 2017 16:35
Does the DRF have default views or at least endpoints for forgot password? If so, how would I access it and if not, do I need to use another package?
So far it looks like you need to use another package but I wanted to be sure I wasn't missing something.
Patrick Zhang
@PatDuJour
Jul 18 2017 18:02
@jdaltonchilders check out djoser, it's another package but provides out-of-box auth views.
J. Dalton Childers
@jdaltonchilders
Jul 18 2017 18:02
@PatDuJour Is it better than Django-rest-auth?
They seem to be equally popular on github
Patrick Zhang
@PatDuJour
Jul 18 2017 18:04
Personally I think djoser is better maintained and more up-to-date.
J. Dalton Childers
@jdaltonchilders
Jul 18 2017 18:12
Thank you I’ll look into it more…I was thinking this should be built into DRF, but I guess I can see reason why it isn’t
gradStudent26
@gradStudent26
Jul 18 2017 18:15
Hi guys, would anyone be willing to share their experiences using this chatroom in a survey (~ 10mins)? I am a PhD student working on a research paper to understand the use of Gitter and ur responses will be extremely helpful. 30% randomly selected participants will receive a $10 Amazon gift card as a thank you. Here is the link if you have 10 minutes to spare https://docs.google.com/forms/d/e/1FAIpQLSd4X5EzpLJtzK5_hNTWlZtn6HP_U-PYMPPqMVMiKaxGzkIgjQ/viewform?usp=sf_link. Thank you and sorry for intruding on your chatroom!
delirious44
@delirious44
Jul 18 2017 18:43
hey guys
can someone help
I have a url with regex <slug> etc you know.. and it has its own view
but when i go to the url it goes to a different view
that i specified in another url
Miracle Ayodele
@iammiracle
Jul 18 2017 19:07
@delirious44 probably you should check the name of the url
You might have used it somewhere else