Django community: RSS
This page, updated regularly, aggregates Django Q&A from the Django community.
-
How to propertly style login/signup forms in django-allauth?
What is actually the correct way to have my own login forms in django-allauth? 1) Should I use {{ form.as_p }} and create my own LoginForm class. Where should I insert my HTML code then? 2) Should I not use {{ form.as_p }} at all and do my own HTML markup with every form field in my signup.html template. Thanks. -
how to save QR Code number in database Sqlite
I have a number and i´d like to transforme it in qr code and save into my database SQLite. Then i have to show this qr code on the screen and i don´t know how to do that. -
Heatmaps using leaflet.js and Django
I'm working on django frame work ,can anyone help me on how to create a Heat map in django using any javascript framework and populate it custom location points. -
mod_wsgi: Exception occurred processing WSGI script (django deployment)
I'm trying to deploy a django project with the following Apache configuration: Apache virtualhost configuration <Virtualhost *:80> DocumentRoot /var/www/project/backend ErrorLog ${APACHE_LOG_DIR}/error.log CustomLog ${APACHE_LOG_DIR}/access.log combined WSGIDaemonProcess backend python-home=/var/www/project/myenv python-path=/var/www/gestor_documental/backend WSGIProcessGroup backend WSGIScriptAlias / /var/www/project/backend/backend/wsgi.py process-group=backend Alias /static/ /var/www/project/backend/static/ <Directory /var/www/project/backend> Require all granted </Directory> </Virtualhost> wsgi.load file LoadModule wsgi_module "/var/www/project/myenv/lib/python3.5/site-packages/mod_wsgi/server/mod_wsgi-py35.cpython-35m-x86_64-linux-gnu.so" WSGIPythonHome "/var/www/project/myenv" The wsgi.py is the one django brings by default This is the project tree: project |- backend | |- api (django app) | |- backend | |- ... | |- settings.py | |- wsgi.py |-- myenv (virtualenv) And this is the error log I keep getting when i try to load the web: mod_wsgi (pid=38953): Failed to exec Python script file '/var/www/project/backend/backend/wsgi.py'. mod_wsgi (pid=38953): Exception occurred processing WSGI script '/var/www/project/backend/backend/wsgi.py'. Traceback (most recent call last): File "/var/www/project/backend/backend/wsgi.py", line 16, in <module> application = get_wsgi_application() File "/var/www/project/myenv/lib/python3.5/site-packages/django/core/wsgi.py", line 13, in get_wsgi_application django.setup(set_prefix=False) File "/var/www/project/myenv/lib/python3.5/site-packages/django/__init__.py", line 22, in setup configure_logging(settings.LOGGING_CONFIG, settings.LOGGING) File "/var/www/project/myenv/lib/python3.5/site-packages/django/conf/__init__.py", line 53, in __getattr__ self._setup(name) File "/var/www/project/myenv/lib/python3.5/site-packages/django/conf/__init__.py", line 41, in _setup self._wrapped = Settings(settings_module) File "/var/www/project/myenv/lib/python3.5/site-packages/django/conf/__init__.py", line 97, in __init__ mod = importlib.import_module(self.SETTINGS_MODULE) File "/var/www/project/myenv/lib/python3.5/importlib/__init__.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "<frozen importlib._bootstrap>", line 986, in _gcd_import File "<frozen importlib._bootstrap>", line 969, in _find_and_load File … -
Django: How to filter my models (by child)?
Making my university project, I've described several models for e-commerce of goods: Item, Book(Item), Stationery(Item), and ItemImage (related by ForeignKey for all Item-like models). So, I need to filter the set of item images in the following way: def home(request): goods_images = ItemImage.objects.filter(is_active=True, is_main=True) goods_images_books = ItemImage.objects.filter(is_active=True, is_main=True) goods_images_stationeries = ItemImage.objects.filter(is_active=True, is_main=True) return render(request, 'landing/home.html', locals()) The question is what the additional parameter I should add to filter() or implement another way of solving this problem. -
click a form button based on the url parameters passed
I am trying to get this working from a long time now but cannot seem to get it right- my x.html- <div class="col-lg-2 col-lg-offset-4"> <a href="#add" id="addform" role="button" class="btn btn-info pull-right" data-toggle="modal" style="margin-top:20px">Add Contract</a> </div> {% include "a_bs3.html" with form_title="Add :" form_btn="Add" form_id="add" ajax="True" %} <script> $(document).ready(function() { var check = location.hash; if (check == "trigger") { //button trigger even though you do not click on it $('#addform').click(); } }); </script> I am trying to trigger this 'Add :' form button whenever the url contains a value "trigger" but the button is not auto-clicking, what am I doing wrong? If you click 'Add :' manually- the form opens up just fine. -
Django admin shows randomly 504 Gateway Time-out
In the django admin, when openning the change_list view of one of my django models I sometimes (not always) get a "504 Gateway Time-out" after about 5 seconds. When the error appears, there's an "Ignoring EPIPE" message in the gunicorn log. It's an supervisor-gunicorn-nginx-django environment. In the supervisor configuration I tried timeout=60 In the nginx configuration I've got proxy_connect_timeout 60; proxy_read_timeout 90; proxy_send_timeout 90; If I remove most of the elements of the model, it seems the error disappears but I'm not completely sure about this. -
stringreplace on Django
I need to do the 'string replace' on all my queryset, but I receive the following error: 'QuerySet' object has no attribute 'replace' def get_profilesJson_view(self): queryset = Reports.objects.all().values('val_x','val_y').order_by('-time_end')[:1] new_queryset = queryset.replace(queryset, ';', ',') reports_list = list(new_queryset) return JsonResponse(reports_list, safe=False) How can I do? Is it possible to use the '.filter' function? I have not experience with Django -
I am working with Django, During inserting data into database i caught such error
I'm working with django, during inserting data into tables the error is generates as given below... Error: int() argument must be a string, a bytes-like object or a number, not 'Tbl_rule_category', How can we solve such error? view.py dataToRuleCtgry = Tbl_rule_category(category=category, created_by="XYZ",created_date=datetime.date.today()) dataToRuleCtgry.save() dataToRule = Tbl_rule(rule_name=rule_name, closure=closure,category_id=Tbl_rule_category.objects.latest('category_id'), created_by="XYZ",created_date=datetime.date.today(), updated_by="XYZ", updated_date=datetime.date.today(), rule_type=rule_type, fk_tbl_rule_tbl_rule_category_id=Tbl_rule_category.objects.latest('category_id')) dataToRule.save() models.py class Tbl_rule_category(models.Model): category_id = models.AutoField(primary_key=True) category = models.CharField(max_length=50) created_by = models.CharField(max_length=50) created_date = models.DateField(auto_now_add=True) def __str__(self): pass # return self.category, self.created_by class Tbl_rule(models.Model): rule_id = models.AutoField(primary_key=True) rule_name = models.CharField(max_length=50) closure = models.CharField(max_length=50) category_id = models.IntegerField() created_by = models.CharField(max_length=50) created_date = models.DateField(auto_now_add=True) updated_by = models.CharField(max_length=50) updated_date = models.DateField(auto_now=True) rule_type = models.CharField(max_length=50) fk_tbl_rule_tbl_rule_category_id = models.ForeignKey(Tbl_rule_category,on_delete=models.CASCADE, related_name='fk_tbl_rule_tbl_rule_category_id_r') def __str__(self): return self.rule_name, self.closure, self.created_by, self.updated_by, self.rule_type -
Django Hierarchy Permissions
I want to have hierarchical level permissions in my Django Applications. For eg:- Consider there are 4 levels - Admin Sub-admin(CountryLevel(CL) Admin) sub-sub-admin(StateLevel(SL) Admin) And then normal Users(U). Admins will create CL, in return CL will create SL, and SL will finally onboard the users. The end goal is to onboard the users. Admins have the access to apply CRUD operation on any user. CL should have access to those users(objects) which were onboarded(created) by the CL created SLs. In return, SL should have access to only those users(objects) onboarded(created) by him. Also, a user can get himself registered directly without any admins involved. In such case, the user shall have access to his own application. How can I achieve such tree-level like permissions? The solution that I can think of is (but not sure about it):- I've updated auth_group table and added parent_id into it. Following is the schema. id, group_name, parent_id The significance of parent_id is to create a tree-like structure of the groups. The number of groups created is equal to the height of the tree. For eg consider following structure:- id, group_name, parent_id 1 , admin, 0 2, CL, 1 3, SL, 2 Now when any … -
how can i Validate my email id already exist in database
how can i Validate my email id already exist in database. how can i Validate my email id already exist in database. how can i Validate my email id already exist in database. how can i Validate my email id already exist in database. how can i Validate my email id already exist in database. how can i Validate my email id already exist in database. how can i Validate my email id already exist in database. how can i Validate my email id already exist in database. views.py from django.shortcuts import render from django.http import * from myapp.forms import User from django.contrib import messages from myapp.models import reg def registration(request): if request.method=='POST': form = User(request.POST) if form.is_valid(): id=form.cleaned_data['email'] dbuser = reg.objects.filter(email=id) if not dbuser: form.save(commit=True) messages.success(request, 'Registraion succesfull') return HttpResponseRedirect('/registration/') else: messages.error(request,'id is already available') return HttpResponseRedirect('/registration/') else: form=User() return render(request,'registration.html',{'form':form}) models.py from django.db import models class reg(models.Model): username=models.CharField(max_length=20) fname = models.CharField(max_length=20) lname = models.CharField(max_length=50) email = models.EmailField(max_length=50,primary_key=True) password=models.CharField(max_length=20) def __str__(self): return self.username forms.py from myapp.models import reg from django import forms class User(forms.ModelForm): username=forms.CharField(widget=forms.TextInput(attrs={'class':'form-control','placeholder':'enter username'}), required=True,max_length=50) email = forms.EmailField(widget=forms.EmailInput(attrs={'class': 'form-control', 'placeholder': 'enter email'}), required=True, max_length=50) fname = forms.CharField(widget=forms.TextInput(attrs={'class': 'form-control', 'placeholder': 'enter firstname'}), required=True, max_length=50) lname = forms.CharField(widget=forms.TextInput(attrs={'class': 'form-control', … -
How i create diff. list_filters for superuser and staff user
In admin i want to display diff. list_filter for superuser and staff user. How it possible. When superuser is logged in: list_filter = ('is_active', 'membership_type', 'is_blocked') and for staff user with limited permission list_filters should be: list_filter = ('is_active',) -
AttributeError: 'module' object has no attribute 'home'
from django.conf import settings from django.conf.urls.static import static from django.conf.urls import url from django.contrib import admin from profiles import views urlpatterns = [ url(r'^admin/', admin.site.urls), url(r'^$', views.home, name='home'), ] if settings.DEBUG: urlpatterns += static(settings.STATIC_URL, document_root=settings.STATIC_ROOT) urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT) Im doing this project with Django 1.10 in virtualenv but it keeps doing this #error. -
Django 1.11: "global name 'user' is not defined"
I have a survey app - you create a Survey and it saves the Response. It's registered in Django Admin. I can see the Survey and submit a Response. When I click Response in Admin, I get the following error: ValueError at /admin/django_survey/response/ Cannot query "response 5f895af5999c49929a522316a5108aa0": Must be "User" instance. So I checked the SQL database and for django_survey_response I can see that there is a response, but the column user_id is NULL. I suspected that there's an issue with my Views and/or Forms and I'm not saving the logged in User's details, so I've tried to address that. However, now I get NameError at /survey/1/ global name 'user' is not defined How do I resolve this? I want the form to save Response with the logged in user's ID. The Traceback: django_survey\views.py def SurveyDetail(request, id): survey = Survey.objects.get(id=id) category_items = Category.objects.filter(survey=survey) categories = [c.name for c in category_items] print 'categories for this survey:' print categories if request.method == 'POST': form = ResponseForm(request.POST, survey=survey) <......................... if form.is_valid(): response = form.save() return HttpResponseRedirect("/confirm/%s" % response.interview_uuid) else: form = ResponseForm(survey=survey) print form django_survey\forms.py def __init__(self, *args, **kwargs): # expects a survey object to be passed in initially survey = kwargs.pop('survey') self.survey … -
How to keep DRY while creating common models in Django?
For example I have 2 main models in my django app: class Employee(Model): name = CharField(max_length=50) class Client(Model): title = CharField(max_length=50) Abstract base class for phones: class Phone(Model): number = CharField(max_length=10) class Meta: abstract = True Inherited separate classes for Employee and for Client: class EmployeePhone(Phone): employee = ForeignKey(Employee, on_delete=CASCADE, related_name='employee_phones') class ClientPhone(Phone): client = ForeignKey(Client, on_delete=CASCADE, related_name='client_phones') It works but I don't like it, I would prefer to keep just one Phone model instead of 3. I know I could use Generic-Models but unfortunately that's not longer an option, because my app is actually REST-API and it seems to be impossible to create Generic-Object while creating Parent-Object. So is there any solution to keep things clean and DRY ? -
django heroku amazon s3 bad request (400)
I have recently published a website in heroku using django and amazon s3 for static files. The website loads ok but when I visit some pages of my website I get a bad request (400) error message. Here is the heroku error log: 2018-03-15T11:40:23.414590+00:00 app[web.1]: 10.225.52.12 - - [15/Mar/2018:11:40:23 +0000] "GET /%CE%B5%CF%80%CE%B9%CE%BA%CE%BF%CE%B9%CE%BD%CF%89%CE%BD%CE%AF%CE%B1/ HTTP/1.1" 400 26 "https://matakiaslifts.herokuapp.com/%CE%B5%CE%B3%CE%BA%CE%B1%CF%84%CE%AC%CF%83%CF%84%CE%B1%CF%83%CE%B7/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.162 Safari/537.36" Any help will be appreciated! -
Django all lauth multiple user type
Im trying to implement two user types while using all-auth out of the box with django 1.11 cookiecutter. Ive tried the solution here Multiple user type sign up with django-allauth But the seeker type one to one relationship is never created only the user. Anyone implement this before? TIA Models from django.contrib.auth.models import AbstractUser from django.core.urlresolvers import reverse from django.db import models from django.utils.encoding import python_2_unicode_compatible from django.utils.translation import ugettext_lazy as _ import config.settings.base as settings @python_2_unicode_compatible class User(AbstractUser): # First Name and Last Name do not cover name patterns # around the globe. name = models.CharField(_('Name of User'), blank=True, max_length=255) def __str__(self): return self.username def get_absolute_url(self): return reverse('users:detail', kwargs={'username': self.username}) class Seeker(models.Model): user = models.OneToOneField(User, on_delete=models.CASCADE) user_location = models.ForeignKey('location.Location', null=True, blank=True) class Meta: verbose_name = "Seeker" verbose_name_plural = "Seekers" def __str__(self): return self.user.username Form from allauth.account.forms import SignupForm from .models import Seeker, Employer class SeekerSignUpForm(SignupForm): def save(self, request): # Save the User instance and get a reference to it user_seeker = super(SeekerSignUpForm, self).save(request) # Create an instance of your model with the extra fields # then save it. # (N.B: the are already cleaned, but if you want to do some # extra cleaning just override the clean method … -
SchemaGenerator get_description(...) where is it now?
Updated to Django Resto Framework 3.7.7 and got to updating the legacy code when I came about this pearl: def get_description(self, path, method, view) In the SchemaGenerator class. This method was called from another class in the legacy code that inherits from SchemaGenerator. I have spent hours looking to see where it was moved to or if there's an alternative for that, but I can't seem to find anything on the documentation. Places I've looked: http://www.django-rest-framework.org/topics/release-notes/#37x-series https://github.com/encode/django-rest-framework/search?q=SchemaGenerator&type=Commits&utf8=%E2%9C%93 I see that a new class has been added called AutoSchema with the function get_description() problem is I don't know why it was created or if it's meant to substitute SchemaGenerator (until it goes deprecate). I am having a hard time finding information on this. I'd appreciate if anyone pointed me in the right direction. -
Django prefetch_related multiple queries
I'm using prefetch_related to join three tables. Products, ProductPrices and ProductMeta. But besides I'm following the documentation, the debugger says that I'm using three queries instead of one (with joins) Also this creates a second problem. Some products doesn't have prices in some countries because they are not avaliable there. But using this code, the product appears but with an empty price. So, I'd like to do all in one query with joins, and also I'd like to exclude the products that doesn't have prices or meta. I'm doing something wrong? This is my code: prefetch_prices = Prefetch( 'product_prices', queryset=ProductPrices.objects.filter(country=country_obj), to_attr='price_info' ) prefetch = Prefetch( 'product_meta', queryset=ProductMeta.objects.filter(language=lang), to_attr='meta_info' ) products = Product.objects.prefetch_related(prefetch, prefetch_prices).all() That produces these SQL Queries: { 'sql': 'SELECT DISTINCT `products`.`id`, `products`.`image`, ' '`products`.`wholesale_price`, `products`.`reference`, ' '`products`.`ean13`, `products`.`rating`, `products`.`sales`, ' '`products`.`active`, `products`.`active_in`, ' '`products`.`encilleria`, `products`.`delivery`, ' '`products`.`stock`, `products`.`ingredients`, ' 'FROM `products` WHERE `products`.`active` = 1 ', 'time': '0.098'}, { 'sql': 'SELECT `products_meta`.`id`, `products_meta`.`product_id`, ' '`products_meta`.`name`, `products_meta`.`slug`, ' '`products_meta`.`tagline`, `products_meta`.`key_ingredients`, ' '`products_meta`.`ideal_for`, `products_meta`.`description`, ' '`products_meta`.`advice`, `products_meta`.`summary`, ' '`products_meta`.`language` FROM `products_meta` WHERE ' "(`products_meta`.`language` = 'en' AND " '`products_meta`.`product_id` IN (52001, 51972, 52038, 52039, ' '52040, 52041, 51947, 51948, 51949, 51950, 51951, 51953, 51954, ' '51832))', 'time': '0.096'}, { 'sql': … -
Where the `csrftoken` store in Django database?
Where the csrftoken store? when I access a API endpoint (logout API, it do not need the params): POST /rest-auth/logout/ HTTP/1.1 Host: 10.10.10.105:8001 Connection: keep-alive Content-Length: 0 Accept: application/json, text/plain, */* Origin: http://localhost:8080 Authorization: Token 0fe2977498e51ed12ddc93026b08ab0b1a06a434 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.146 Safari/537.36 Referer: http://localhost:8080/register Accept-Encoding: gzip, deflate Accept-Language: zh-CN,zh;q=0.9,en;q=0.8 Cookie: sessionid=b95zopro0qvkrexj8kq6mzo1d3z2hvbl; csrftoken=z53lKL0f7VHkilYS5Ax8FMaQCU2ceouje9OeTJOgTy4gH0UgHVltAlOe2KFNNNB6 the header is upper. In the Response I will a error: {"detail":"CSRF Failed: CSRF token missing or incorrect."} So, the backend must verified the csrftoken. in the backend database, I can not find the csrftoken field: whether it is saved in the encrypted session_data? -
Internet shop in django. How to filter orders by user?
For my project i wrote account, cart, orders and shop apps. order/models: from django.db import models from shop.models import Product class Order(models.Model): first_name = models.CharField(max_length=50) last_name = models.CharField(max_length=50) email = models.EmailField() address = models.CharField(max_length=250) postal_code = models.CharField(max_length=20) city = models.CharField(max_length=100) created = models.DateTimeField(auto_now_add=True) updated = models.DateTimeField(auto_now=True) paid = models.BooleanField(default=False) class Meta: ordering = ('-created',) def __str__(self): return 'Order {}'.format(self.id) def get_total_cost(self): return sum(item.get_cost() for item in self.items.all()) class OrderItem(models.Model): order = models.ForeignKey(Order, related_name='items', on_delete=models.CASCADE) product = models.ForeignKey(Product, related_name='order_items', on_delete=models.CASCADE) price = models.DecimalField(max_digits=10, decimal_places=2) quantity = models.PositiveIntegerField(default=1) def __str__(self): return '{}'.format(self.id) def get_cost(self): return self.price * self.quantity account/models is empty account/views: from django.contrib.auth import login as auth_login from django.shortcuts import render, redirect from .forms import SignUpForm from orders.models import OrderItem, Order from django.contrib.auth.decorators import login_required def signup(request): if request.method == 'POST': form = SignUpForm(request.POST) if form.is_valid(): user = form.save() auth_login(request, user) return redirect('/') else: form = SignUpForm() return render(request, 'accounts/signup.html', {'form': form}) @login_required def account(request): my_orders = Order.objects.all() order_items = OrderItem.objects.all() return render(request, "accounts/my_acc.html", {"my_orders": my_orders, "order_items": order_items}) As you can see in account function i get all orders , but i don't know how to filter orders for user. What do i want is - when user enter in his … -
How do I hide or show content for each iteration?
I have a Lecture model which contains lectures. For each lecture I have a title and a content and eventually some files. I was trying to make that when somebody presses on a title, the title and the content will display under, but only for that lecture. Problem is that if I use a class, all lectures will be shown and if I use and id only the first one will be shown. How should I do this ? $('#title').click(function () { $('#lecture-hide').toggle(); }); {% for c in category.list %} <div id="title"> <p>Lecture {{ forloop.counter }}: <span>{{ c.lecture_title }}</span> </p> <br> </div> <div id="lecture-hide" style="display: none;"> <br> <li><h5>{{ c.lecture_title }}</h5></li> <li><p>{{ c.content }}</p></li> {% for file in c.files.all %} {% if file.files %} {% if forloop.first %} <p id="files">Lecture files:</p> {% endif %} <li><a class="media" href='{{ MEDIA_URL }}{{ file.files.url }}'><i class="fas fa-download"></i>{{ file.files.name }}</a></li> {% endif %} {% endfor %} <br> </div> {% endfor %} -
How to Save token in Shared Preferences received in Headers from DJango Rest Api
I am using volley in android.I am sending username and password to DJango rest Api and I get Token in Response.I need to get this Token from response Headers and save into sharedpreferences.How to get this Token from Headers and save it ? JsonObjectRequest req = new JsonObjectRequest(Request.Method.GET, url, null, new Response.Listener<JSONObject>() { @Override public void onResponse(JSONObject response) { } }, new Response.ErrorListener() { @Override public void onErrorResponse(VolleyError error) { if (error != null) { // Log.d(TAG, error.toString()) //Toast.makeText(getActivity(), "Enter Valid Username and Password", Toast.LENGTH_LONG).show(); coolToast.make("Invalid Details !",CoolToast.DANGER); coolToast.setRounded(true); coolToast.setDuration(CoolToast.SHORT); } } }) { @Override public Map<String, String> getHeaders() throws AuthFailureError { Map<String, String> headers = new HashMap<>(); String credentials = name+":"+pass; String auth = "Basic " + Base64.encodeToString(credentials.getBytes(), Base64.NO_WRAP); headers.put("Content-type", "application/json"); headers.put("Authorization", auth); return headers; } } }; -
Implement django-filter MultipleModelChoiceField for reverse relationship lookup?
I have been using django-filters for one of my project. As per documentation I have implemented a Product filter(for colours and material) for my product models. But after much try still cannot implement reverse look for product sizes which is in another table ProductSize models.py class Product(models.Model): product_name = models.CharField(max_length=500) product_color = models.ForeignKey(Colour,related_name='productcolor') product_material=models.ForeignKey(Material) def __str__(self): return self.product_name class ProductSize(models.Model): product=models.ForeignKey('Product',related_name='details') value = models.CharField(max_length=50) stock= models.IntegerField(default=1) items_sold = models.IntegerField(default=0) description = models.TextField(blank=True) def __unicode__(self): return self.value class Colour(models.Model): colour=models.CharField(max_length=100) colour_code=models.CharField(max_length=100,null=True,blank=True) def __unicode__(self): return u'%s' %self.colour class Material(models.Model): material=models.CharField(max_length=100) def __unicode__(self): return u'%s' %self.material filters.py class ProductFilter(django_filters.FilterSet): product_material=django_filters.ModelMultipleChoiceFilter(queryset=Material.objects.all(), widget=forms.CheckboxSelectMultiple) product_color=django_filters.ModelMultipleChoiceFilter(queryset=Colour.objects.all(), widget=forms.CheckboxSelectMultiple) class Meta: model = Product fields=['product_color','product_material'] views.py def product_view(request): product=Product.objest.all() f = ProductMaterialFilter(request.GET, queryset=product) context={'filter':f,} return render(request,'product.html',context) django versions==1.10.8 django-filter==1.1.0 I need to know steps for size filtering by 'value' of ProductSize models for ProductFilter enter image description hereAny help would be much appreciated.. Thankyou -
How to get a nested data from different models in django.?
In my webpage, i need to click on a link that takes me to the list of college names....then by selecting the name it needs to take me to the list of departments available in the particular college..then by choosing a department it needs to take me to the list of available blood groups ...then by choosing a blood group it needs to take me to the list of students available for the particular blood group...!! these should be linked on a chained manner..!! how can i do this with the help of models...please give me some suggestions friends..!! iam a learner..!!