Hello,
I'd like to create a thumbnail for an image after it has been uploaded.
I have seen two possible approaches descibed here - subclassing
ImageField and overriding the save() method of the model. Although the
former seems more elegant, the latter seems like less work and I'm
inclined to try
[EMAIL PROTECTED] wrote:
> Hi!
>
> Is there way to change "upload_to" parameter's behaviour?
> I see there is hardcoded strftime replacement.
>
> What I want to achieve is to organise uploaded files with directories
> named with uploading user's name. eg. MEDIA_ROOT/uploads//
>
Jay's patch is c
Sasha wrote:
> Hello,
>
> I'd like to create a thumbnail for an image after it has been uploaded.
> I have seen two possible approaches descibed here - subclassing
> ImageField and overriding the save() method of the model. Although the
> former seems more elegant, the latter seems like less work
hey damian,
thanks for replying. i'd like to save the thumbnail into a separate
field. i just found the save_fieldname_file() method using the shell.
so my model looks like this:
class Picture(models.Model):
image = models.ImageField(upload_to="uploads", blank=True)
thumbnail = m
Thanks :-) I'll take a look at those resources.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group
Sasha wrote:
> def save(self):
> super(Picture, self).save()
> if self.image and not self.thumbnail:
> import Image
> myImage = Image.open(self.get_image_filename())
> myImage.thumbnail((150,150))
It might be worth you taking a look at the work done on Thumbnails in
DjangoUtils:
http://djangoutils.python-hosting.com/wiki/Thumbnails
Although not a solid chunk of code (there are a few issues with
namespaces, and it uses some Python 2.4 specific stuff), but with a
bit of hacking I got automa
PythonistL wrote:
> Hello Ivan,
> It is intereresting.
> But why do you use/prefer FastCGI to mod_python ?
> I am asking because I used for my Django apps FastCGI with Dreamhost
> but a lot of problems - Apache server used to hang when there were a
> lot of visitors. Now I switched to mod_python a
Hi,
I hope someone is still using 0.9.1, as I am having a small problem
with using _post_save() in a model on it.
I am creating a newsletter type system, which has various ForeignKey
fields. When the _post_save hook is called the email is sent, however
when I change the email and store it,
On 20 Jun 2006, at 11:25 am, David Reynolds wrote:
> I hope someone is still using 0.9.1, as I am having a small problem
> with using _post_save() in a model on it.
>
> I am creating a newsletter type system, which has various ForeignKey
> fields. When the _post_save hook is called the email is
We got a little more traffic, but not much, because it was a secondary
mention, rather than the main story. We're expecting a bigger hit
later this week, though, so we're preparing...
--Ned.
wiz wrote:
On 5/18/06, Ned Batchelder <[EMAIL PROTECTED]> wrote:
Hey all,
We've just
It seems that what I want to achieve can be done using "choices" as seen
here:
http://www.djangoproject.com/documentation/model_api/#choices
I think that I will define the three tables I use
(reference_data_domains, reference_data_values, reference_data_links)
in a model and make a function re
Honest, I really tried to figure this out on my own. I have been
relying on the Django website for answers but template examples are in
really short supply. I'd even accept a search string for Google if
that's all anyone is willing to give.
Thanks in advance.
--~--~-~--~~---
Hi All,
I'm in the process of learning Django by example - creating a blog
application.
SO, I have my blog up and running using the date based generics but
would like to limit the number of posts that appear in the main archive
(/path/to/site/blog/) to 10, which i've done in the urls.py like so:
I received an email from someone in the group for more clarification:
> But then, why do you want to put more than one image in a form?
There can be more than one photograph of each repair. I need to mirror
what is done in the admin with models that are edited inline.
> What is the form for? wh
Hi,
Frankie Robertson wrote:
> In general I find it to be quicker to
> have a quick read of the documentation, or, as a last resort, ask on
> IRC than to debug when using django
yeah, but nothing can really replace a debugger for err.. debugging :)
specially when it comes to solving problems tha
You should find what you're looking for here:
http://www.djangoproject.com/documentation/url_dispatch/#example
Regards,
-scott
On Tue, 2006-06-20 at 12:18 +, [EMAIL PROTECTED] wrote:
> Hi All,
>
> I'm in the process of learning Django by example - creating a blog
> application.
> SO, I h
On Tue, 20 Jun 2006 13:01:31 -
"Filipe" <[EMAIL PROTECTED]> wrote:
> Rephrasing my initial question a bit, can someone advise me on an
> IDE in which to build a django app that will allow me to
> "graphically" use a debugger? (ie, place breakpoints, inspect
> values in vars, see the current
And if you really need per-object permissions, you can use the new
GenericRelations recently checked in by Jacob. Ian has a nice post
about it here
http://feh.holsman.net/articles/2006/06/19/django-generic-relations,
which includes all the relevant links.
I was able to get a per-object permissio
I work fine with Komodo 3.5 Personal.
I follow this way:
http://groups.google.com/group/django-users/browse_thread/thread/46e2fe7895565c5b/8558ac68f9461710?q=komodo+&rnum=3#8558ac68f9461710
--~--~-~--~~~---~--~~
You received this message because you are subscrib
Hi i'm newbie and i want to publish my Django website.
I have this "stupid" problem.
I have a tab bar like this:
Home^M
Blog^M
Tags^M
Blank^M
Is MSSQL support good for a production site?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, s
Hi,
I really found I don't need a debugger for Django. If I have a
problem, I set some random variable to the data I am interested
in and raise a non-existing exception, like:
bla = user.__dict__
raise Bla
Then I deal with my browser, and the (great!) error page of
Django will tell me all I
On 6/20/06, mamcxyz <[EMAIL PROTECTED]> wrote:
> Is MSSQL support good for a production site?
No. I haven't heard from anybody who's actually using it, and I can't
test because I don't run WIndows.
Adrian
--
Adrian Holovaty
holovaty.com | djangoproject.com
--~--~-~--~~
Hi Patrick,
You might find some helpful responses in this thread:
http://groups.google.com/group/django-users/browse_frm/thread/50ee1c147854769/a79890af3059229d?q=menu&rnum=3#a79890af3059229d
On 6/20/06, Patrick <[EMAIL PROTECTED]> wrote:
>
> Hi i'm newbie and i want to publish my Django websit
On 6/20/06, mamcxyz <[EMAIL PROTECTED]> wrote:
>
> Is MSSQL support good for a production
site?
>
No, definitely not. :-/
There are 2 libs for SQL Server access (that I know of). adodbapi,
which is windows-only, a
Hi,
Why don't you post some code to see if we can understand better your
problem and what modifications could be done?
On 6/19/06, hotani <[EMAIL PROTECTED]> wrote:
>
> I'm pretty much giving up on this -- unless i find an alternative, I'm
> going to end up using hidden fields with the generic
hello, simple problem :
class Tag(models.Model):
name = models.CharField(maxlength=200, core=True)
total_ref = models.IntegerField(blank=True, null=True)
class Admin:
ordering = ['name']
def __str__(self):
return self.name
def get_absolute_url(self):
hi!
i've discovered django a few days ago and i must say it looks very useful
and decided to use it for my latest project. i might ask some simple
questions cause this is new to me, but am going over the documentation (and
google) before asking.
anyways done to business:
i'd like to use some
I've got a csv file filled with directory paths, users and their
permissions...
I have a database for paths and users
I need to go to every path and find which user has what permissions for
that path.
do I need to make a
class Web_Permission(models.Model):
path = models.ForeignKey(Web_Path)
I'm on another machine without my code readily available - so let me
attempt to rephrase one of the problems i'm having with generic
updates:
if there is a model with 10 fields, and an existing object which I'm
editing in a generic view, but only editing 2 of the 10 fields, it is
attempting to re
On 6/20/06, Ronny Srnka <[EMAIL PROTECTED]> wrote:
> i'd like to use some triggers to increment and decrement fields in the db.
> i've written them up but would like to know if there is somewhere to run
> them when i reset (or the initial syncdb on) an app with manage.py?
> i saw that django.core.
On 6/19/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
...
> Now, if I set up a join table (a DocumentRecipient model with Document
> and Recipient as foreign keys) and override the DocumentRecipient
> save() function to send the email, that works, but that seems like a
> clunky way to do things
Hey all-
For my django app I'm generating a bit of the model using a script.
The basic idea is that the script provides versioned data for
components. As new versions of components are added over time the
script needs to be re-run to add the data for the new versions.
The end users are also abl
Ok. Thanks
If some progress is made I'm can test it. So back to mysql :(
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To u
thanks heaps Nick and Jay.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAI
Thank you. I'll give that a try.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email t
Is there anything built into Django to cleanup text that a user might
enter in a textfield/comment/etc., so that if I display that text
field in a template, any unclosed tags in it won't screw up my page?
Something like the 'striptags' filter, except instead of removing all
tags, it just makes su
On 6/20/06, Jay Parlar <[EMAIL PROTECTED]> wrote:
>
> Is there anything built into Django to cleanup text that a user might
> enter in a textfield/comment/etc., so that if I display that text
> field in a template, any unclosed tags in it won't screw up my page?
>
> Something like the 'striptags'
You may just have a situation here that generic views can't handle,
and you'll have to write your own view. If you grep through
contrib.admin, you'll notice that they don't actually use any generic
views there.
That being said, it'd be nice if someone wrote a little tutorial on
creating your own
On 6/20/06, Jeremy Dunck <[EMAIL PROTECTED]> wrote:
> On the open web, you should never ever display text supplied by
> regular users as HTML. Doing so allows them to wreck the page at best
> and create security problems or denial of service at worst.
>
> That said, if you trust your users you mi
On 6/20/06, Jay Parlar <[EMAIL PROTECTED]> wrote:
> How do sites like Fark.com that allow HTML do it? I guess they've just
> written their own sanitizers.
LiveJournal as a well-evolved HTML filter, but it's in perl.
http://cvs.livejournal.org/browse.cgi/livejournal/cgi-bin/cleanhtml.pl
(It seems
On 6/20/06, Jay Parlar <[EMAIL PROTECTED]> wrote:
> Well, as it stands right now, I only need this to make sure that text
> entered into the Admin is ok, and that's all by trusted users, so
> Beautiful Soup might do it.
Python wrappers for Tidy:
http://utidylib.berlios.de/
>From the homepage:
=
On 6/20/06, Jeremy Dunck <[EMAIL PROTECTED]> wrote:
> LiveJournal as a well-evolved HTML filter, but it's in perl.
> http://cvs.livejournal.org/browse.cgi/livejournal/cgi-bin/cleanhtml.pl
>
> (It seems like Python should have one, but I don't know of one.)
Eww, I don't want HTML in comments enou
I avoid this issue by using a 'live preview' and let them use bbcode/
markup/textile only and stripping out ALL html.
On 21/06/2006, at 9:28 AM, Jay Parlar wrote:
>
> On 6/20/06, Jeremy Dunck <[EMAIL PROTECTED]> wrote:
>
>> LiveJournal as a well-evolved HTML filter, but it's in perl.
>> http:/
Hi,
I'm new to Python and Django, and i'm having some difficulties to
understand some issues.
I what to build a custom tag but can't deploy it, because I don't know
where to put my Node module.
In the documentation says how to build it, but not the deployment
instructions(http://www.djangoproje
On 6/20/06, Nuno Mariz <[EMAIL PROTECTED]> wrote:
>
> Hi,
> I'm new to Python and Django, and i'm having some difficulties to
> understand some issues.
> I what to build a custom tag but can't deploy it, because I don't know
> where to put my Node module.
> In the documentation says how to build i
Sorry,
Too many hours working ;)
Jay Parlar wrote:
>
> Scroll up on that page a bit, and read "Extending the template
> system". The deployment process is described there.
>
> Jay P.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to
On Mon, 2006-06-19 at 16:42 +, Paul Childs wrote:
> I am using the Dev trunk as of Saturday with the models below:
>
> #--
> class Repair(models.Model):
>
> tail_number = models.IntegerField(choices=AIRCRAFT_CHOICES)
>
> location = models.CharField(ma
PythonistL wrote:
> Hello Ivan,
> It is intereresting.
> But why do you use/prefer FastCGI to mod_python ?
I don't prefer it yet, just evaluating. I have some strange problems
with server overloading doing about 30 parallel requests all of which
sleep() about 90% of time. My first theory was t
50 matches
Mail list logo