How to get previously uploaded Images in Django

2020-05-04 Thread Nomeh Uchenna Gabriel
You should read about customising the admin here: 
https://docs.djangoproject.com/en/3.0/intro/tutorial07/

... but I suggest that you build your own website control panel which will 
control your website with API's 

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/37568d09-e5a6-4ab4-be12-ed2881d6d119%40googlegroups.com.


How to get previously uploaded Images in Django

2020-05-03 Thread Ahmed Khairy


I am using Django 2.2 to make a project where designers upload designs and 
when I want to post them from admin, I want to choose their names and after 
I choose their names only their designs appear in the drop down list. So 
far I have reach the reach the designer name in a drop down list but I 
don't know how to link only their designs in the designs drop list.

I am using 2 different apps: 1."Score" where designers can upload their 
designs
2."Core" where I can list the items

First in the Score .model where designers upload the designs

class Post(models.Model):
designer_name = models.ForeignKey(User, on_delete=models.CASCADE)
design = models.ImageField(
blank=False, null=True, upload_to='new designs')
title = models.CharField(max_length=100)

def __str__(self):
return self.title

def get_absolute_url(self):
return reverse("score:post-detail", kwargs={"pk": self.pk})

Second in the Core App Model:

class Item(models.Model):
title = models.CharField(max_length=100)
description = models.TextField()
price = models.FloatField()
designer_name = models.ForeignKey(User, on_delete=models.CASCADE)
image = models.ImageField(blank=False, upload_to='imgs') **How can I make 
this a drop down list with the selected user's (designer's) all previously 
uploaded images to choose from instead of uploading new images**


def __str__(self):
return self.title

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/c25a66ad-ba1d-4351-89b6-53698b96997d%40googlegroups.com.