Hi,
I am a beginner and please forgive me if my question is not up to the
standard. I've got two models one is Product which is saved in db already
and another one is Shop. I am trying to related both models with following
code.
class Product(models.Model):
user = models.ForeignKey(setting
I am trying to create a parent model for my products app and I need to
provide the user reference. I've registered the Shop model with admin.py.
Now I have problem that when I see in model it shows all the products
listed before. I only intend to show products added by the shop owner. Also
I ne
@Mudassar this is exactly what I need.
On Wednesday, August 17, 2016 at 6:37:51 PM UTC+5, Shamaila Moazzam wrote:
>
> Hi,
>
> I am a beginner and please forgive me if my question is not up to the
> standard. I've got two models one is Product which is saved in db alread
@Ludovic there is no error. Just I don't want to get all the products
pre-populated. I need empty products field and only when user uploads
products then it should show me products. Please advise
On Wednesday, August 17, 2016 at 6:37:51 PM UTC+5, Shamaila Moazzam wrote:
>
> Hi,
r as well, then you can add
> user FK to products as well. These things are not mutually exclusive.
>
>
>
> On Wednesday, August 17, 2016 at 4:37:51 PM UTC+3, Shamaila Moazzam wrote:
>>
>> I am trying to create a parent model for my products app and I need to
>> provid
ust 17, 2016 at 6:37:51 PM UTC+5, Shamaila Moazzam wrote:
>
> I am trying to create a parent model for my products app and I need to
> provide the user reference. I've registered the Shop model with admin.py.
> Now I have problem that when I see in model it shows all the produc
On Wednesday, August 17, 2016 at 6:37:51 PM UTC+5, Shamaila Moazzam wrote:
>
> Hi,
>
> I am a beginner and please forgive me if my question is not up to the
> standard. I've got two models one is Product which is saved in db already
> and another one is Shop. I am trying
> Could you share your admin.py file ?
>
> You might be interested into this part of the documentation:
>
> https://docs.djangoproject.com/en/1.10/ref/contrib/admin/#django.contrib.admin.ModelAdmin.formfield_for_foreignkey
>
>
> 2016-08-17 17:20 GMT+02:00 Shamaila Moaz
duct.objects.filter(user=request.user)
> return super(ShopAdmin,
> self).formfield_for_manytomany(db_field, request, **kwargs)
>
> admin.site.register(Shop, ShopAdmin)
>
> ###
>
> It should give you the desired result
>
> 2016-08-17
am making a shops dashboard view .in that view i have used a mixin as
mentioned belowmy issue is i want to get products related to a specific
account or user . i have products m2m in shop model and also have user f.k
in Shop model. In get_shopproducts() function in ShopAccountMixin()..i am
unab
> Mudassar
>
> On Thu, Sep 1, 2016 at 8:45 AM, Shamaila Moazzam > wrote:
>
>> am making a shops dashboard view .in that view i have used a mixin as
>> mentioned belowmy issue is i want to get products related to a specific
>> account or user . i have produ
.product in **account
> **]*)
>
> return products
>
> I hope this help you.
>
>
> On Thursday, September 1, 2016 at 9:15:45 PM UTC+5:30, Shamaila Moazzam
> wrote:
>>
>> am making a shops dashboard view .in that view i have used a mixin as
>> mentioned belowmy issue
hi
I am a beginner in django/python * :(*
I am making a dashboard of sellers App.
I am stuck in filtering orders of the products according to the logged in
user(seller)
*sellers/models.py*
from django.conf import settings
from django.core.urlresolvers import reverse
from django.db import mo
Regards,
> Jibran
>
> On Tuesday, September 20, 2016 at 9:04:18 AM UTC+4, Shamaila Moazzam wrote:
>>
>> hi
>> I am a beginner in django/python * :(*
>>
>> I am making a dashboard of sellers App.
>> I am stuck in filtering orders of the products according to the lo
Hi ,
i am having the same problem ..with my sellers App .
can you share your solutionthat how you filter
regards
On Monday, September 19, 2016 at 5:27:31 PM UTC+5, A.Khan wrote:
>
> I just got it done.
>
> Thanks.
>
> On Mon, Sep 19, 2016 at 4:19 AM, Ali khan > wrote:
>
>> I've tried
associating a product with an order? Is there a way to get a
>> list of products sold for each order?
>>
>> Asad Jibran Ahmed >
>> http://blog.asadjb.com
>>
>> On Tue, Sep 20, 2016 at 9:24 AM, Shamaila Moazzam > > wrote:
>>
>>> Thanks for you ki
for o in orders:
> for p in o.cart.products:
>products_list.append(p)
>
> return products_list
>
> This depends on their being a ManyToMany relationship to Product in the
> Cart model.
>
> Asad Jibran Ahmed
> http://blog.asadjb.com
>
> On Tue, Sep 20, 2
hi,
i am trying to display a set of images with the use of index.
here is the code:
{% for item in product.productimage_set.all %}
{% endfor %}
the above code is displaying a set of images for one product .right.
i want to displa
{% for item in product.productimage_set.all %}
{% endfor %}
this code is displaying different images of a single product ,but the
question is how to slice them ,how to get image[0], image[1] ..on the
product page...
can any o
19 matches
Mail list logo