Maxim Cheremisov
How can i change a size of the textField which i created with the help of forms.Modelform?
Jemal
hello !! how can i create carousel (like slider boxes) using django...i am kind new to django..thanks in advance
Jemal
is it just frontend thing?
yes only front end thing
Anonymous
Hey guys I'm a Student. I'm starting to work on a car rental system project
Anonymous
Any suggestions
Anonymous
?
Anonymous
What is better
Anonymous
Visual studio
Anonymous
Or sublime text
Anonymous
?
arrebcer
vstudio
Anonymous
Okay
Anonymous
Thanks
Anonymous
😃👍
El
Has many plugins
Welis
PyCharm is better )
Anonymous
emacs elpy is the best😄
Anonymous
PyCharm or VS Code
Alexander
PyCharm Pro EAP is free or try to get educational license
Anonymous
PyCharm is better )
Community version is free too
Shreehari
I want to create registration page after registration user redirect to login.how can I do this with Django without using default user
https://docs.djangoproject.com/en/2.2/topics/http/shortcuts/#redirect this might help you
Welis
Community version is free too
yeah, and for students commercial version is free
Orack
i have a collection of pdfs
Orack
is there any good opensource django ebook server to host them on a raspberry pi
Murshid
my product details in one model and stock details in other model how i display using detail generic view
Orack
i want good UI
Orack
like plex media server for books
fcs
whats the advantages and disadvantages of flask and django
fcs
which one is better
Mirco
whats the advantages and disadvantages of flask and django
There's a good video on YT that explains it very well 😁
Mirco
which one is better
https://youtu.be/UY2JMZjQspY From djangocon
Игнат
Good afternoon, I can not figure out how to make a CRUD, for the form in which 3 related models are at once, please help with this problem
Игнат
https://gist.github.com/695938db0655328e2467387a969d6ef1
Mirco
https://gist.github.com/695938db0655328e2467387a969d6ef1
try to explain as better as you can what you wanna do or your issues to avoid xy problem
Master
1. Use formView or genetic.edit.views like Create/UpdateView 2. Use ModelForm
Игнат
I have a table in which information is stored per person, you need to add a form where information about the place of work is added, the place of work is a separate table that refers to the places of work, and the places of work are simply places (address, longitude, latitude) Google translate
Master
3. Don't invent the wheel
Игнат
How to create a form of several ?
Master
formsets
Master
https://docs.djangoproject.com/en/2.2/topics/forms/formsets/
Игнат
How to organize CRUD ?
Master
https://docs.djangoproject.com/en/2.2/topics/forms/modelforms/
Master
https://docs.djangoproject.com/en/2.2/ref/class-based-views/generic-editing/
Maxim Cheremisov
Guys, how can i create basic message error or success in my view? Is this way proper? messages.add_message(request, settings.ERROR, '...') Then I'm trying to show it in my template, but it's doesn't work... {% for mess in messages %} <p style="color: red">{{ mess }}</p> {% endfor %}
Maxim Cheremisov
Where might be the problem?
Maxim Cheremisov
try: messages.error(...) messages.succcess(...) and in the template you can use {{ message.tags }} to see what kind of message it is and use a corresponding CSS class
i use this in views: if form.is_valid(): messages.success(request, 'Profile details updated.') And this in template: {% if messages %} <ul class="messages"> {% for message in messages %} <li {% if message.tags %} class="{{ message.tags }}"{% endif %}>{{ message }}</li> {% endfor %} </ul> {% endif %} And it's doen't work 🤯
cj
i use this in views: if form.is_valid(): messages.success(request, 'Profile details updated.') And this in template: {% if messages %} <ul class="messages"> {% for message in messages %} <li {% if message.tags %} class="{{ message.tags }}"{% endif %}>{{ message }}</li> {% endfor %} </ul> {% endif %} And it's doen't work 🤯
I have this working, this is an actual copy/paste from one of the projects running right now: in views.py: messages.success( request, f"User {user.username} modified successfully" ) and in the template: {% if messages %} <div class="row"> <div class="content-message no-print"> {% for message in messages %} <div class="alert {% if message.tags %}alert-{{ message.tags }}{% endif %}"> <span class="body-message">{{ message|safe }}</span> </div> {% endfor %} </div> </div> {% endif %}
Maxim Cheremisov
One more question... If i have several messages in my views, how templates can understand, which message level it need to use? So, in different templates we have {% for message in messages %} but we have a lot of those different messages. How our template know, which it need to use in this one?
Javi
I just learnt about the f-strings and I'm <3
Maxim Cheremisov
cj
also, messages are used once by each call to a view, so they won't appear in the next call to, rather to the same view or another one
cj
ow, so it nacessary if I use more than one message?
it depends on you, I show all the messages generated in the views, that's where you have to control what messages to show/generate
أمجد☄
hello !! how can i create carousel (like slider boxes) using django...i am kind new to django..thanks in advance
That's a frontend thing i believe so just try bootstrap4 for that, until and unless you are trying to make a form to submit pictures into the carousel you will need django in that case.
أمجد☄
ow, so it nacessary if I use more than one message?
Well you have to do the forloop, but if you ask why i think its because that it's a list since its (message[s]) and you cant just print the whole list you will have to loop at each object in that list so that it'll appear as a single message each, if you didnt it'll appear as a list not as an object.
Anonymous
Procedure to get pycharm professional version
Anonymous
Is it free for students?
Pranay
You would need @edu email
Anonymous
Okay
Anonymous
My College email id will work?
cj
Is it free for students?
yes if you can prove you're student (using your @edu mail)
cj
Okay
you only can use it to do homeworks, if they catch you using it for work, you can go to jail 10 years /s
Anonymous
Okay
Anonymous
Thanks
أمجد☄