Anonymous
this seris is best of tutorial for django
Anonymous
hi guys I have a custom usr in model can i use authentication def from django for it or not ?
Welis
Kori
Anonymous
excuse me when we most use initial values in form
and i didn't undersstand why when we have name in model use from slug filed
Héctor
Hello,
I am trying to implement a full text search in django 1.11, in my model product_name and foreign_name can have values in English and Spanish https://pastebin.com/RQS1AHtN, in pastebin I have published my model with a manually created index which works very well with the query, I would like to transpose that query to a queryset using both languages english and spanish, can anybody help me?
Héctor
I used the following manual https://czep.net/17/full-text-search.html but I can not see light
Héctor
I think this may be a solution:
search_spanish = SearchVector('product_name', 'foreign_name', language='spanish')
search_english = SearchVector('product_name', 'foreign_name', language='english')
search = search_spanish + search_english
Héctor
I think the queryset is not using the language, https://pastebin.com/KKMWyy1P :(
Héctor
my error the SearchVector class receives the config parameter and not language, but when adding both classes it generates the following error: TypeError: SearchVector can only be combined with other SearchVectors
Syed Jafer
Hey guys , i am doing web app to perform queries with forms over 7000 data . Like hospital names , and their details . But i am facing problem with loading deatails . It takes a lot of time nearly 6sec for all requests. How to optimize it . The details are static they are not going to change as for now .
Syed Jafer
So please share ur thoughts .
Syed Jafer
Thanks
Mohamed
Mohamed
And if the details are statics consider using PWA
Héctor
Justin
I am making a blog using django . I dont want the blog article to be deleted if the user gets deleted. How should I define the foreign key for the article model if I am using the default user model?
Master
@justinjohnymathew https://docs.djangoproject.com/en/2.2/ref/models/fields/#django.db.models.ForeignKey.on_delete
Master
on_delete.SET_NULL
Justin
Syed Jafer
Syed Jafer
Is it possible to use the db to csv and work with js . Will it be possible ?
Syed Jafer
Without backend . Only jquery and js
cj
Gigil
Hey guys, do anyone know how to get the size of file uploaded to s3 bucket from django
Eric
7000 records isn't very big. You could get away with loading all of it. Keep a JSON file in your assets, and your JavaScript or jQuery will access that. As long as it's cached by the clients browser it'll be fast on subsequent use of the page.
Sirius
Hello everyone!
Could anyone help me please. I need to make a field like this:
Class Person(models. Model) :
select = (
('A', ('name_of_category ', ('1', '2', '3'...), 'name_of_category-2', (('1', '2'), ('3', '4')...)...),
('B', (('name_of_category ', ('1', '2', '3'...), 'name_of_category-2', (('1', '2'), ('3', '4')...)...))
)
menu = models.CharField (max_length=100, choices = select)
But I couldn't make it by M2MField.
Is it possible to make a field like this, without using M2MField? Or is there any example for this type of fields?
Maxim Cheremisov
Hello, guys!
Maxim Cheremisov
How can i make my code colored in PyCharm?
Maxim Cheremisov
Because my code strings are white and grey
abhijith
Anyone... Please help....
How to get values from a multiple choice fields in html
Anonymous
Prince
Can anyone tell what is error in this line x=len(set(list1))
Anonymous
Anonymous
Printed out?
Prince
Its showing invalid syntax
Anonymous
Show list1
Prince
Its simple list of integers
Anonymous
Prince
Ya
Anonymous
Can you share your code on pastebin
Prince
Okay
Prince
https://pastebin.com/mrQLGtVL
Prince
Here is the code
Anonymous
Line 3 is where the problem starts
Anonymous
And ... Paste your code well .. don't add those line numbers
Prince
inchidi
Syed Jafer
I wanted in the same page
Syed Jafer
Like table with scroll
inchidi
JeeSuuSiiTooH! <3
Hi all! I'm using cryptography for crypt and decrypt password. I save the AES256 key in a file, and I would like to save this value in a variable accesible anywhere in the project. Any suggest?
Syed Jafer
JeeSuuSiiTooH! <3
https://django-environ.readthedocs.io/en/latest/ this module?
inchidi
Like table with scroll
means all data will be loaded on page load? then of course the page will take longer time to load. maybe implement infinite scroll on your frontend
inchidi
JeeSuuSiiTooH! <3
I need to decrypt it
JeeSuuSiiTooH! <3
and I'm usin' djongo
JeeSuuSiiTooH! <3
Yep
JeeSuuSiiTooH! <3
I'm using InstagramApi and I need the original password back
Syed Jafer
JeeSuuSiiTooH! <3
Can I write bytes with this?
JeeSuuSiiTooH! <3
I'm using https://django-environ.readthedocs.io/en/latest/#supported-types but it doesnt
Syed Jafer
Syed Jafer
Why bytes ?
JeeSuuSiiTooH! <3
Why bytes ?
'Cause this is how Fernet gives me a key
sravan
Is there any way to extract text from PDF?
Syed Jafer
Syed Jafer
Python wrapper also available
m
Hello everyone , I am building and application using DRF, I am using view sets to make the data avalible to the frontend, which is working fine. when i tried to make a delete request to the same view I got 403 error on the other hand if i make the delte request via the browsable API it gets executed !
m
does the browsable API has different rules or something ?
m
class batchViewSet(viewsets.ModelViewSet):
queryset=batch.objects.all()
serializer_class=batchSerliz
permission_classes = (permissions.IsAuthenticated,)
m
this is my viewset
m
Forbidden: /api/batchVS/test test two/
[06/Jul/2019 13:07:44] "DELETE /api/batchVS/test%20test%20two/ HTTP/1.1" 403 58
m
and this is what i get when i send the request from front-end
Syed Jafer
Its csrf error .
Syed Jafer
Think so