Alex
minute
sufiyan
Sure brother and thank you for giving me you're valuable time!!
sufiyan
I have checked the admin my owner is listed to all the projects also
Alex
ок
sufiyan
what should i do?
Alex
<p> <a class="project__author" href="{% url 'user-profile' pk=project.owner %}">By {{project.owner.name}}</a> </p>
Alex
or <form action="{% url 'user-profile' pk=project.owner %}" method="POST"> {% csrf_token %} <button style="--clr:#4cd80f" type="submit">By {{project.owner.name}}</button> </form>
sufiyan
i need to pass the owner id
sufiyan
so it can redirect to the profile/<str:pk>
Alex
This is clear Now I'll show you how I did it
sufiyan
if you need anything i can share
sufiyan
I tried this but it's still not redirecting me to profile/id
Alex
https://linkode.org/#dXDTJPN3ScyYiWTHXVQ6T1
Alex
maybe <int:pk> ?
sufiyan
maybe <int:pk> ?
I already tried
sufiyan
I'm not able to fully understand you're code
sufiyan
Any suggestion what should i do, because i'm not able to understand why I'm getting this error
sufiyan
For an example if remover href and fetch the id like this my pagge get render and id is showing<p> <a class="project__author" >By {{project.owner.id}}</a> </p>
Rajat
Any suggestion what should i do, because i'm not able to understand why I'm getting this error
Write your url manually your url is in another app so django can't identify it
sufiyan
But I have already included both app urls in admin url
sufiyan
it's not getting fixed
sufiyan
Apart from this everything is working fine
Rajat
Thank you
/profile/project.owner.id
Alda
Use the app name, { url 'app_name:url' project.owner_id} defined your urls file.
Alexey
Hello, I have project with postgresql, how can I use another schema not default - public?
The Inspired
Hello, I have project with postgresql, how can I use another schema not default - public?
you will have to first create a new schema inside the pgshell or in pgadmin... then connect to that schema... and finally link your Django Project to that schema.
Alexey
you will have to first create a new schema inside the pgshell or in pgadmin... then connect to that schema... and finally link your Django Project to that schema.
Thanks for help, but how can I link that schema? I solve that problem with append in DATABASES "OPTIONS":{"options":"-c search-path=myscheme"}
The Inspired
Thanks for help, but how can I link that schema? I solve that problem with append in DATABASES "OPTIONS":{"options":"-c search-path=myscheme"}
in your django project settings, in the 'DATABASES' options, give the value of the 'name' attribute as your new schema name.
Alexey
in your django project settings, in the 'DATABASES' options, give the value of the 'name' attribute as your new schema name.
In "NAME" we give value "dbname" and in "name" we give "schema_name"?
The Inspired
no... if you are using postgresql, there is a 'NAME' option inside the 'DATABASES' dictionary. Check the documentation for details
Alexey
Ok, thx
EdisonMolina
can i implement push notifications from django to android?
EdisonMolina
Yes
how is the method?
Charly
how is the method?
What you have found on google fisrt?
EdisonMolina
functionality with firebase
Charly
functionality with firebase
Yeah thats an option
Sunil
What will be the good resources to follow for learning Django channels
iplogger
why there are so many questions about the basics of Django and in most cases even about its documentation. wouldn't it be easier to look at django topics before asking a question?
Nav
Can anyone explain to me how to use the update function in django
Shilpa
Django
Doragonsureiyā
Hello
Hey! I try to show a list of products (this object ). The second object is hold email and the product object as manytomany field . How to work with this field when it’s manytomany define in models ??
Aakash
Can anyone please help me. How can I solve these As a user - I can signup either as Librarian and Member using username password - I can login username/password and get jwt access token As a Librarian - I can add, update, and remove books from the system - I can add update, view and remove member from system As a Member - I can view, borrow and return available books - Once a book is borrowed, its status will change to Borrowed - Once a book is returned, its status will change to Available - I can delete my account. All I want is how can I create a models.py for these scenario. Rest of the part I can manage. Please help guys
Alex
Hi! Got a question: is it necessary for me as a backend dev learning django to know jinja, or it's frontend part?
Alex
Thank you)
Charly
Hi! Got a question: is it necessary for me as a backend dev learning django to know jinja, or it's frontend part?
Ninja is not used in Django, it has its own templating system, and if you are going to use django templates for the frontend then learn it
Alex
Ugh, okay, got it, thanks!
Hello
How to use queryset when you send it to HTML? (the template )
Charly
How to use queryset when you send it to HTML? (the template )
using render() did you skipped the django official tutorial?
Hello
It doesn't work
Alex
I haven't really learnt django yet, but if there's anything I know about programming is that official snippets must work :)
Hello
I try to get a list of products that are on the same row with a specific user email. So I did try and except if I got a DoesNotExist error. And it's all the time go to the error
$_u_d_d_y
How to use queryset when you send it to HTML? (the template )
depends on the view type.... CBV use the function get_queryset..... while in FBV you have to pass it to context as a dictionary
Charly
I try to get a list of products that are on the same row with a specific user email. So I did try and except if I got a DoesNotExist error. And it's all the time go to the error
So your issue is not about passing a list of objects to the template, you don't know how to get the list of objects in the first place?
$_u_d_d_y
it does not generate an error .... it just returns an empty list
Hello
Can I send here the code? Legally?
Charly
Can I send here the code? Legally?
Just read the rules to send it properly
Hello
this is my func in the views .
Hello
Ive object on models that call FavoriteList
Hello
and also a object that call Product . I connect them by the ManytoMany field
Hello
someone understand why the func 'productlist' not working?
Hello
it always enter to the excpet block , also if the object exsit
Hello
so I dont know how to solve it...
Ali
so I dont know how to solve it...
If you give me a picture from your view I can help you Also from your models
Hello
this is the model - https://dpaste.org/KtqEf
Hello
https://dpaste.org/qWAEE this is part of the views
Ali
https://dpaste.org/qWAEE this is part of the views
firatble what is "em"???? and when you use the many to many relationship you must use all() like [user.favorite_product.all()]
Hello
em is a global var that is the input from the user . I keep this from the second func ‘ask_productlist’