{"id":329329,"date":"2023-09-28T18:49:34","date_gmt":"2023-09-28T18:49:34","guid":{"rendered":"https:\/\/pythonguides.com\/?p=16487"},"modified":"2023-09-28T18:49:34","modified_gmt":"2023-09-28T18:49:34","slug":"python-filter-not-in-django","status":"publish","type":"post","link":"https:\/\/itteacheritfreelance.hk\/wordpress\/index.php\/2023\/09\/28\/python-filter-not-in-django\/","title":{"rendered":"Python filter not in Django"},"content":{"rendered":"<p class=\"syndicated-attribution\"><meta name= \\\"keywords \\\" content= \\\"\u96fb\u5b50\u8a08\u7b97\u6a5f, \u6559\u80b2, IT \u96fb\u8166\u73ed,\u96fb\u8166\u88dc\u7fd2\uff0c \u96fb\u8166\u73ed\uff0c \u5bb6\u6559\uff0c \u79c1\u4eba\u8001\u5e2b\uff0c \u8cc7\u8a0a\u6280\u8853\uff0c \u7a0b\u5e8f\u8a2d\u8a08\uff0c \u96fb\u5b50\u8a08\u7b97\u6a5f\uff0c \u904a\u6232\uff0c \u860b\u679c\uff0c \u96fb\u5f71\uff0c \u8a08\u7b97\u6a5f\uff0c\u7de8\u78bc\uff0c Java\uff0c C\/C++\uff0c JavaScript\uff0c PHP\uff0c HTML\uff0c CSS\uff0c MySQL\uff0c mobile\uff0c Android\uff0c \u52d5\u6f2b\uff0c Python\uff0c teacher\uff0c \u88dc\u7fd2\uff0c \u96fb\u8166\u88dc\u7fd2 \u8cc7\u8a0a, \u7535\u5b50\u8ba1\u7b97\u673a, IT ,Game, apple, movie, Computer,student,Java,\u6559\u80b2, ,\u5b66\u751f, \u5b66\u4e60, learn, \u6559\u5b66,  Android, apple,anime, animation, \u4fe1\u606f\u6280\u672f, \u7a0b\u5e8f\u8bbe\u8ba1, \u79fb\u52a8\u7535\u8bdd, \u8cc7\u8a0a\u79d1\u6280,Game, Jeu, Juego,Call Of Duty ,\u4f7f\u547d\u53ec\u559a , \u6e38\u620f, \u7535\u5b50\u6e38\u620f,, \u591a\u4eba\u7535\u5b50\u6e38\u620f, \u7f51\u7edc\u6e38\u620f\uff0conline\uff0conline game, \u624b\u673a\u6e38\u620f, mobile \\\"><\/p>\n<p>In this Python <a class=\"rank-math-link\" href=\"https:\/\/pythonguides.com\/what-is-python-django\/\"  rel=\"noreferrer noopener\">Django tutorial<\/a>, I will show how to use Python filter not in Django, where you will understand about <strong>&#8216;not in&#8217;<\/strong> operator that somehow acts equivalent to the filter.<\/p>\n<p>Additionally, you will understand how to use the <strong>&#8216;not in&#8217;<\/strong> in the view and template of your Django project. Finally, you will learn about the filter method <strong>exclude()<\/strong> in Django.<\/p>\n<h2 class=\"wp-block-heading\">Filter not in Django<\/h2>\n<p>In this section, we are going to discuss the <strong>&#8220;not in&#8221;<\/strong> filter in Django. <\/p>\n<p>In Python Django, the<strong> &#8220;not in&#8221;<\/strong> filter or we can say that the operator acts in the exact opposite way as the <strong>&#8220;in&#8221;<\/strong> filter. It tests for the presence of a specified value within a sequence, but the return values are the reverse of the <strong>&#8220;in&#8221;<\/strong> filter.<\/p>\n<p>When the <strong>&#8220;not in&#8221;<\/strong> filter is used in the condition with the <strong>value present inside<\/strong> the sequence, the statement returns the boolean result <strong>False<\/strong>. Whereas when the <strong>value is not present inside<\/strong> the sequence, the statement returns the boolean result <strong>True<\/strong>.<\/p>\n<p>From the sequence we mean, it can be lists, tuples, arrays, strings, dictionaries, etc.<\/p>\n<p>Read: <a href=\"https:\/\/pythonguides.com\/django-vs-reactjs\/\"  aria-label=\" (opens in a new tab)\" rel=\"noreferrer noopener\" class=\"rank-math-link\">Python Django vs ReactJS<\/a><\/p>\n<h3 class=\"wp-block-heading\">Django filter not in the list<\/h3>\n<p>In this section, we&#8217;ll learn to use the Django filter or we can say the operator &#8220;not in&#8221; in the Python list. And, in Django, the <strong>&#8220;not in&#8221;<\/strong> operators are commonly used in the <strong>if tags<\/strong>. <\/p>\n<p>In Django, there are two ways to use the<strong> &#8220;not in&#8221;<\/strong> filter in the list:<\/p>\n<ul>\n<li>Using views<\/li>\n<li>Using template<\/li>\n<\/ul>\n<p>So, let&#8217;s understand each way using a few examples. But first set the project environment by following the below steps:<\/p>\n<p>Open your command prompt and create a virtual environment named <strong>&#8216;env&#8217;<\/strong> using the below code.<\/p>\n<pre class=\"wp-block-code\"><code>python -m venv env<\/code><\/pre>\n<p>Activate the environment.<\/p>\n<pre class=\"wp-block-code\"><code>env\\Scripts\\activate<\/code><\/pre>\n<p>Install the latest version of Django.<\/p>\n<pre class=\"wp-block-code\"><code>pip install django<\/code><\/pre>\n<p>Create a Django project <strong>&#8216;django_filter&#8217;<\/strong> using the below command.<\/p>\n<pre class=\"wp-block-code\"><code>django-admin startproject django_filter .<\/code><\/pre>\n<p>Now create a Django app <strong>&#8216;django_notin&#8217;<\/strong> using the below command.<\/p>\n<pre class=\"wp-block-code\"><code>python manage.py startapp django_notin<\/code><\/pre>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"620\" src=\"https:\/\/pythonguides.com\/wp-content\/uploads\/2023\/09\/Filter-not-in-Django-Project-Setup-1024x620.jpg\" alt=\"Filter not in Django Project Setup\" class=\"wp-image-45497\" srcset=\"https:\/\/pythonguides.com\/wp-content\/uploads\/2023\/09\/Filter-not-in-Django-Project-Setup-1024x620.jpg 1024w, https:\/\/pythonguides.com\/wp-content\/uploads\/2023\/09\/Filter-not-in-Django-Project-Setup-300x182.jpg 300w, https:\/\/pythonguides.com\/wp-content\/uploads\/2023\/09\/Filter-not-in-Django-Project-Setup-768x465.jpg 768w, https:\/\/pythonguides.com\/wp-content\/uploads\/2023\/09\/Filter-not-in-Django-Project-Setup.jpg 1418w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" title=\"Filter not in Django Project Setup\"><\/figure>\n<\/div>\n<p>Then open the project in your preferred IDE such as <strong>Visual Studio Code<\/strong> and set the project and app-level URL patterns.<\/p>\n<p>So open the <strong>urls.py<\/strong> file of your Django project <strong>&#8216;django_filter&#8217;<\/strong> and add the following lines of code.<\/p>\n<pre class=\"wp-block-code\"><code>from django.contrib import admin\nfrom django.urls import path, include\n\nurlpatterns = &#91;\n    path('admin\/', admin.site.urls),\n    path('', include('django_notin.urls'))\n]<\/code><\/pre>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"963\" height=\"408\" src=\"https:\/\/pythonguides.com\/wp-content\/uploads\/2023\/09\/Filter-not-in-Django-Project-URL-Setup.jpg\" alt=\"Filter not in Django Project URL Setup\" class=\"wp-image-45498\" srcset=\"https:\/\/pythonguides.com\/wp-content\/uploads\/2023\/09\/Filter-not-in-Django-Project-URL-Setup.jpg 963w, https:\/\/pythonguides.com\/wp-content\/uploads\/2023\/09\/Filter-not-in-Django-Project-URL-Setup-300x127.jpg 300w, https:\/\/pythonguides.com\/wp-content\/uploads\/2023\/09\/Filter-not-in-Django-Project-URL-Setup-768x325.jpg 768w\" sizes=\"(max-width: 963px) 100vw, 963px\" title=\"Filter not in Django Project URL Setup\"><\/figure>\n<\/div>\n<p>Also set the URL at the app level, so create a new file <strong>urls.py<\/strong> in your Django app <strong>&#8216;django_notin&#8217;<\/strong> and in that file add the following lines of code.<\/p>\n<pre class=\"wp-block-code\"><code>from django.urls import path\r\nfrom .views import *\r\n\r\nurlpatterns = &#91;\r\n    path('', filter_app, name='filter_app')\r\n]<\/code><\/pre>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/pythonguides.com\/wp-content\/uploads\/2023\/09\/Filter-not-in-Django-App-URL-Setup.jpg\" alt=\"Filter not in Django App URL Setup\" class=\"wp-image-45502\" style=\"width:755px;height:374px\" width=\"755\" height=\"374\" srcset=\"https:\/\/pythonguides.com\/wp-content\/uploads\/2023\/09\/Filter-not-in-Django-App-URL-Setup.jpg 1020w, https:\/\/pythonguides.com\/wp-content\/uploads\/2023\/09\/Filter-not-in-Django-App-URL-Setup-300x149.jpg 300w, https:\/\/pythonguides.com\/wp-content\/uploads\/2023\/09\/Filter-not-in-Django-App-URL-Setup-768x380.jpg 768w\" sizes=\"(max-width: 755px) 100vw, 755px\" title=\"Filter not in Django App URL Setup\"><\/figure>\n<\/div>\n<h3 class=\"wp-block-heading\">Django filter not in list using views<\/h3>\n<p>Now create a view named <strong>&#8216;filter_app&#8217;<\/strong> that contains a list of blog names and pass the blogs to the template <strong>filter_app.html<\/strong>. <\/p>\n<p>So for the demonstration of the <strong>&#8220;not-in&#8221;<\/strong> operator which acts as a filter, here you will learn how to filter the list of data using the <strong>&#8220;not-in<\/strong>.<\/p>\n<p>Open the <strong>views.py<\/strong> file of your Django app <strong>&#8216;django_notin&#8217;<\/strong> and add the following lines of code.<\/p>\n<pre class=\"wp-block-code\"><code>from django.shortcuts import render\n\n# Create your views here.\n\ndef filter_app(request):\n    blogs = &#91;\"Python\", \"MariaDB\", \"MySql\", \"Machine Learning\", \"PostgreSql\"]  \n    result = (\"MySql\" not in blogs )\n    return render(request, 'filter_app.html', {'result':result})<\/code><\/pre>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"341\" src=\"https:\/\/pythonguides.com\/wp-content\/uploads\/2023\/09\/Filter-not-in-Django-View-1024x341.jpg\" alt=\"Filter not in Django View\" class=\"wp-image-45503\" srcset=\"https:\/\/pythonguides.com\/wp-content\/uploads\/2023\/09\/Filter-not-in-Django-View-1024x341.jpg 1024w, https:\/\/pythonguides.com\/wp-content\/uploads\/2023\/09\/Filter-not-in-Django-View-300x100.jpg 300w, https:\/\/pythonguides.com\/wp-content\/uploads\/2023\/09\/Filter-not-in-Django-View-768x256.jpg 768w, https:\/\/pythonguides.com\/wp-content\/uploads\/2023\/09\/Filter-not-in-Django-View.jpg 1395w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" title=\"Filter not in Django View\"><\/figure>\n<\/div>\n<p>In the above code define the view named <strong>&#8216;filter_app&#8217;<\/strong> that contains a list of blogs.<\/p>\n<ul>\n<li>In line 4 list of blogs is defined and this is the <strong>blogs<\/strong> where you apply the not-in operator to exclude any of the values from the list.<\/li>\n<li>Now in line 5, the code <strong>(&#8220;MySql&#8221; not in blogs)<\/strong> checks if the string <strong>&#8216;MySql&#8217;<\/strong> is not in the blogs list, if the <strong>&#8216;MySql&#8217;<\/strong> is in the list then it returns <strong>False<\/strong> otherwise <strong>True<\/strong>.<\/li>\n<li>The return value is saved in the variable <strong>result<\/strong> and then this value is passed as context to the template <strong>filter_app.html<\/strong>.<\/li>\n<\/ul>\n<p>Also create the template file, that creates a new folder template in your Django app <strong>&#8216;django_notin&#8217;<\/strong>. In that folder create a new file <strong>filter_app.html<\/strong> and add the following lines of code.<\/p>\n<pre class=\"wp-block-code\"><code>&lt;!DOCTYPE html>\n&lt;html lang=\"en\">\n&lt;head>\n    &lt;meta charset=\"UTF-8\">\n    &lt;meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\">\n    &lt;meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n    &lt;title>PythonGuides&lt;\/title>\n&lt;\/head>\n\n&lt;body>\n    &lt;font color=\"green\">\n        Check MySql present in Blog or not (while using \"not in\" operator)\n        &lt;br>\n        &lt;br>\n    &lt;\/font>\n    &lt;font color=\"red\">\n        &lt;b> Result : &lt;\/b>{{result}}\n    &lt;\/font>\n&lt;\/body &lt;\/html><\/code><\/pre>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"489\" src=\"https:\/\/pythonguides.com\/wp-content\/uploads\/2023\/09\/Django-filter-not-in-list-using-views-tempalate-1024x489.jpg\" alt=\"Django filter not in list using views template\" class=\"wp-image-45504\" srcset=\"https:\/\/pythonguides.com\/wp-content\/uploads\/2023\/09\/Django-filter-not-in-list-using-views-tempalate-1024x489.jpg 1024w, https:\/\/pythonguides.com\/wp-content\/uploads\/2023\/09\/Django-filter-not-in-list-using-views-tempalate-300x143.jpg 300w, https:\/\/pythonguides.com\/wp-content\/uploads\/2023\/09\/Django-filter-not-in-list-using-views-tempalate-768x367.jpg 768w, https:\/\/pythonguides.com\/wp-content\/uploads\/2023\/09\/Django-filter-not-in-list-using-views-tempalate.jpg 1431w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" title=\"Django filter not in list using views tempalate\"><\/figure>\n<\/div>\n<p>In the <strong>filter_app.html<\/strong> file, we are just using the variable to get the result. In the end, we will get the following output.<\/p>\n<p>So run the Django server by running the below command in your terminal.<\/p>\n<pre class=\"wp-block-code\"><code>python manage.py runserver<\/code><\/pre>\n<p>After running the server go to the URL <strong>http:\/\/127.0.0.1:8000\/<\/strong> and you see the output as shown below.<\/p>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"238\" src=\"https:\/\/pythonguides.com\/wp-content\/uploads\/2021\/08\/django-filter-not-in-list-using-views-1024x238.png\" alt=\"django filter not in list using views\" class=\"wp-image-26467\" srcset=\"https:\/\/pythonguides.com\/wp-content\/uploads\/2021\/08\/django-filter-not-in-list-using-views-1024x238.png 1024w, https:\/\/pythonguides.com\/wp-content\/uploads\/2021\/08\/django-filter-not-in-list-using-views-300x70.png 300w, https:\/\/pythonguides.com\/wp-content\/uploads\/2021\/08\/django-filter-not-in-list-using-views-768x179.png 768w, https:\/\/pythonguides.com\/wp-content\/uploads\/2021\/08\/django-filter-not-in-list-using-views.png 1135w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" title=\"django filter not in list using views\"><\/figure>\n<\/div>\n<p>As you can see the result is a <strong>False<\/strong> value which means the string <strong>&#8216;MySql&#8217;<\/strong> exists in the <strong>blogs<\/strong> list. Here you can consider how <strong>&#8216;not in&#8217; <\/strong>checks for the not existence of the specific value in the list and returns the boolean.<\/p>\n<p>This means it filtres the value in the list, if that value exists in the list it returns <strong>False<\/strong> otherwise returns <strong>True<\/strong>.<\/p>\n<p>Let&#8217;s take one more example and this time check with the list of integer values.<\/p>\n<p>Add the following line of code in your view <strong>filter_app<\/strong> as shown below<\/p>\n<pre class=\"wp-block-code\"><code>from django.shortcuts import render\n\n# Create your views here.\n\ndef filter_app(request):\n    order = &#91;100, 101, 102, 103, 104, 105]  \n    result = (99 not in order)\n    return render(request, 'filter_app.html', {'result':result})<\/code><\/pre>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"409\" src=\"https:\/\/pythonguides.com\/wp-content\/uploads\/2023\/09\/Django-filter-not-in-list-using-template-view-1024x409.jpg\" alt=\"Django filter not in list using template view\" class=\"wp-image-45505\" srcset=\"https:\/\/pythonguides.com\/wp-content\/uploads\/2023\/09\/Django-filter-not-in-list-using-template-view-1024x409.jpg 1024w, https:\/\/pythonguides.com\/wp-content\/uploads\/2023\/09\/Django-filter-not-in-list-using-template-view-300x120.jpg 300w, https:\/\/pythonguides.com\/wp-content\/uploads\/2023\/09\/Django-filter-not-in-list-using-template-view-768x307.jpg 768w, https:\/\/pythonguides.com\/wp-content\/uploads\/2023\/09\/Django-filter-not-in-list-using-template-view.jpg 1228w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" title=\"Django filter not in list using template view\"><\/figure>\n<\/div>\n<p> In the above code, line 4 defines the list of integer values and stores them in the <strong>order<\/strong> variable. Then in line 5 check if the value <strong>99<\/strong> is not present in the order list and if the value is not present then it returns <strong>True<\/strong>, otherwise <strong>False<\/strong>.<\/p>\n<p>Also, modify the template <strong>filter_app.html<\/strong> file and add the following lines of code:<\/p>\n<pre class=\"wp-block-code\"><code>&lt;!DOCTYPE html&gt;\n&lt;html lang=\"en\"&gt;\n\n&lt;head&gt;\n    &lt;meta charset=\"UTF-8\"&gt;\n    &lt;meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\"&gt;\n    &lt;meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\"&gt;\n    &lt;title&gt;PythonGuides&lt;\/title&gt;\n&lt;\/head&gt;\n\n&lt;body&gt;\n    &lt;font color=\"green\"&gt;\n        Check Order Number 99 present in Order or not (while using \"not in\" operator)\n        &lt;br&gt;\n        &lt;br&gt;\n    &lt;\/font&gt;\n    &lt;font color=\"red\"&gt;\n        &lt;b&gt; Result : &lt;\/b&gt;{{result}}\n    &lt;\/font&gt;\n&lt;\/body &lt;\/html&gt;<\/code><\/pre>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"433\" src=\"https:\/\/pythonguides.com\/wp-content\/uploads\/2023\/09\/Django-filter-not-in-list-using-template-1024x433.jpg\" alt=\"Django filter not in list using template\" class=\"wp-image-45506\" srcset=\"https:\/\/pythonguides.com\/wp-content\/uploads\/2023\/09\/Django-filter-not-in-list-using-template-1024x433.jpg 1024w, https:\/\/pythonguides.com\/wp-content\/uploads\/2023\/09\/Django-filter-not-in-list-using-template-300x127.jpg 300w, https:\/\/pythonguides.com\/wp-content\/uploads\/2023\/09\/Django-filter-not-in-list-using-template-768x325.jpg 768w, https:\/\/pythonguides.com\/wp-content\/uploads\/2023\/09\/Django-filter-not-in-list-using-template-1536x649.jpg 1536w, https:\/\/pythonguides.com\/wp-content\/uploads\/2023\/09\/Django-filter-not-in-list-using-template.jpg 1633w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" title=\"Django filter not in list using template\"><\/figure>\n<\/div>\n<p>We simply use the variable to get the result in the <strong>filter_app.html<\/strong> file. Finally, we&#8217;ll get the following result.<\/p>\n<p>Now again open the URL <strong>http:\/\/127.0.0.1:8000\/<\/strong> and you see the result as shown below.<\/p>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"209\" src=\"https:\/\/pythonguides.com\/wp-content\/uploads\/2021\/08\/python-django-filter-not-in-list-using-views-1024x209.png\" alt=\"python django filter not in list using views\" class=\"wp-image-26468\" srcset=\"https:\/\/pythonguides.com\/wp-content\/uploads\/2021\/08\/python-django-filter-not-in-list-using-views-1024x209.png 1024w, https:\/\/pythonguides.com\/wp-content\/uploads\/2021\/08\/python-django-filter-not-in-list-using-views-300x61.png 300w, https:\/\/pythonguides.com\/wp-content\/uploads\/2021\/08\/python-django-filter-not-in-list-using-views-768x157.png 768w, https:\/\/pythonguides.com\/wp-content\/uploads\/2021\/08\/python-django-filter-not-in-list-using-views.png 1308w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" title=\"python django filter not in list using views\"><\/figure>\n<\/div>\n<p>From the above output result equal <strong>True<\/strong> means the value <strong>99<\/strong> doesn&#8217;t present the order list.<\/p>\n<h3 class=\"wp-block-heading\">Django filter not in list using a template tag<\/h3>\n<p>In the above topics you used the <strong>&#8216;not in&#8217;<\/strong> operator as a filter in your view function but you can also use it in the template with the help of the Django template tag.<\/p>\n<p>Let&#8217;s see an example where you create a list of programming languages in your view named <strong>filter_app<\/strong> by adding the following code in your <strong>views.py<\/strong> file.<\/p>\n<pre class=\"wp-block-code\"><code>from django.shortcuts import render\n\n# Create your views here.\n\ndef filter_app(request):\n    languages = &#91;\"C\", \"C++\", \"Python\", \"Java\"]\n    test = &#91;\"C Sharp\"]\n    return render(request, 'filter_app.html', {'languages': languages, 'test':test})<\/code><\/pre>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"333\" src=\"https:\/\/pythonguides.com\/wp-content\/uploads\/2023\/09\/Django-filter-not-in-list-using-a-template-tag-view-1024x333.jpg\" alt=\"Django filter not in list using a template tag view\" class=\"wp-image-45509\" srcset=\"https:\/\/pythonguides.com\/wp-content\/uploads\/2023\/09\/Django-filter-not-in-list-using-a-template-tag-view-1024x333.jpg 1024w, https:\/\/pythonguides.com\/wp-content\/uploads\/2023\/09\/Django-filter-not-in-list-using-a-template-tag-view-300x98.jpg 300w, https:\/\/pythonguides.com\/wp-content\/uploads\/2023\/09\/Django-filter-not-in-list-using-a-template-tag-view-768x250.jpg 768w, https:\/\/pythonguides.com\/wp-content\/uploads\/2023\/09\/Django-filter-not-in-list-using-a-template-tag-view-1536x500.jpg 1536w, https:\/\/pythonguides.com\/wp-content\/uploads\/2023\/09\/Django-filter-not-in-list-using-a-template-tag-view.jpg 1549w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" title=\"Django filter not in list using a template tag view\"><\/figure>\n<\/div>\n<p>The above code passes the list of <strong>languages<\/strong> and the variable <strong>test<\/strong> that contains a single value in the list to the template <strong>&#8216;filter_app.html&#8217;<\/strong>.<\/p>\n<p>Then add the following lines of code in the template <strong>filter_app.html<\/strong> file:<\/p>\n<pre class=\"wp-block-code\"><code>&lt;!DOCTYPE html&gt;\n&lt;html lang=\"en\"&gt;\n\n&lt;head&gt;\n    &lt;meta charset=\"UTF-8\"&gt;\n    &lt;meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\"&gt;\n    &lt;meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\"&gt;\n    &lt;title&gt;PythonGuides&lt;\/title&gt;\n&lt;\/head&gt;\n\n&lt;body&gt;\n    &lt;p&gt;\n        {% if test is not languages %}\n        {{test}} is not present in language list {{languages}}\n        {% else %}\n        {{test}} is present in language list {{languages}}\n        {% endif %}\n    &lt;\/p&gt;\n&lt;\/body \n&lt;\/html&gt;<\/code><\/pre>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"500\" src=\"https:\/\/pythonguides.com\/wp-content\/uploads\/2023\/09\/Django-filter-not-in-list-using-a-template-tag-1024x500.jpg\" alt=\"Django filter not in list using a template tag\" class=\"wp-image-45512\" srcset=\"https:\/\/pythonguides.com\/wp-content\/uploads\/2023\/09\/Django-filter-not-in-list-using-a-template-tag-1024x500.jpg 1024w, https:\/\/pythonguides.com\/wp-content\/uploads\/2023\/09\/Django-filter-not-in-list-using-a-template-tag-300x146.jpg 300w, https:\/\/pythonguides.com\/wp-content\/uploads\/2023\/09\/Django-filter-not-in-list-using-a-template-tag-768x375.jpg 768w, https:\/\/pythonguides.com\/wp-content\/uploads\/2023\/09\/Django-filter-not-in-list-using-a-template-tag.jpg 1412w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" title=\"Django filter not in list using a template tag\"><\/figure>\n<\/div>\n<p>Here, we add the <strong>&#8220;is not&#8221; <\/strong>operator in the template using the<strong> {%if%}<\/strong> tag at line 13. The tag evaluates the variables, if the condition is <strong>\u201ctrue\u201d<\/strong> the block  <strong>{{test}} is not present in language list {{languages}}<\/strong> is executed.<\/p>\n<p>Otherwise, in case of a <strong>&#8220;false&#8221;<\/strong> value, the <strong>{% else %}<\/strong> part of the block <strong>{{test}} is present in the language list {{languages}}<\/strong> is executed.<\/p>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/pythonguides.com\/wp-content\/uploads\/2021\/08\/django-filter-not-in-list-using-template.png\" alt=\"django filter not in list using template\" class=\"wp-image-26469\" style=\"width:735px;height:99px\" width=\"735\" height=\"99\" srcset=\"https:\/\/pythonguides.com\/wp-content\/uploads\/2021\/08\/django-filter-not-in-list-using-template.png 863w, https:\/\/pythonguides.com\/wp-content\/uploads\/2021\/08\/django-filter-not-in-list-using-template-300x41.png 300w, https:\/\/pythonguides.com\/wp-content\/uploads\/2021\/08\/django-filter-not-in-list-using-template-768x104.png 768w\" sizes=\"(max-width: 735px) 100vw, 735px\" title=\"django filter not in list using template\"><\/figure>\n<\/div>\n<p>In the above, you can see that the block <strong>{{test}} is not present in the language list {{languages}}<\/strong> is executed because the [&#8216;C Sharp&#8217;] is not present in the list of languages.<\/p>\n<p>Which means <strong>&#8216;not in&#8217;<\/strong> within the <strong>{%if%}<\/strong> returns <strong>True<\/strong> value.<\/p>\n<p>Take one more example and add the following lines of code to your <strong>views.py<\/strong> file<\/p>\n<pre class=\"wp-block-code\"><code>from django.shortcuts import render\n\n# Create your views here.\n\ndef filter_app(request):\n    vowels = &#91;\"A\", \"E\", \"I\", \"O\", \"U\"]\n    test = &#91;\"A\"]\n    return render(request, 'filter_app.html', {'vowels': vowels, 'test':test})<\/code><\/pre>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"418\" src=\"https:\/\/pythonguides.com\/wp-content\/uploads\/2023\/09\/Django-filter-not-in-list-using-a-template-view-1024x418.jpg\" alt=\"Django filter not in list using a template view\" class=\"wp-image-45518\" srcset=\"https:\/\/pythonguides.com\/wp-content\/uploads\/2023\/09\/Django-filter-not-in-list-using-a-template-view-1024x418.jpg 1024w, https:\/\/pythonguides.com\/wp-content\/uploads\/2023\/09\/Django-filter-not-in-list-using-a-template-view-300x122.jpg 300w, https:\/\/pythonguides.com\/wp-content\/uploads\/2023\/09\/Django-filter-not-in-list-using-a-template-view-768x313.jpg 768w, https:\/\/pythonguides.com\/wp-content\/uploads\/2023\/09\/Django-filter-not-in-list-using-a-template-view.jpg 1436w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" title=\"Django filter not in list using a template view\"><\/figure>\n<\/div>\n<p>In the above code with the view <strong>&#8216;filter_app&#8217;<\/strong>, the list of vowels and test list\u00a0is defined and then these lists are passed as context to the <strong>filter_app.html<\/strong> page.<\/p>\n<p>Also add the following code in the <strong>filter_app.html<\/strong> file:<\/p>\n<pre class=\"wp-block-code\"><code>&lt;!DOCTYPE html&gt;\n&lt;html lang=\"en\"&gt;\n\n&lt;head&gt;\n    &lt;meta charset=\"UTF-8\"&gt;\n    &lt;meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\"&gt;\n    &lt;meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\"&gt;\n    &lt;title&gt;PythonGuides&lt;\/title&gt;\n&lt;\/head&gt;\n\n&lt;body&gt;\n    &lt;p&gt;\n        {% if test is not vowels %}\n        {{test}} is one of the five friend\n        {% else %}\n        {{test}} is not in the list of five friend\n        {% endif %}\n    &lt;\/p&gt;\n&lt;\/body \n&lt;\/html&gt;<\/code><\/pre>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"467\" src=\"https:\/\/pythonguides.com\/wp-content\/uploads\/2023\/09\/Django-filter-not-in-list-using-a-template-1024x467.jpg\" alt=\"Django filter not in list using a template\" class=\"wp-image-45519\" srcset=\"https:\/\/pythonguides.com\/wp-content\/uploads\/2023\/09\/Django-filter-not-in-list-using-a-template-1024x467.jpg 1024w, https:\/\/pythonguides.com\/wp-content\/uploads\/2023\/09\/Django-filter-not-in-list-using-a-template-300x137.jpg 300w, https:\/\/pythonguides.com\/wp-content\/uploads\/2023\/09\/Django-filter-not-in-list-using-a-template-768x350.jpg 768w, https:\/\/pythonguides.com\/wp-content\/uploads\/2023\/09\/Django-filter-not-in-list-using-a-template.jpg 1376w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" title=\"Django filter not in list using a template\"><\/figure>\n<\/div>\n<p>Again go to the URL <strong>http:\/\/127.0.0.1:8000\/<\/strong> and see the output as shown below.<\/p>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"386\" height=\"105\" src=\"https:\/\/pythonguides.com\/wp-content\/uploads\/2021\/08\/python-django-filter-not-in-list-uisng-template.png\" alt=\"python django filter not in list uisng template\" class=\"wp-image-26472\" srcset=\"https:\/\/pythonguides.com\/wp-content\/uploads\/2021\/08\/python-django-filter-not-in-list-uisng-template.png 386w, https:\/\/pythonguides.com\/wp-content\/uploads\/2021\/08\/python-django-filter-not-in-list-uisng-template-300x82.png 300w\" sizes=\"(max-width: 386px) 100vw, 386px\" title=\"python django filter not in list uisng template\"><\/figure>\n<\/div>\n<p>Read: <a href=\"https:\/\/pythonguides.com\/django-random-number\/\"  aria-label=\" (opens in a new tab)\" rel=\"noreferrer noopener\" class=\"rank-math-link\">Python Django random number<\/a><\/p>\n<h3 class=\"wp-block-heading\">Django model filter not in<\/h3>\n<p>In this section, you&#8217;ll learn how to use the alternate method to the <strong>&#8220;not in&#8221;<\/strong> filter in Django models. In Django, <strong>&#8220;not in&#8221;<\/strong> means selecting the objects that contain the values that are not there in the given iterable.<\/p>\n<p>Basically, In Django, we don&#8217;t have any filter with the name &#8220;not in&#8221;. So, to work in the same way as the &#8220;not in&#8221; filter works. There is an exclude() method with the <strong>&#8220;in&#8221;<\/strong> lookup in Django.<\/p>\n<p>The exclude method returns the objects that do not match the given parameters.<\/p>\n<p><strong>The syntax is given below:<\/strong><\/p>\n<pre class=\"wp-block-code\"><code>queryset = model_name.objects.exclude(parameter__in=&#91;])<\/code><\/pre>\n<p>Let&#8217;s see different examples to clearly understand the concept of <strong>&#8220;exclude()&#8221;<\/strong>.<\/p>\n<p>Firstly, create the model with the name <strong>Employee<\/strong> in the<strong> model.py<\/strong> file of the app and add the following line of code.<\/p>\n<pre class=\"wp-block-code\"><code>from django.db import models\r\n\r\nclass Employee(models.Model):\r\n    first_name = models.CharField(max_length=200)\r\n    last_name = models.CharField(max_length=200)\r\n    position = models.CharField(max_length=100)\r\n    age = models.PositiveIntegerField()\r\n    \r\n    def __str__(self):  \r\n        return \"%s %s %s %s\" % (self.first_name, self.last_name, self.position, self.age)  <\/code><\/pre>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"372\" src=\"https:\/\/pythonguides.com\/wp-content\/uploads\/2023\/09\/Django-model-employee-filter-not-in-1024x372.jpg\" alt=\"Django model employee filter not in\" class=\"wp-image-45520\" srcset=\"https:\/\/pythonguides.com\/wp-content\/uploads\/2023\/09\/Django-model-employee-filter-not-in-1024x372.jpg 1024w, https:\/\/pythonguides.com\/wp-content\/uploads\/2023\/09\/Django-model-employee-filter-not-in-300x109.jpg 300w, https:\/\/pythonguides.com\/wp-content\/uploads\/2023\/09\/Django-model-employee-filter-not-in-768x279.jpg 768w, https:\/\/pythonguides.com\/wp-content\/uploads\/2023\/09\/Django-model-employee-filter-not-in-1536x558.jpg 1536w, https:\/\/pythonguides.com\/wp-content\/uploads\/2023\/09\/Django-model-employee-filter-not-in.jpg 1689w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" title=\"Django model employee filter not in\"><\/figure>\n<\/div>\n<p>Then, register the model. For this, add the following code in the <strong>admin.py<\/strong> file of the Django app <strong>&#8216;django_notin&#8217;<\/strong>.<\/p>\n<pre class=\"wp-block-code\"><code>from django.contrib import admin\r\nfrom .models import Employee\r\n\r\n\r\nclass AdminEmployee(admin.ModelAdmin):\r\n    list_display = &#91;'first_name', 'last_name', 'position', 'age']\r\n\r\nadmin.site.register(Employee, AdminEmployee)<\/code><\/pre>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"502\" src=\"https:\/\/pythonguides.com\/wp-content\/uploads\/2023\/09\/Django-register-model-employee-filter-not-in-1024x502.jpg\" alt=\"Django register model employee filter not in\" class=\"wp-image-45521\" srcset=\"https:\/\/pythonguides.com\/wp-content\/uploads\/2023\/09\/Django-register-model-employee-filter-not-in-1024x502.jpg 1024w, https:\/\/pythonguides.com\/wp-content\/uploads\/2023\/09\/Django-register-model-employee-filter-not-in-300x147.jpg 300w, https:\/\/pythonguides.com\/wp-content\/uploads\/2023\/09\/Django-register-model-employee-filter-not-in-768x376.jpg 768w, https:\/\/pythonguides.com\/wp-content\/uploads\/2023\/09\/Django-register-model-employee-filter-not-in.jpg 1278w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" title=\"Django register model employee filter not in\"><\/figure>\n<\/div>\n<p>Then open the Admin panel and add some of the records related to the <strong>Employee<\/strong> as shown in the below picture. If you want to know how to create an admin user, then refer to this tutorial <a href=\"https:\/\/pythonguides.com\/python-django-get-admin-password\/\">Python admin<\/a><\/p>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"473\" src=\"https:\/\/pythonguides.com\/wp-content\/uploads\/2023\/09\/Django-register-admin-employee-filter-not-in-1024x473.jpg\" alt=\"Django register admin employee filter not in\" class=\"wp-image-45522\" srcset=\"https:\/\/pythonguides.com\/wp-content\/uploads\/2023\/09\/Django-register-admin-employee-filter-not-in-1024x473.jpg 1024w, https:\/\/pythonguides.com\/wp-content\/uploads\/2023\/09\/Django-register-admin-employee-filter-not-in-300x139.jpg 300w, https:\/\/pythonguides.com\/wp-content\/uploads\/2023\/09\/Django-register-admin-employee-filter-not-in-768x355.jpg 768w, https:\/\/pythonguides.com\/wp-content\/uploads\/2023\/09\/Django-register-admin-employee-filter-not-in-1536x710.jpg 1536w, https:\/\/pythonguides.com\/wp-content\/uploads\/2023\/09\/Django-register-admin-employee-filter-not-in.jpg 1860w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" title=\"Django register admin employee filter not in\"><\/figure>\n<\/div>\n<p>After adding records you see the page as shown below.<\/p>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"207\" src=\"https:\/\/pythonguides.com\/wp-content\/uploads\/2022\/02\/django-model-filter-not-in-1024x207.png\" alt=\"django model filter not in\" class=\"wp-image-26492\" srcset=\"https:\/\/pythonguides.com\/wp-content\/uploads\/2022\/02\/django-model-filter-not-in-1024x207.png 1024w, https:\/\/pythonguides.com\/wp-content\/uploads\/2022\/02\/django-model-filter-not-in-300x61.png 300w, https:\/\/pythonguides.com\/wp-content\/uploads\/2022\/02\/django-model-filter-not-in-768x155.png 768w, https:\/\/pythonguides.com\/wp-content\/uploads\/2022\/02\/django-model-filter-not-in.png 1364w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" title=\"django model filter not in\"><figcaption class=\"wp-element-caption\">Employee<\/figcaption><\/figure>\n<\/div>\n<p>After that open the Python shell by running the below command in your terminal.<\/p>\n<pre class=\"wp-block-code\"><code>python manage.py shell<\/code><\/pre>\n<p>In this example, you&#8217;ll use the <strong>exclude<\/strong> method with the <strong>&#8220;in&#8221;<\/strong> field lookup. Here exclude some specific ages from the Age field.<\/p>\n<pre class=\"wp-block-code\"><code><strong># Import<\/strong>\n\nfrom django_notin.models import Employee\n\n<strong># QuerySet<\/strong>\n\nqueryset = Employee.objects.exclude(Age__in=&#91;28, 26])\nprint(queryset)<\/code><\/pre>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"244\" src=\"https:\/\/pythonguides.com\/wp-content\/uploads\/2023\/09\/Django-model-filter-not-in-1024x244.jpg\" alt=\"Django model filter not in\" class=\"wp-image-45523\" srcset=\"https:\/\/pythonguides.com\/wp-content\/uploads\/2023\/09\/Django-model-filter-not-in-1024x244.jpg 1024w, https:\/\/pythonguides.com\/wp-content\/uploads\/2023\/09\/Django-model-filter-not-in-300x71.jpg 300w, https:\/\/pythonguides.com\/wp-content\/uploads\/2023\/09\/Django-model-filter-not-in-768x183.jpg 768w, https:\/\/pythonguides.com\/wp-content\/uploads\/2023\/09\/Django-model-filter-not-in.jpg 1285w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" title=\"Django model filter not in\"><\/figure>\n<\/div>\n<p>In the above code, simply use the exclude method with the <strong>&#8220;in&#8221;<\/strong> field lookup to select the objects which do not have <strong>age<\/strong> values like <strong>28 and 26<\/strong>.  It will return all two objects that do not have these age values.<\/p>\n<h2 class=\"wp-block-heading\">Conclusion<\/h2>\n<p>In this Python Django Tutorial, you have learned &#8220;<strong>Python filter not in Django<\/strong>&#8221; and also learned how to use the &#8220;not in&#8221; in the view and the template side.<\/p>\n<p>Also, take a look at some more Django tutorials.<\/p>\n<ul>\n<li><a aria-label=\" (opens in a new tab)\" href=\"https:\/\/pythonguides.com\/python-django-set-timezone\/\"  rel=\"noreferrer noopener\" class=\"rank-math-link\">Python Django set timezone<\/a><\/li>\n<li><a aria-label=\" (opens in a new tab)\" href=\"https:\/\/pythonguides.com\/python-django-format-date\/\"  rel=\"noreferrer noopener\" class=\"rank-math-link\">Python Django format date<\/a><\/li>\n<li><a aria-label=\" (opens in a new tab)\" href=\"https:\/\/pythonguides.com\/python-change-django-version\/\"  rel=\"noreferrer noopener\" class=\"rank-math-link\">Python Change Django Version<\/a><\/li>\n<li><a aria-label=\" (opens in a new tab)\" href=\"https:\/\/pythonguides.com\/python-django-vs-pyramid\/\"  rel=\"noreferrer noopener\" class=\"rank-math-link\">Python Django vs Pyramid<\/a><\/li>\n<li><a aria-label=\" (opens in a new tab)\" class=\"rank-math-link\" href=\"https:\/\/pythonguides.com\/union-operation-on-models-django\/\"  rel=\"noreferrer noopener\">Union operation on models Django<\/a><\/li>\n<\/ul>\n\n<p class=\"syndicated-attribution\"><figure class= \\\"wp-block-image alignnone \\\"><img src= \\\"http:\/\/itteacheritfreelance.hk\/test\/wordpress\/wp-content\/uploads\/2016\/05\/logo2-2.png\\\" alt=\\\"IT\u96fb\u8166\u88dc\u7fd2 java\u88dc\u7fd2 \u70ba\u5927\u5bb6\u914d\u5c0d\u96fb\u8166\u88dc\u7fd2,IT freelance, \u79c1\u4eba\u8001\u5e2b, PHP\u88dc\u7fd2,CSS\u88dc\u7fd2,XML,Java\u88dc\u7fd2,MySQL\u88dc\u7fd2,graphic design\u88dc\u7fd2,\u4e2d\u5c0f\u5b78ICT\u88dc\u7fd2,\u4e00\u5c0d\u4e00\u79c1\u4eba\u88dc\u7fd2\u548cFreelance\u81ea\u7531\u5de5\u4f5c\u914d\u5c0d\u3002\\\"\/><figcaption>\u7acb\u523b\u8a3b\u518a\u53ca\u5831\u540d\u96fb\u8166\u88dc\u7fd2\u8ab2\u7a0b\u5427!<\/figcaption><\/figure>\r\n<\/br>Find A Teacher Form:\r\n<\/br>https:\/\/docs.google.com\/forms\/d\/1vREBnX5n262umf4wU5U2pyTwvk9O-JrAgblA-wH9GFQ\/viewform?edit_requested=true#responses\r\n<\/br><\/br>Email:\r\n<\/br>public1989two@gmail.com<br><br><br><br><br><br><br>\r\n<a href=www.itsec.hk style=color:#FFFFFF;>www.itsec.hk<\/a><br>\r\n<a href=\\\"www.itsec.vip\\\" style=color:#FFFFFF;>www.itsec.vip<\/a><br>\r\n<a href=\\\"www.itseceu.uk\\\" style=color:#FFFFFF;>www.itseceu.uk<\/a><br><\/p>","protected":false},"excerpt":{"rendered":"<div class=\"mh-excerpt\"><p>In this Python Django tutorial, I will show how to use Python filter not in Django, where you will understand about \u2018not in\u2019 operator that somehow acts equivalent to the filter. Additionally, you will understand how to use the \u2018not in\u2019 in the view and template of your Django project. Finally, you will learn about &#8230; <a title=\"Python filter not in Django\" class=\"read-more\" href=\"https:\/\/pythonguides.com\/filter-not-in-django\/\" aria-label=\"More on Python filter not in Django\">Read more&#8230;<\/a><\/p>\n<\/div>","protected":false},"author":2034,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"slim_seo":{"title":"Python filter not in Django - ITTeacherITFreelance.hk","description":"In this Python Django tutorial, I will show how to use Python filter not in Django, where you will understand about \u2018not in\u2019 operator that somehow acts equivale"},"footnotes":""},"categories":[10700],"tags":[10772],"_links":{"self":[{"href":"https:\/\/itteacheritfreelance.hk\/wordpress\/index.php\/wp-json\/wp\/v2\/posts\/329329"}],"collection":[{"href":"https:\/\/itteacheritfreelance.hk\/wordpress\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/itteacheritfreelance.hk\/wordpress\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/itteacheritfreelance.hk\/wordpress\/index.php\/wp-json\/wp\/v2\/users\/2034"}],"replies":[{"embeddable":true,"href":"https:\/\/itteacheritfreelance.hk\/wordpress\/index.php\/wp-json\/wp\/v2\/comments?post=329329"}],"version-history":[{"count":1,"href":"https:\/\/itteacheritfreelance.hk\/wordpress\/index.php\/wp-json\/wp\/v2\/posts\/329329\/revisions"}],"predecessor-version":[{"id":329330,"href":"https:\/\/itteacheritfreelance.hk\/wordpress\/index.php\/wp-json\/wp\/v2\/posts\/329329\/revisions\/329330"}],"wp:attachment":[{"href":"https:\/\/itteacheritfreelance.hk\/wordpress\/index.php\/wp-json\/wp\/v2\/media?parent=329329"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/itteacheritfreelance.hk\/wordpress\/index.php\/wp-json\/wp\/v2\/categories?post=329329"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/itteacheritfreelance.hk\/wordpress\/index.php\/wp-json\/wp\/v2\/tags?post=329329"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}