Enes
isnt wrtr.save exactly what does
Enes
Maybe this is because for working comfortable with models.Manager
Д
because if it tried to save a non-existent field into the DB, surely there would be an exception
Enes
yes that is why I suprised
Д
maybe it doesn't save it because it doesn't have the correct datatype. the normal fields are all some kind of Django-inherited fields. that's just a normal Class str
Д
what happens if you try to add some new IntegerField
Enes
ops underscore underscore
Д
Enes
the object is saving but non exist fields doesnt seems
Д
I think it's normal that you can add things to models
Д
because you have to be able to do things with models
Enes
I have changed --str-- in shell and saved normally but in admin it is still returning old str function value
Enes
or proxy models
Enes
But I was don't know that we can add non-exist fields without specify that this object is Proxy
Д
I'm still not sure when to carry data around in Django Models and when not
Д
because they are Django-specific so it feels 'dirty' to use them
Д
does it make sense to use my DB model elsewhere in my program?
Enes
Enes
You don't need to create 3 different django models called
normal user,
premium user,
vip user with have the same 15 fields.
Instead of creating 3 different models you can create one model and you can inherit from that one and as a field you can put only which field you want to change. As an example premium user have to buy with 25% off. vip 30% off
Enes
so you can use Manager model or proxy for situation
Enes
This will create performance and block huge db in big projects
Д
Enes
Enes
Enes
Enes
Д
I just need the proper APIs
Enes
I have an issue with obtaining auth token in rest
Enes
the front end developer will put interested loops to the template i think they should know at least that much
Enes
Enes
do you have any idea
QAM
Hi, any idea how i can create availability of sercive date in django
Enes
Enes
Enes
or you can add auto_now_add=True into your service dste field in model
Artur
who worked with stripe, tell me what is the name of the event that comes when the payment failed? when the payment has passed checkout.session.completed is called. and when not passed, then what event is called?
Hian
has anyone used select2 by ajax in django admin?
Enes
Enes
you need to take s look the stripe example app from GitHub
rtg
Hi! How can I use that?
rtg
return redirect(url 'scada_app:detail_scada')
rtg
(has error)
Doragonsureiyā
(has error)
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, you have to explain:
- what you're doing
- what you're expecting
- what you're using
- where you're running the script
- what Python version you're using
- what packages and their versions you're using
- and the most important thing: show the code YOU wrote (read rule 5️⃣ for that)
and more details, that way your chances to get help will increase
rtg
When i am in def how can i redirect to an url?
Charly
Ali
Hi,
Is it possible to run a Django project on Oracle's Cloud Free Tier?
Ali
I've seen it's being told as a VPS. Since it's possible to run a Django project on virtual private sevices, I want to make sure if it'll make troubles.
Sarthak
if 'search_query' in request.GET:
search_query = request.GET['search_query']
all_patient_list = Patient.objects.filter
(Q(name__icontains=search_query) |
Q(phone__icontains=search_query) |
Q(email__icontains=search_query) |
Q(age__icontains=search_query) |
Q(gender__icontains=search_query)|
Q(note__icontains=search_query)).order_by('-created_at')
i'm getting this error please give a solution i'm stuck....
Sarthak
Q object has no attribute 'order_by'
Saddam
How to retrive data from two models in one form? Did any now.... For example in model 1) has name, gmail and in model 2) has complete profile details now I want fetch two model details in single html page based on id... it is possible without foreign key?
(⌐■-■)
Make 2 different objects for the models and send data through contexts
Aleksey
Hi, everyone! Can you help me with that question(s). I'm the OP.
https://stackoverflow.com/questions/71611273/django-dockerfile-the-difference-between-linux-run-build-dependencies
Anonymous
How to implement field level permission in Django rest framework?
Mika
Field level such as .add .edit?
Shazeb
https://linkode.org/#vusnoY1v8ANuBHn7exIIB5
Shazeb
can someone help now please?
Sarah
Apart from aws which other platform can I use for database and static files. Which is not expensive
Sayidbek
hello there, i am doing git push heroku master, but it's saying Please make sure you have the correct access rights
and the repository exists.
Sayidbek
Any help is welcome
Happy days
Vikash
@sayibdek this is showing because you try to push In existing repo
Ricardo
When it comes to validating a date type field, is it done from the backend or frontend?
Marline
Hi
Can someone help with how I can delete data from a production database using a migration script in python
Anil
Does anyone preparing for data structures and algorithms in python. I am preparing for Google and Amazon interview and looking for head to head aggressive partner
Please message me if anyone is interested.
Thank you
Packetero
def save(self):
rates = coin_api.rates()["result"]
if(self.currency in rates):
self.fullname = rates[f"{self.currency}"]["name"]
self.rate_btc = float(rates[f"{self.currency}"]["rate_btc"])
self.rate_usd = self.rate_btc / float(rates["USD"]["rate_btc"])
data.add(self)
data.commit()
return True
else:
return False
def delete(self):
data.delete(self)
data.commit()
Hello everyone how can I migrate this from sqlalchemy to Django?
Marline
Sayidbek
🌀
Hey I am facing while executing script in django...can anyone help me please??
🌀
1. I'm trying to calculate amount from rate*qty
2. I'm expecting amount have to be different for different rows and will depend on quantity and rate
3. I'm using django-ide vs code 1.65.2
4. I'm running the script inside the html page
5. Python version 3.7.6