Build a dynamic filtering form with Django // 6 - Filtering by date and view count

แชร์
ฝัง
  • เผยแพร่เมื่อ 7 เม.ย. 2019
  • In this project we teach how to build a dynamic form for filtering your Django models. In this video we start filtering by date and view count.
    justdjango.com
    ☝ Get exclusive courses & become a better Django developer
    💻 Project code: github.com/justdjango/djfilter
    ✌️ Stay in touch
    Facebook: / justdjangocode
    Instagram: / justdjangocode
    Twitter: / justdjangocode
    Email: admin@justdjango.com
    Thank you for watching and don't forget to subscribe :)

ความคิดเห็น • 29

  • @izabelamarkiewicz2424
    @izabelamarkiewicz2424 4 หลายเดือนก่อน

    You saved my college assignment and mental health thank you!!

  • @OxMiroslav
    @OxMiroslav 5 ปีที่แล้ว +7

    That's awesome video! I am learning Django for more than a year and still I found something new in this channel. In this vid I found out I can use "cascaded" filter on ORM object - I can filter the object again and again.

  • @drewanderson5867
    @drewanderson5867 2 ปีที่แล้ว

    really good django tutorial

  • @gregruiz921
    @gregruiz921 2 ปีที่แล้ว +1

    Hey man... thanks for all you do, and keep up the great work! Much appreciated!!!

  • @Jane-eunku
    @Jane-eunku 4 ปีที่แล้ว +1

    훌륭한 강의입니다! Great Tutorial!

  • @lucastavares4908
    @lucastavares4908 5 ปีที่แล้ว +3

    Awesome video!!

  • @DanielLeachTen
    @DanielLeachTen 2 ปีที่แล้ว

    You are a godsend

  • @ab5comau
    @ab5comau 3 ปีที่แล้ว

    Thank you very much for this series. I have just about come to terms with Django and could not find how to handle dynamic filters.

  • @savannahgilmour2325
    @savannahgilmour2325 5 ปีที่แล้ว +1

    AWESOME.

  • @anoopkg8681
    @anoopkg8681 5 ปีที่แล้ว +2

    awesome

  • @whonayem01
    @whonayem01 3 ปีที่แล้ว

    Thanks!

  • @Boga_adventures
    @Boga_adventures 4 ปีที่แล้ว +1

    GREAT

  • @alizeeboussac4087
    @alizeeboussac4087 4 ปีที่แล้ว +1

    Hi ! Awesome video thank you. Do you think it's possible to do the same thing with tables ?

  • @doniyorabduvokhidov1706
    @doniyorabduvokhidov1706 4 ปีที่แล้ว +1

    Cooll

  • @ThalesTheDuck
    @ThalesTheDuck 3 ปีที่แล้ว +3

    how can I pass the values back to the template so the user can see which filters are applied?

  • @malikrumi1206
    @malikrumi1206 3 ปีที่แล้ว

    Thank you for this series. But I am curious: why didn’t you use DateTimeRangeField and or IntegerRangeField?

  • @sudipgupta87
    @sudipgupta87 3 ปีที่แล้ว +1

    Nice! By querying all and then filtering, are fetching too much? or are we querying multiple times?

  • @TheDarrenJones
    @TheDarrenJones 5 ปีที่แล้ว +2

    Great video again. One question - how do you do the 'entering two lines at once' editing in VSCode? I can't even think of what to search for to find out how to do it.

    • @mattfreire
      @mattfreire  5 ปีที่แล้ว +1

      On Mac you place the cursor and then hold the option key while clicking to place the cursor in the next place. On Windows I think it would be the alt key

    • @michakwiatek5031
      @michakwiatek5031 5 ปีที่แล้ว +1

      On linux it's Alt + left mouse or Ctr + Shift + arrow(up/down)

  • @jlpeyret
    @jlpeyret 4 ปีที่แล้ว +1

    Wait, am I correct in thinking the mechanism here is to fetch all the table’s rows into memory and then filtering that down to only what you want? No problem if it’s a small table but not very viable if it had millions of rows. I suppose you could compose Django Q objects into a tuple and then ‘Journal.objects.get(*tuple_q)‘ so most of the code would still apply.

    • @mattfreire
      @mattfreire  4 ปีที่แล้ว +2

      There is nothing being stored in memory. This explains how querysets are evaluated: docs.djangoproject.com/en/2.2/ref/models/querysets/#when-querysets-are-evaluated

  • @skelaw
    @skelaw 3 ปีที่แล้ว +1

    Great job! How can I support you?

  • @eesakamaldien1917
    @eesakamaldien1917 2 ปีที่แล้ว

    Hi can this be used off model methods aswell?

  • @WattsInnovation
    @WattsInnovation 2 ปีที่แล้ว

    what if the category was a multiSelectField?

  • @AmanSingh-kp5zw
    @AmanSingh-kp5zw 4 ปีที่แล้ว

    Hi while using the Date Filter, it does not work and in the terminal I get an error saying : RuntimeWarning: DateTimeField TwitterL4.trend_start_time received a naive datetime (2019-05-14 00:00:00) while time zone support is active. How to resolve this

    • @malikrumi1206
      @malikrumi1206 3 ปีที่แล้ว

      Hey, it's like 9 months later, so I don't know if you still need an answer or not, but basically there are two kinds of time: 'naive', and 'timezone'. So timezone should be obvious, and naive is a time without time zone information. In your settings you are using timezone (it might just say 'tz') but the code is time naive, which is why you got this error. Look up time and time zone in the Django docs for more info.

  • @doniyorabduvokhidov1706
    @doniyorabduvokhidov1706 4 ปีที่แล้ว +1

    {% empty %}
    No results found