cj
also you have to overwrite the save() method in your Event model, to fill up the slug field, otherwise it will be empty
and be sure the slugs are unique, otherwise you'll have an exception when trying to .get one object using the slug
Alex
also you have to overwrite the save() method in your Event model, to fill up the slug field, otherwise it will be empty
I thought that recommended way for that is to use Model.clean. So that way you separate validation logic and saving of an object.
da_saint
pls I am having issues with my python manage.py migrate...after creating my data base on my visual code and in my local host, it's giving me errors
da_saint
just at the point of migrating my database in order to create the tables ....
Ramziddin
Is there a way of knowing what date a field of a model has been updated?
cj
Is there a way of knowing what date a field of a model has been updated?
if you're not explicitly saving it in your model somewhere, then no
Alex
Is there a way of knowing what date a field of a model has been updated?
So you have to add a field, say, updated_at or created_at and use smt like auto_now
Ramziddin
So you have to add a field, say, updated_at or created_at and use smt like auto_now
Yup, added updated_at = models.DateTimeField(auto_now=True) and tried to update a model via Admin page, but the field wasn't updated
Alex
Yup, added updated_at = models.DateTimeField(auto_now=True) and tried to update a model via Admin page, but the field wasn't updated
It had to. Maybe you've overriden the model's save or there is a overriden form or maybe something in your modeladmin.
Ramziddin
Yeah, it worked!
Ramziddin
Thanks!
Ramziddin
Had to restart server
Mirco
Is there a way of knowing what date a field of a model has been updated?
As it's a very common thing, there a cool Django package called django-extensions where you can find a TimeStamped model
Daniel
Hi everybody, somebody tried to use a <table> insde the Form? i created a form that need to have a <table> inside and i don't know how to save the information of the <table> when i am working on the mothod=="POST":. Any idea or help i will appreciate
Daniel
https://i.imgur.com/LpJK7lL.png
Anonymous
Please how can I include referral links in my django app
MP
Any one can suggest admin template for django
MP
Is there any PDF viewer/document viewer in django (not required browser dependency)
Muflone
Lone
how can i allow an anonymous user to add to cart using django and still match him with his cart when he creates an account or logsin?
PV
Remove decorator in retrieve view
Sagar
Hey any one done any social media project in django
PV
Show public or on only in his timeline
PV
Get the model instance in gallery and pass into the context
PV
Like on gallery views from profile import Profile def gallery(request): instance = Profile.object.all() context = { instance = instance, } return render(request, 'gallery.html' , context)
PV
Then in template {% for i in instance %} {{i.photo}} {% endfor %}
Himanshu
i have integrated payumoney in my project. and when i get the post request from the payment gateway its comming from the anonymous user, how can i get that request to the authenticated user who send the payment request.?
Himanshu
can anyone help me?
Himanshu
Logout and login again
i want to redirect it to the users dashboard
ggr
Anyone have the experience of build API using django rest framework I need help.
Doragonsureiyā
Anyone have the experience of build API using django rest framework I need help.
Please don't ask meta questions like: "Any user of $x here?" "Anyone used technology $y?" "Hello I need help on $z" Just ask about your problem directly! With 52k+ people the probability that someone will help is pretty high. Also please read: http://catb.org/~esr/faqs/smart-questions.html
Luan
Hello, I need to make a query that is corrected when changing the page or updating the page does anyone have any tips?
cj
Hello, I need to make a query that is corrected when changing the page or updating the page does anyone have any tips?
there are examples about pagination in the official documentation, didn't you read that?
SS
Hlo guys Which forms should we use in erp system, Django inbuilt, html or crispy any other forms?
SS
Clear with reasons
Alex
Hlo guys Which forms should we use in erp system, Django inbuilt, html or crispy any other forms?
From your question I see that you REALLY dont understand how they all work.
ThePresence
Any guide on implementing jwt in django+angular
Himanshu
can anybody help me.
Alex
May be I'm new learner
Django's built-in form part is just a python wrapper around html forms. And cryspy is a wrapper around django's forms with support of bootsrap css-framework.
Himanshu
how to convert anonymous request to the authenticated request.user
Winter
😂 ok if i have a backend service that downloads videos and i want it to download it directly on the users machine rather than on the server its self help
Alex
By security
!explain
Doragonsureiyā
By security
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.
Alex
how to convert anonymous request to the authenticated request.user
Have you tried to authenticate it? https://docs.djangoproject.com/en/3.0/topics/auth/default/
Himanshu
actually i am doing payment integration.. and on successful/failure payment the api send back me a post request but its coming from anonymous user ao i am not able to clear the cart after the successful payment
SS
Dear , I want to ask you that which form technical is better in any online system is better like banking sys, Should I make simple html form or use Django form or class based forms which provide high security in any erp system,
Himanshu
actually i am doing payment integration.. and on successful/failure payment the api send back me a post request but its coming from anonymous user ao i am not able to clear the cart after the successful payment
i redirect the request to home page but its showing me register and login option again in my navbar. i have changed that with username and logout .
Himanshu
for authenticated user.
PV
i want to redirect it to the users dashboard
Use jQuery and ajax and integrate it with django
Himanshu
how can do that?? can u elaborate?
PV
Pass redirect url in context , return json response as sweatalert in views, get this url in ajax function and reload the page using jQuery calling inside ajax, this is the perfect and user-friendly way
PV
Another way is using django httpresponseredirect
Luan
there are examples about pagination in the official documentation, didn't you read that?
It is not about pagination that I want. I'm using google translator. 😁
Luan
I need to make a select field so that the option I choose remains fixed even when changing the page or updating the page. So everything on the page will be filtered by the selected option. Does anyone have any tips on how to do?
pranit
Get error when connecting Mongo bd to djanjo (try using django. Bd. Backeds. Xxx, where Xxx is one of the 'mysql, oracle, postgressql, sqllite'
pranit
Can any pls help me
pranit
I want to retrieve data from mongo db
Alex
I want to retrieve data from mongo db
Let's start from scratch - provide the full traceback
pranit
Not getting
Alex
Not getting
Give us the full error message.
pranit
Ok
pranit
Got it
pranit
Actually I created one Employee module