Roman
How to get data from ajax?
Mirco
Doragonsureiyā
How to get data from ajax?
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
Roman
Thanks you..
Morteza
منتظر
from mptt.models import MPTTModel, TreeForeignKey
class Category(MPTTModel):
name = models.CharField(max_length=255, db_index=True)
parent = TreeForeignKey('self', on_delete=models.CASCADE, null=True, blank=True, related_name='children')
slug = models.SlugField(max_length =255, unique=True)
how can I make multi level dropdown menu
for the category model
𝕯aniel
𝕯aniel
Do migrate and create categories in admin panel
𝕯aniel
منتظر
yeah
𝕯aniel
{%recursetree var %}
{{node.name}}
{{children}}
{% endrecursetree %}
𝕯aniel
منتظر
ohhh than you very much
𝕯aniel
My pleasure
Garry
anyone having to update user profile ?
Garry
https://youtu.be/7DU-uhhYI6Y i tried this ..but shows error “ LookupError: No installed app with label 'admin'. “
𝕯aniel
Did u install correct ur app in settings.py?
Garry
yes
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'faculty',
'student',
'questions',
]
Garry
i have already implemented login signup module in my project … now i have to update user profile ..how can i do it ..if anybody having code and logic of it please share
William
Garry
ok..i will try it ..ty 🤝
Артем
Hello everyone, who can help with forms?
Артем
I put my form into header, so each page have this form.
My form make like this:
1. User put data.
2. Django make docx.
3. In the end it must open page with button in order to download the docx.
But if i will replace function “if form.is_valid” in an other function. After complete i see the window from form have been completed. But i want to see the page with button.
Артем
Please
Артем
It is very important
William
William
William
After providing info in form fields what is happening?
Артем
i have such function for each pages:
def contacts(request):
function(request, 'Отравлено с вкладки: контакты.')
form1 = Callback()
form2 = Callback_doc()
return render(request, 'contacts.html', {'form1': form1, 'form2': form2})
function():
def function(request, sentence):
now = datetime.datetime.now().strftime('%d-%m-%Y')
form1 = Callback(request.POST)
form2 = Callback_doc(request.POST)
a=[]
if form2.is_valid():
.................................
return render(request, 'form_res.html', {'result': 'Форма составлена не верно, попробуйте снова!'})
Артем
so in each time i see render contacts.html
Артем
but i want to see render form_res if form is valid
William
You can try like after submitting make that doc file open in new web page then give download option
Артем
William
Use javascript
Артем
no
i ask how to put form.is_valid in other function?
William
If form is valid then provide instance value inside it
Артем
Артем
?
William
Refer google
yyyyyy
Anyone plz help me
yyyyyy
Using Sqlite 3 database in pycharm what should I hve to install
KrishNa
Nothing
KrishNa
In Django sqlite3 is inbuilt
KrishNa
Go to setting file and check database portion
Firdavs
Guys what is form=Customer(request.POST)
Zaid
Is it possible to use postgresql in pythonanywhere free whitout upgrading plan
Ashri
Hii guys
Please anyone send me a link to practice Django code in online otherthan in app.
S now I am unable to do that ?
Rakesh
replit.com
John
Hey guys can anyone help me with this
I have an image field in a serializer, I want it like this
"picture_name_1": "http://127.0.0.1:8000/media/product_images/2020-08-05_2_SMMFeSM.png",
John
I'm getting the image url like this
"picture_name_1": "/media/product_images/2020-08-05_2_SMMFeSM.png"
John
class ProductVarientSerializer(serializers.ModelSerializer):
image = serializers.SerializerMethodField()
orders = serializers.IntegerField(default=22,read_only=True,required=False)
class Meta:
model = Product
fields = ('product_name','orders','views','image')
depth = 1
def get_image(self, obj):
request = self.context.get("request")
image = Variants.objects.filter(product_id=obj.id).first()
serialiser = Serializervariant(image, context={'request': request}).data
return serialiser
John
class Serializervariant(serializers.ModelSerializer):
picture_name_1 = serializers.SerializerMethodField()
class Meta:
model = Variants
fields = ('picture_name_1',)
def get_picture_name_1(self, obj):
request = self.context.get('request')
return obj.picture_name_1.url
Ashri
replit.com
Here
Every thing we can do ?
Like todoapp etc...i.e all files are installed
Rakesh
Rakesh
Whatever app you need you have to create on your own
Rakesh
It is creating projects using various features
Ashri
Ya
Just few days back I have started my journey in Django.
Even when I am learning machine learning also I haven't faced these types
Anonymous
I cannot optimize my site fully, what should i do?
Ashri
Rakesh
John
Ashri
👐
We will discuss later if I have any doubts
Rakesh
Mahdi
Piyush
What is the difference in between django and django rest framework ?
Please explain
John
Morteza