Aaush
class Student(models.Model):
FRESHMAN = 'FR'
SOPHOMORE = 'SO'
JUNIOR = 'JR'
SENIOR = 'SR'
GRADUATE = 'GR'
YEAR_IN_SCHOOL_CHOICES = [
(FRESHMAN, 'Freshman'),
(SOPHOMORE, 'Sophomore'),
(JUNIOR, 'Junior'),
(SENIOR, 'Senior'),
(GRADUATE, 'Graduate'),
]
Arsalan
Doragonsureiyā
anyone? At least hint me out
Maybe anyone is here, yes, but they are not obliged to read everyone's message here neither to reply to everyone's message, if someone wants to reply to your message, they will do that, just don't try to draw attention to your message writing "anyone?" every 5 minutes, that will lead you to be warned for SPAM/Flood, just be patient or use Google/DuckDuckGo to research about your question instead of wasting time here waiting for people to do your work.
Have a nice day 😊
Rajeev
How to perform in django i.e. if objects instances exists then perform_update else perform_create
Dexter
Update_or_create
Arsalan
Maxim
Alex
Arsalan
I wanted to add a locking time and date filed where one cannot access a particular module.for example... I have 2 modules admin and group admin have set a time and date for a poll from 18/2/22 11am to 20/2/22 12pm and didnt want anyone to submit or access the poll after that date or time. Admin can also extend the date and time if wants.
Alex
Hello guys😉
How to create all Django apps insert a folder?(Windows 10)
I wrote this command ("py manage.py startapp users apps/users") but it doesn't work(
Alex
Noor
Alex
Noor
Then you should check that does django installed globally or not
unknown
i am looking for free vedio course of postgrasql for learning. any one has know some course like that?
Fabrício
Hi there. I published a new article on Towards Data Science; it is a Tutorial on Django, from first steps up to some more advanced topics, such as showing Plotly chart in Django web apps.
Any constructive feedback about my text would be much appreciated since I'm kind of new to Django.
I would also like to ask if I could post the article link here. I apologize in advance if it is not allowed, I don't mean to disturb the group normal activity in any way.
Arsalan
....RJ....
Can we retrieve by os module..????
....RJ....
....RJ....
If yes then how
....RJ....
Help me
Dasa
I have 2 DBs. one managed by django(managed=True) and one external DB(managed=False).
I need to lookup for object from both the DBs based on the need. Is there a way to know if django manages a particular self.model?
Anonymous
Hello,
Is there any django way of calculating a filtered queryset integer fields without doing a for loop.
Say i have a field in my model 'post_view' and I'm trying to calculate each 'post_view' in my queryset for analysis stuff..
Anonymous
Peet
Please post what you've done so far and we can help from there. Screenshots
CryptoHunt
Hello guys i have a question
How can i create documentation like swagger, but for django channels(websockets)?
Maxim
neither a project selection group nor a friend finder group - you need @pythonofftopic
Vlad
Hi! I'm use DRF and I try to do POST on my drf form, from JS. I'm use function getCookie as it written in django documentation. And then I pass csrftoken and body, in my "fetch" function with method POST. But it's working on ALL devices, except IPHONE.
WHY???
T4P4N
T4P4N
Alex
Anonymous
is there any fields for telephone number in django
Hamed
Hi how config fluent for get django logs file for use in elasticsearch
Max
Guys, need help. both functions are trying to change the same object. Works only the last one launched. How can i fix it?
@transaction.atomic
Def foo(pk):
Obj=Object.objects.get(pk)
Obj.foo += 1
Obj.save()
@transaction.atomic
Def bar(pk):
Obj=Object.objects.get(pk)
Obj.bar += 1
Obj.save()
ኃይሉ
hey guys have you done face recognition project with its own database recommend me.
ኃይሉ
Maxim
ky
How to delete all objects in project ?
Doragonsureiyā
How to delete all objects in project ?
Step 1: Open a browser
Step 2: Write down https://google.com or https://duck.com and press Enter
Step 3: In the search box, write down the same words you asked here
Step 4: Read the first results
ky
I try but not working
Doragonsureiyā
I try but not working
Read this please:
http://catb.org/~esr/faqs/smart-questions.html#intro
ky
Because in my project some foreign key connected to another table
Alex
ky
Entire
ky
Ok thank you
Hamza
Hello everyone,
I have a question: I want to create two tables in different databases for the login page, the first one will be for all the users of our website and the second table for the other database will be for all the details about the user: is it possible to create two templates and assign each of them to the corresponding database and link them together ?
Doragonsureiyā
cj
https://docs.djangoproject.com/en/4.0/topics/db/multi-db/
that's all you need to know...
now you can be happy
cj
just be sure to read the section:
"Limitations of multiple databases"
and you're all set
cj
https://docs.djangoproject.com/en/4.0/topics/db/multi-db/#cross-database-relations
cj
Hamza
cj
Mysql
with MyISAM or InnoDB? —and why?—
Hamza
with MyISAM or InnoDB? —and why?—
Cuz i have a lot of tables and a lof of user gonna registered in the account like 100000 ppls and a lot of infos invoicing to much things and a need to the request from database not taking more than 100ms that’s why I’m using mysql
cj
other solution is that before saving/updating data in one DB, you manually check there's the integrity needed on the other DB so your project doesn't break
Hamza
cj
cj
Hamza
Hamza
🙏🏻🙏🏻🙏🏻
Брат
Required fields don't show up in swagger
Брат
Serializers.py
class UserSerializer(serializers.ModelSerializer):
password2 = serializers.CharField(style={'input_type': 'password'}, write_only=True)
class Meta:
model = User
fields = ['id', 'first_name', 'last_name', 'username', 'email', 'password', 'password2']
extra_kwargs = {
'password': {
'write_only': True,
'required': True
}
}
Брат
Views.py
http://linkode.org/#LYbGAVVS1Yow0e7IkFi795
Брат
Im using drf-yasg and here is the result:
https://ibb.co/PgXrWmC
Jean-Yves
https://www.toptal.com/developers/hastebin/laqunajexu.rb
Jean-Yves
Please, someone can help me I would like to save A Product in the Model WishList, it didn't work, I don't know if it's the right way
Брат
Брат
You just getting the object, according to your code
Jean-Yves