faran
OK, how to populate exact cards?
exact based on what ? you can use get() to populate id created_at and ... in your model
JAIVIGNESH
Form feed means entering a data or displaying a data Please let me know
Anonymous
Dima
board = Board.objects.get(id=board_id) cards = board.card_set.values() Then i get this values <QuerySet [{'id': 1, 'created_at': datetime.datetime(2021, 3, 2, 8, 13, 38, 749198, tzinfo=<UTC>), 'board_id': 1}, {'id': 2, 'created_at': datetime.datetime(2021, 3, 2, 8, 14, 3, 326147, tzinfo=<UTC>), 'board_id': 1}]> But i need all items inheritanced from Card(model) - not the Card
Deleted
https://stackoverflow.com/questions/66436071/raise-ldapinvalidservererror-ldap3-core-exceptions-ldapinvalidservererror
Deleted
please help with this, thanks
faran
https://pastebin.com/NuuL0jWZ I did it I need help
other fields in your models dont relate to the card so you suold make another queryset for them or perhaps set a relation
faran
How i can make it, what is correct way?
read the documentation . do you want the fields to be in seprated models ? is there any reason for it ?
faran
I have many types of cards
its not a good choice to make a seprated model for each of them you should make a main card as you have and then add a type field and set a relation to the type model and make as much types as you want thats the good logic for it . what you have now is not correct. and also the logic of model told clearly in documentation read it.
Neo
hi, which is the better way to use user, roles and permissions for a online web application which has app admin(who adds administrators like user manager, category manager, content managers)
sim
class ContactView(View): def get(self, request, *args, **kwargs): form = ContactForm() return render(request, 'contacts/contact.html')
sim
can anyone explain 2nd line
Sam
guys any recommendations on starting Django?
Doragonsureiyā
guys any recommendations on starting Django?
Looking for Django tutorials? you can follow these three recommended ones: * Official documentation and tutorial * Tutorial from MDN * Tutorial from django-girls
Sam
nice thanks👍
Sam
is the book "Django for beginners" any good ?
Sam
👍
Umar
i am trying to save the form data and logged in users data like gender and user to my model. everything is working fine but only gender is not showing up in admin panel here is what i have done def predict(request): Prediction=polyu=polyd=swl=par_par=polyp=BMI=irrit=alop=v_bull=wkns=Gender = 0 if request.method=='POST': form = PredForm(request.POST) if form.is_valid(): polyu = form.cleaned_data['Polyuria'] polyd = form.cleaned_data['Polydipsia'] swl = form.cleaned_data['Sudden_weight_loss'] par_par = form.cleaned_data['Partial_paresis'] polyp = form.cleaned_data['Polyphagia'] irrit = form.cleaned_data['Irritability'] alop = form.cleaned_data['Alopecia'] v_bull = form.cleaned_data['Visual_blurring'] wkns = form.cleaned_data['Weakness'] instance = form.save(commit=False) instance.patient= request.user instance.gender= request.user.profile.gender Gender= instance.gender print(Gender) Prediction = getPredictions(polyu, polyd, Gender, swl, par_par, polyp, irrit, alop, v_bull,wkns) instance.Prediction = Prediction print(Prediction) instance.save() print(Gender)
Anonymous
how can i solve this error===========> 'DIRS': [os.path.join(BASE_DIR, 'templates')] NameError: name 'os' is not defined
Aryan
Hey! Anybody can tell me how can j add seo to a django webapp??
Vaibhav
Anybody got any idea about this
First of all only take user id from request then search it through default user model manager, then take gender and other parameters from manager instance.
Vaibhav
Please answer this also
https://medium.com/@bedjango/4-seo-tips-to-position-your-website-using-django-96999d373222
Vaibhav
Please answer this also
https://django-seo.readthedocs.io/en/latest/introduction/tutorial.html
Aryan
Thank you for your help ❤
Ivan
Guys, need help, please. I have 4 models: Lesson Image Video File Text Logic: lesson has images, videos, files and texts by M2M fields. How to make custom ordering theses elements (also I should change ordering in future)?
Charanjit Singh
Hi I have developed quiz application and facing issue after launching it..I have used paginator module to display questions one after another.It was working perfectly in development stage but after deploying it to server. only 1st question is being displayed.I have also used random module to randomly select the question
faran
hi first time using jsonfield. and I heard alot about the problems like query and ... . and in my case I can use EAV technology as alternative .any experience in jsonfield or eav ? any advice?
Anonymous
Yeah i just installed Django project It work find when intergrade to django app. It's not support Error display Window error 123 module not found. Guys please help me and rectify that problem
Doragonsureiyā
Yeah i just installed Django project It work find when intergrade to django app. It's not support Error display Window error 123 module not found. Guys please help me and rectify that problem
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
thenils
how to do filtering on search querylist
Doragonsureiyā
how to do filtering on search querylist
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
Doragonsureiyā
how to do filtering on search querylist
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
Vaibhav
I'm new to Django .. Didn't get it
Show me your custom user model..!
Umar
Show me your custom user model..!
I'll inbox you pastebin
Ivan
Which type of ordering are you taking about..?
For example: if I have model Lesson and model Video, I can sort videos by ID. But if I have Image ,Video ,File, Text and I need to sort like Video id=1 Text id=2 Photo id=3 Text id=1
Ivan
So I dont know how to make ordering for all these models [Image, Video, File, Text]
Vaibhav
Use order_by.. Check document for reference.
Ivan
It is not working in this case..
Fabian
RuntimeWarning: DateTimeField User.last_login received a naive datetime (2021-03-02 17:03:39.824728) while time zone support is active. what does this warning means?
Doragonsureiyā
RuntimeWarning: DateTimeField User.last_login received a naive datetime (2021-03-02 17:03:39.824728) while time zone support is active. what does this warning means?
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
Fabian
...
cj
...
are you blocked from using Google? 🤔
Enigma
hey whatsup can anyone help me? i want to add sth in my product models that alows only zip or rar files to get upload... sth like ImageField for images
Anonymous
Hello everyone! I am writing to you about a small problem that I cannot solve. I'm doing microservices (each one has its own database) with django, which works very well. The only downside is that I am trying to add records of one of the services from the admin view (one of the services is the one that contains admin) and I get the error: cannot assign (a foreignkey): the current database router prevents this relation From the specific service shell, when I create the record, it does it perfectly. Could anyone help me? Thanks 😁
Enigma
there's FileField
I know but if i use that field user can upload all type of files i only want to let the user to upload rar or zip formts
Anonymous
hey, how can I try a server error (error 500) in localhost?
cj
for example if you want to save only PDF, you have: file = request.FILES.get("fileName") if file.content_type == "application/pdf": ...
Anonymous
i mean, how can I force that errror
cj
i mean, how can I force that errror
stop the manage.py runserver in a middle of a request
Charly
i mean, how can I force that errror
why would you like to do that?
cj
why would you like to do that?
he doesn't know about unit-testing, so he want to "manually" test it, maybe ¯\_(ツ)_/¯
Anonymous
i want to check if the template for that error is working
Anonymous
youre right, lol
cj
lol, then just try 505 on DEBUG mode
no wait... 🤔 if your server crashes, it wouldn't even be able to display a 505 template
cj
because it's crashed