cj
ah, I got it, you mean using the mobile view using the desktop browser
Anonymous
Yes haha..
Anonymous
guys country = models.ForeignKey(Country,on_delete=models.CASCADE)
Anonymous
ı wanna filter tihs and count()
Anonymous
how can ı do tihs ??
Gil
https://stackoverflow.com/questions/1981524/django-filtering-on-foreign-key-properties https://docs.djangoproject.com/en/3.0/topics/db/queries/#retrieving-specific-objects-with-filters https://docs.djangoproject.com/en/3.0/topics/db/aggregation/
Julio
Hi, I need help. I'm trying to create_or_update in Django models save function with another model when I save it. Anyone have a example or idea how I could do it?
Anonymous
I want have a list of skills or items that can be update from my admin and be show in template I try using category and slug but not given me what I want need
Anonymous
This is what I want to archive in python code Skills=['CsS','html','go',] For skill in skills: Print(skill) Please have put this in my views.py and use the {%for skill in skill %} in my template but this logic is not working please help me out on how to structure it the code so that the view and template can understand
Gil
Are you passing skills in context? Paste return function view
Gil
https://docs.djangoproject.com/en/3.0/intro/tutorial03/#write-views-that-actually-do-something
Anonymous
Class project(model.models): Skill =models.textfield(max_length=20)
Gaurav
Guys is there any group for react js??
Anonymous
Please I need resource that explain more about performing login in views and is it composry to have a model for every logic just a little more explanation or resources that can help thanks
raven
from django.views.generic import ListView from .models import Skills class SkillsList(Listview): model = Skills context_object_name = 'skills' template_name = 'skills/skills_list.html'
raven
something like this
raven
actually you have to elaborate a bit about your need because i answered of what i understood from your request
Anonymous
Class project(model.models): Skill =models.textfield(max_length=20)
This is my model and I want the skills to be context on the same page of the project so am.having a single page
Cesar
Skills is taking a textfield
There it is, you are using a char field.... if you do a for look in a text, it will iterate over every CHAR in that field...
Cesar
What should I do bro
Create a model (language) then relate it to your model via a ManyToMany field....
raven
Create a model (language) then relate it to your model via a ManyToMany field....
maybe he should just do Skills.objects.all() and pass it down to template
raven
i think I'm nit getting his requirements
Cesar
maybe he should just do Skills.objects.all() and pass it down to template
he has Class project(model.models): Skill =models.textfield(max_length=20)
Cesar
he is trying to fo a for in a textfield
raven
yeah then it will be just objects = project.objects.all() and use {{object.Skill}} in template
Cesar
(s)he might be confused with text VS. list...
raven
😁👍
SI
I have a problem on django rest API when i am trying to login error show
Doragonsureiyā
I have a problem on django rest API when i am trying to login error show
To share code or error tracebacks please use an online pasting service, here is a list of suggested sites: - https://del.dog - https://linkode.org - https://hastebin.com
Doragonsureiyā
I have a problem on django rest API when i am trying to login error show
Please, provide a full explanation including all the details that you consider relevant. Your statement is too broad and there is no clear way to answer you. Include details such as libraries, platforms, modules, etc.
SI
from rest_framework import serializers class User(serializers.HyperlinkedModekSsdializer): class Meta: model = User fields = ("url", "username", "email")
Anonymous
Hi developers, i have in elasticseach about 45k records. I have to get top 10 words used in datas ? Anyone any idea how to get it? Thanks
Doragonsureiyā
Anonymous
Please guys,how can I accept Bitcoin deposits in my django app
Anonymous
Why is it that I cant get data from two different model on a single context this as been challenging or is there any way to go about it
Gourav
Foreign key between two database tables
Cesar
Please check this, i would like to use the limit_choices_to in ForeignKey, just im not really sure how it works when using a self.field related verification https://del.dog/cumolepocu.txt
Omair
Why is it that I cant get data from two different model on a single context this as been challenging or is there any way to go about it
You can easily pass the queryset or instances of two different models into the same context
Dextroleav
Hey guys, if i use ngrok for hosting purpose then i need to change urls of my project right?
Astrapel
Hey guys, if i use ngrok for hosting purpose then i need to change urls of my project right?
Yes, and don't use as production solution. Use for testing purpose
Gourav
Foreign key between two database tables
Anonymous
You can easily pass the queryset or instances of two different models into the same context
Please can you show what the code will look like because have try that but i may be doing it the wrong way
Omair
Please can you show what the code will look like because have try that but i may be doing it the wrong way
def view(request): a_set = A.objects.all() b_set = B.objects.all() context = {'a_objects':a_set, 'b_objects' : b_set, } return render(request, 'xyz.html' ,context)
Anonymous
hey guys,i was following a tutorials for django app https://blog.logrocket.com/creating-an-app-with-react-and-django/ n they didnt created it so i need to create it. so, can anyone tell functionality of serializer
Anonymous
means they havent shown serializer but r saying to use it
raven
serializers convert Python object to json or other format
__init__
I gues serializer used to serialize django model to Json format
Anonymous
ohkkk
raven
ohkkk
web browser can't understand python object therefore before sending as response it is converted to json. When you work without rest you send processed html template .
raven
when you do rest you talk in json or xml
Anonymous
so when we use rest we just pass data in json format and other things are managed in frontend only data is sent through backend while witout it we send whole html ..right??
Julio
Hi people, I have a question. How I can pre populate data by a foreign key in Django admin?
Julio
Like if I choose one foreign key other labels can be set with data
Ram
User auth fails when i try to log in in my app It stores the data in db when user registers But when i use same credentials It says pl enter correct username and password
Anonymous
hi {% trans "smth" %} what is the usage for ?
Anonymous
For multilanguaje sites
and it : {% user_display confirmation.email_address.user as user_display %}
Fabian
and it : {% user_display confirmation.email_address.user as user_display %}
It seems that shows an email address belonging to the user but I'm not sure
Finding
anyone making location based app. I have an OGR failure. how can I solve it?🙏🏾🙏🏾🙏🏾🙏🏾🙏🏾
Anonymous
It seems that shows an email address belonging to the user but I'm not sure
what's the defference between transe and blocktrans?