Firdavs
after pouring my project into pythonanywhere Wrong file identifier / http url specified error
Alex
Hello, is there way to pass formset to form as field?
Like serializers in DRF? No. The idea behind formsets is that you have a form, representing some object, and you want to give a user the way to create a set of those objects by a single request.
Anonymous
Hey guys. I have a questions about the JSONCatalog view. Does it require .po file with a domain of djangojs ?
Anonymous
Hello guys, how can I save a pandas dataframe to a django model
Anonymous
do i have to run django-admin makemessages -d djangojs -l ar ?
Alex
Hello, is there way to pass formset to form as field?
There is a way to generate formset with related/main form. Like you have an order and you can edit products/items in that order. So there is a formset of products that is related to the main form.
Alex
Like serializers in DRF? No. The idea behind formsets is that you have a form, representing some object, and you want to give a user the way to create a set of those objects by a single request.
Please note that it is not django forms flow or smth. It's how html-forms work. They are not intended to be 100 times deep nested.
Anonymous
Room.objects.get(user_eligible__contains=[user1,user2]) HOW TO GET THE TH QUERY THAT EXCACT MATCH TH M2M user_eligible FILED IN QUERY FROM THAT USERS LIST
Tim
Hi In Token authentication Can i get user Like that ? user = self.request.user
игорь/igor
Hi In Token authentication Can i get user Like that ? user = self.request.user
https://www.django-rest-framework.org/api-guide/authentication/#tokenauthentication
Jitendra Kumar
Work start time and work end time how to write in models.py ?
Jitendra Kumar
24 hours format
Alex
Work start time and work end time how to write in models.py ?
add them as DateTimeField to you model and create migrations.
Alex
24 hours format
Ah, so you need per day schedule?
Jitendra Kumar
Yes
Anonymous
does anyone know how to create a djangojs.po file ?
Anonymous
'Create_listing' object is not callable' Hello can any one help me understand why this error is raised?
Anonymous
"makemessages -d djangojs -l ar" doesn't seem to work for me
Sherry
How to sent images in testcase
игорь/igor
Yes
use time field
kuzmich
How to sent images in testcase
from io import BytesIO from PIL import Image def get_image(name='test.png', ext='png', size=(1, 1), color=(0, 0, 0)): file_obj = BytesIO() image = Image.new("RGBA", size=size, color=color) image.save(file_obj, ext) file_obj.seek(0) return SimpleUploadedFile(name, file_obj.getvalue(), content_type="image/png")
Anonymous
what is create_listing exactly
def create_listing(request): form = forms.Create_listing() if request.method == "POST": form = form(request.POST,request.FILES) if form.is_valid(): listing = Auction_listings.objects.add(form) listing.save() return render (request,"auctions/newListing.html", { "form": form })
Anonymous
what is create_listing exactly
That's is a function supposed to process a form that contain string, number, and image data
Alex
Yes
If you're using postgres, you can try range fields https://docs.djangoproject.com/en/3.2/ref/contrib/postgres/fields/#range-fields in particular DateTimeRangeField
Jitendra Kumar
I am using mysql
игорь/igor
I am using mysql
don't use MySql😅, jk
Alex
I am using mysql
Then as mentioned previous guy - use TimeField https://docs.djangoproject.com/en/3.2/ref/models/fields/#timefield
kuzmich
Thanks bro let me try
pillow library is required
Sherry
kuzmich
Sherry
игорь/igor
and where is that particularly please/
sorry, I might have mislead you. The best practice is to add "Form" at the end of form class name - that would be 'CreateListingForm' in your case. your error is that you assign Create_listing instance to a form var and then call it. Just do as everybody does form = forms.Create_listing(request.POST, blah blah)
игорь/igor
Anonymous
Anyone have vmware?
Doragonsureiyā
Anyone have vmware?
Don't ask meta questions like: "Any user of $x here?" "Anyone used technology $y?" "Hello, I need help on $z!" Just ask directly! The better you are at explaining the problem, the more likely you are to get help. Asking smart questions
عبدالقادر
i need ur help
Anonymous
عبدالقادر
What?
tnx , i've solved it
ꪉꫝꪖꪹᦋꪖꪜ
I wanna show the profile if user is logged in, how can i do that?
Alex
I wanna show the profile if user is logged in, how can i do that?
you can handle it in the template. https://docs.djangoproject.com/en/3.2/topics/auth/default/#authentication-in-web-requests
عبدالقادر
K
what?
Maxim
what?
it was ok i guess
عبدالقادر
i got u
Anonymous
Dev
Use remote storage, Heroku is not for user uploaded content.
How to use remote storage any tutorial brother
Hilariyus
How to use remote storage any tutorial brother
For that you need to create an api then render the datas from that then use it
Hilariyus
You can also. Perform CRUD operations
Dev
Ok brother Thanks 😊
Hilariyus
игорь/igor
игорь/igor
How to use remote storage any tutorial brother
https://www.youtube.com/watch?v=ahBG_iLbJPM for instance
Hilariyus
Yes
Dm me
игорь/igor
I wanna show the profile if user is logged in, how can i do that?
Why are you so lazy people? Just google it. https://www.ordinarycoders.com/django-custom-user-profile#Creating%20a%20user%20page
fateme
is anybody who has exprience with django-environ to config the postgres database ?
Meraj
does anyone have pdf of A Wedge of Django
Doragonsureiyā
does anyone have pdf of A Wedge of Django
Read the rules before any activity: @PythonRules
👤👤👤
Hello when is the expiration time of the authentication token in the rest api ?
Anonymous
have you wrapped the massages in gettext?
don't worry about it. i think i didn't understand the topic translation.
Anonymous
i was doing so many things wrong.
Anonymous
but now it works!! and i feel great.
Anonymous
sorry, I might have mislead you. The best practice is to add "Form" at the end of form class name - that would be 'CreateListingForm' in your case. your error is that you assign Create_listing instance to a form var and then call it. Just do as everybody does form = forms.Create_listing(request.POST, blah blah)
def create_listing(request): form = forms.Create_listing(request.POST,request.FILES) if request.method == "POST": form = form if form.is_valid(): form.save() #listing = Auction_listings.objects(form) #listing.save() return render (request,"auctions/newListing.html", { "form": form }) All I needed was to comment onto some line and introduce form.save(). Thank you very much for your concern.