Anonymous
Михаил
Can someone help?
Hi, you will more likely find the answer in javascript related channels
Anonymous
How can I accept raw html form then save it to the backend
Михаил
https://developer.mozilla.org/en-US/docs/Learn/Server-side/Django/Forms
Anonymous
How can i include tinymce text editor in my django app, i have set it to admin site it worked, but not in app.
Tried this in forms.py
from django import forms
from .models import Post
from django.db import models
from tinymce.widgets import TinyMCE
class AddPostForm(forms.ModelForm):
class Meta:
model = Post
fields = ['author', 'title', 'created_date', 'published_date', 'content']
formfield_overrides = {
models.TextField: {'widget': TinyMCE()},
}
Luis
Luis
https://django-tinymce.readthedocs.io/en/latest/usage.html#using-the-widget
Anonymous
What is better modelform or standard Django form?
Mirco
Anonymous
After creating a form my title field does not appear but the description field does.. what I mean is the
Description : the box for description
But in case of title there is just the box with a placeholder . So how can I fix that and bring back the title field?
Михаил
Ильяс
How do i make a connection to a search field in html code?
Ильяс
Yes, i have a dropdown field in template and i need it to give me choices from my db
cj
Ильяс
No it should just dropdown list that i have in my db
cj
damn... my "reading mind" skills are not good enough ☹️
Ильяс
and from that i should choose
Ильяс
Ильяс
)))
Ильяс
It is a site for car sale
Ильяс
where you choose brand and a model
Ильяс
yes yes yes
Ильяс
)))
cj
Ильяс
Yeah you are surely are getting lvlup)))
cj
one option is to use an endpoint to list brands and models (one endpoit for each model), use javascript to read data from that endpoint and fill the dropdowns with the corresponding options 🙂
Ильяс
i dont know js
Ильяс
i am a python intern)))
cj
another option:
use ModelForms and re-render the template each time the dropdown changes its value (each time the user choose another brand)
Ильяс
i am using ModelChoiceField
Ильяс
but the problem is that i dont know how to connect that dropdown bar to my code
cj
i am using ModelChoiceField
well... you have to re-render the template each time the user changes the brand, so you can fill the model's dropdown the next time you render the template
Ильяс
Can you give me an example&
Ильяс
?
cj
if you want my opinion, I'd rather go for the javascript approach
Ильяс
Can you give me a link to tutorial of that or an example
Ильяс
&
Ильяс
?
cj
Ильяс
mmmm
Ильяс
are there any libs for that?
Anonymous
hello, friend, can django model filtered by foreignkey ?
Ильяс
cj
Ильяс
I was given a ready js css and html, i made models from bd and now i need to connect them i wrote all urls and else but i dont know how to connect it in html
Ильяс
Ильяс
No API
cj
cj
here you have it, simple ASF
Ильяс
cj
Thank you
https://i.c0x6a.dev/56a074f7-ca45-4dd6-89e1-b9a591c53930.mp4
and here you can see it working
n
Can anybody know how to make bot or how to add bot in our webpage
Михаил
Blaze
inchidi
#article
Do you already know what DEP is? Meet DEP, its like PEP but for Django
https://github.com/django/deps/blob/master/final/0001-dep-process.rst#what-is-a-dep
inchidi
#article
Django dynamic model field
https://stackoverflow.com/a/7934577
inchidi
#article
Profiling Django
https://code.djangoproject.com/wiki/ProfilingDjango
inchidi
#article
Full-Text Search in Django with PostgreSQL
https://www.paulox.net/2017/12/22/full-text-search-in-django-with-postgresql/
inchidi
#article
Django Projects Optimizations Guide
https://dizballanze.com/django-project-optimization-part-1/
https://docs.djangoproject.com/en/2.2/topics/performance/
Ильяс
TypeError: __init__() missing 1 required positional argument: 'queryset'
Ильяс
marka_form = MarkaSearchForm(help_text='Marka', data=request.GET or None)
Ильяс
cant understand why i should type in queryset
Ильяс
?
inchidi
Ильяс
Internal Server Error: /
Traceback (most recent call last):
File "/home/ilyas/Documents/Digital_Oracle/autos/shipping/venv/lib/python3.6/site-packages/django/core/handlers/exception.py", line 34, in inner
response = get_response(request)
File "/home/ilyas/Documents/Digital_Oracle/autos/shipping/venv/lib/python3.6/site-packages/django/core/handlers/base.py", line 115, in _get_response
response = self.process_exception_by_middleware(e, request)
File "/home/ilyas/Documents/Digital_Oracle/autos/shipping/venv/lib/python3.6/site-packages/django/core/handlers/base.py", line 113, in _get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/home/ilyas/Documents/Digital_Oracle/autos/shipping/venv/lib/python3.6/site-packages/django/views/generic/base.py", line 71, in view
return self.dispatch(request, *args, **kwargs)
File "/home/ilyas/Documents/Digital_Oracle/autos/shipping/venv/lib/python3.6/site-packages/django/views/generic/base.py", line 97, in dispatch
return handler(request, *args, **kwargs)
File "/home/ilyas/Documents/Digital_Oracle/autos/shipping/w8shipping/views.py", line 15, in get
marka_form = MarkaSearchForm(help_text='Marka', data=request.GET or None)
TypeError: __init__() missing 1 required positional argument: 'queryset'
[06/Jun/2019 06:18:41] "GET / HTTP/1.1" 500 78571
inchidi
Internal Server Error: /
Traceback (most recent call last):
File "/home/ilyas/Documents/Digital_Oracle/autos/shipping/venv/lib/python3.6/site-packages/django/core/handlers/exception.py", line 34, in inner
response = get_response(request)
File "/home/ilyas/Documents/Digital_Oracle/autos/shipping/venv/lib/python3.6/site-packages/django/core/handlers/base.py", line 115, in _get_response
response = self.process_exception_by_middleware(e, request)
File "/home/ilyas/Documents/Digital_Oracle/autos/shipping/venv/lib/python3.6/site-packages/django/core/handlers/base.py", line 113, in _get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/home/ilyas/Documents/Digital_Oracle/autos/shipping/venv/lib/python3.6/site-packages/django/views/generic/base.py", line 71, in view
return self.dispatch(request, *args, **kwargs)
File "/home/ilyas/Documents/Digital_Oracle/autos/shipping/venv/lib/python3.6/site-packages/django/views/generic/base.py", line 97, in dispatch
return handler(request, *args, **kwargs)
File "/home/ilyas/Documents/Digital_Oracle/autos/shipping/w8shipping/views.py", line 15, in get
marka_form = MarkaSearchForm(help_text='Marka', data=request.GET or None)
TypeError: __init__() missing 1 required positional argument: 'queryset'
[06/Jun/2019 06:18:41] "GET / HTTP/1.1" 500 78571
share your MarkaSearchForm on dpaste.de please
Ильяс
Ильяс
Ильяс
thanks
Ильяс
Could you tell how should i request my db so i can choose in a dropdown search field choices from db