Pradyum
No m using sqllite
check import export library they may be providing some functions or you may take/use their functions from their code try it works well
Pradyum
https://django-import-export.readthedocs.io/en/latest/
Ankit
Yes that part I will do , but
Class vendor(APIView):
Def post(self,request):
PurchaseOrder=vendorserializer(data=request.data)
If serializer.is_valid():
Serialized.save()
''''''' here I have to get is if this table and again dave it to other table"""""
Ankit
Thank you for your support can you looking into this code Pradyum
Pradyum
please paste using dpaste firstly, what inside serializers.py?
Pradyum
vendorserializer
Ankit
Didn't get
Ankit
Cant I send pic in this group
Ankit
?
Pradyum
yeah that would also work well
Ankit
Sending media is not allowed in this group
Ankit
😐
Ankit
Wait will paste my code after push it to git
Ankit
Serialized.py
Ankit
Models.py
Ankit
View.py
Ankit
Kindly check it
Mirco
Doragonsureiyā
Wait will paste my code after push it to git
To share code or error tracebacks please use an online pasting service, here is a list of suggested sites:
- https://del.dog
- https://dpaste.org
- https://linkode.org
- https://hastebin.com
- https://bin.kv2.dev
Pradyum
Ankit
Sorry I didn't know that
Ankit
I will do that from next times
Ankit
Ankit
?
Mirco
Ankit
https://dpaste.org/WUMp#
Ankit
Kindly check the code
Ankit
I will highly appreciate your help
Ankit
Thank you
Pradyum
Can you the code now
1. See imo you have to form a serializer field for getting the file which you have not formed serializer.FileField else you wont be able to post the file via postman
Putting the records into models that you have defined is the end thing
2. Depends upon you where you want to parse the excel in serializer or in views imo go with serializer and then separate the headers out from excel match them in column fields that is the model fields for that use for loop
3. Just check import export they have given a lot of support in importing and exporting parts then you dont have write all the functions you can use their code
4. Just a tip use PDB debugger it works well with DRF you can debug every part and see whats happening behind the scene
Ankit
Yes sure I will do that thank you Pradyum
Sacs
John
Please I tried setting up django-shop on my system and it requires python3.7 but my system default is 3.8. I added python3.7 but when i try to run pipenv install , I get this:
John
https://dpaste.org/cQnf
John
In the traceback, i can see that it reads from the python3.7 virtualenv and also my local python3.8
John
Please how can i fix this?
Habib
Please how can i fix this?
Uninstall all python first then install python what you need.
I recommend changing virtualenv with https://python-poetry.org
John
John
And the django-shop came with pipenv setup
John
Anonymous
I am connect my project and database and use admin panal to fill data in data base but I am fill the front end from so my data is not store in data please help me
My data base - Postgrassql
Украинский
---
i am creating a reporting system in Django need guidance in creating reports view and comment section level wise.. like level 1's reports can be viewed and comment by level 2 and the same in increasing levels...
The
Hello everyone
How do i get URI of incoming reauest in django
The
I want to map one view class with two url
The
So when request comes how do i know which url was called
Anonymous
class Product_List_View(View):
# template_name='Product/product-list.html'
template_name='ProductPages/product-list.html'
context={}
model=Category
look_up='id'
def get_object(self):
id=self.kwargs.get(self.look_up)
queryset_products_list = Product.objects.all()
queryset_category_list = Category.objects.all()
if id is not None:
queryset_category = get_object_or_404(self.model, id=id)
queryset_products_list = queryset_category.product_name.all()
return queryset_category_list, queryset_products_list
def get(self, request, id=None, *args, **kwargs):
product_object_list = None
category_object_list = None
category_object_list, product_list = self.get_object()
paginator = Paginator(product_list, 9)
page_number = request.GET.get('page')
product_object_list = paginator.get_page(page_number)
self.context['product_object_list'] = product_object_list
self.context['category_object_list'] = category_object_list
return render(
request,
self.template_name,
self.context
)
Anonymous
{% for page_index in range( 1, product_object_list.paginator.num_pages ) %}
<li class="page-item"><a class="page-link" href="?page= {{ page_index }}">page_index</a></li>
{% endfor %}
Anonymous
and i got this error message
TemplateSyntaxError at /1/category/
'for' statements should use the format 'for x in y': for page_index in range( 1, product_object_list.paginator.num_pages)
The
Anonymous
someone help. me with multi step form in djnago.
my template is not rendering if i extend it from base. html
Anonymous
and give template name in wizard
Vivek
Hello how can I create nested models in django
Vivek
I've to model class that is Community and Villages inside my models.py... inside community I've CommunityName as primary key and in Village class I've set community class as a foreign key and villageName as a primary key
Vivek
Now in admin site when I create Community name I'll be able to click on the community created and after that it should show me a field to enter a village
Vivek
How to do it
Pradip
Do you have code for reference
The
can somebody help me with builing a screenwriting application using python/django
The
?
The
?
zuzuzuzu
How do i send emails without setting up a smtp like through gmail
Anonymous
Vinayak Kumar
I want to turn Debug =False for my django website, but it is giving me error 500, i have also specified the Allowed Host in settings.py. i want to use my website for production.
Any help
.
Vinayak Kumar
What shall i do
The
Anonymous
The
Anonymous
I want to help
Anonymous
But what kind of help you need? Is there any error
Anonymous
Or problem with creating models
The
https://github.com/piersdeseilligny/betterfountain/blob/master/FAQ.md
The
how to integrate this in my website
The
fountain
Anonymous
I have to try it first, may be after that I can help
The
ok
The
i'll wait
Ani