I'm terribly sorry, my bad. Of course, the second example is:
class Image(models.Model):
image = models.ImageField(upload_to = upload_path('i'), blank=True)
thumbnail = models.ImageField(upload_to = upload_path('t'), blank=True)
суббота, 26 января 2013 г., 3:58:55 UTC+4 п
There is no t_upload_path
2013/1/25 Sammael
> Hello, folks!
>
> Here is the relevant part of my model:
>
> def i_upload_to(instance, filename):
> return '/'.join([strftime('i/%y%m/%d'), filename])
>
> def t_upload_to(instance, filename):
> return '/'.join([strftime('t/%y
solved this by moving it to the model clean() method, and using
imagefield.file.open() and imagefield.file.read() to get the data for
computing the other fields.
On Wed, May 11, 2011 at 1:28 PM, Brian Craft wrote:
> I have a model with an imagefield, and some fields that are computed
> from the i
Hi Javier,
I am experiencing the same problem with 'upload_to'. Have you found
the problem?
Thx,
elm
On 14 nov, 18:31, Javier <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I've create a model:
>
> class ImagenesLugar(models.Model):
> archivo = models.ImageField(upload_to="imageneslugar/")
> te
On Nov 14, 9:31 pm, Javier <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I've create a model:
>
> class ImagenesLugar(models.Model):
> archivo = models.ImageField(upload_to="imageneslugar/")
> texto = models.CharField(max_length=400)
>
> The thing is that when i create a new instance of this mode
worked like a charm. thx.
On Sep 18, 5:21 pm, gnijholt <[EMAIL PROTECTED]> wrote:
> I had to define the callable function before it gets called.
> So in your case I'd put it right under class Product(models.model)
> Then you should be able to just do:
> upload_to=get_image_path
>
> Cheers,
>
>
I had to define the callable function before it gets called.
So in your case I'd put it right under class Product(models.model)
Then you should be able to just do:
upload_to=get_image_path
Cheers,
On Sep 18, 10:20 pm, lingrlongr <[EMAIL PROTECTED]> wrote:
> According to the documentation, I ca
And in case anyone is interested in the results (a demo django gallery
application) have a look here:
http://saschashideout.de/wiki/DjangoGalleryTutorial/
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django use
Thanks, this is quite a good idea, the more I think about it the more
I like it, because Images have only one Gallery, but I can change the
gallery for every image if I want, which would lead to the problem of
moving the image file from one directory to another. Your proposal
seems to be the bette
Am Wed, 04 Jul 2007 01:19:16 -0700
schrieb lastmohican <[EMAIL PROTECTED]>:
> The Problem is, I want a dynamic image
> storage path, something like MEDIA_ROOT+"images/" wont work with
> hundreds of galleries, [...]
Since your primary concern seems to be too many files in one directory,
did you c
timster wrote:
> Should the super() method work even though I'm not using MR?
No. super().save() only works in MR. You'll need the _pre_save() and
_post_save() hooks in .91 or trunk.
--
--Max Battcher--
http://www.worldmaker.net/
"I'm gonna win, trust in me / I have come to save this world /
timster wrote:
> Should the super() method work even though I'm not using MR?
No. super().save() only works in MR. You'll need the _pre_save() and
_post_save() hooks in .91 or trunk.
--
--Max Battcher--
http://www.worldmaker.net/
"I'm gonna win, trust in me / I have come to save this world /
Thanks for the reply Ian.
I seem to have solved this for the most part. The second message in
that thread was very helpful. I was able to use that solution almost
exactly. I added the following save() method to my model:
def save(self):
if self.image:
import shutil
from os im
On 4/4/06, timster <[EMAIL PROTECTED]> wrote:
> What I would like to do is store the image in a subfolder corresponding
> to the gallery_id. If "Subaru" is gallery_id 1 and "Audi" is gallery_id
> 2, I would want it to look like this:
>
> gallery/1/subaru1.jpg
> gallery/2/audi1.jpg
>
> Is this poss
14 matches
Mail list logo