On 30 Oct 2020, at 11:00, Carles Pina i Estany wrote:
Let me know if it's not clear or if I explained something that you
didn't ask!
Thanks you very much for spending the time on this, to explain it to
me - it was very helpful!
-- Clive
--
You received this message because you are
Hi Clive,
On Oct/28/2020, Clive Bruton wrote:
> Thanks, that was very helpful. I had another pointer on this and found out
> that the easiest way to do this is just to change the ```file``` line in the
> class to:
>
> ```
> file = ImageField(_('image'),
Thanks, that was very helpful. I had another pointer on this and
found out that the easiest way to do this is just to change the
```file``` line in the class to:
```
file = ImageField(_('image'), upload_to='images/items/%Y/%m/%d/%
H/%M/%S')
There are a few things that I do not
Hi,
On Oct/27/2020, Clive Bruton wrote:
> I have a function that uses the current date to set up a file path for
> uploaded images:
>
>
>
> def upload_path():
[...]
> class Image(models.Model):
> item = models.ForeignKey(Item, on_delete=models.CASCADE)
>
I have a function that uses the current date to set up a file path
for uploaded images:
def upload_path():
dtnow = datetime.now(timezone.utc)
dtstr = '{:%Y/%m/%d/%H/%M/%S}'.format(dtnow)
print('dtstr: ')
print(dtstr)
dtstr =
5 matches
Mail list logo