hi,
i many times use the object's content-type's "model" attribute,
when generating URLs for certain actions.
and i many times need to get the given object's content-type
in the template.
unfortunately i haven't found any way to do it, so i:
- either do it in the view
- or i add a content-type
Nearly there with this code...
from PIL import Image,ImageFile
def get_image(src):
import urllib
fp = urllib.urlopen(src, "rb")
p = ImageFile.Parser()
while 1:
s = fp.read(1024)
print ".",
if not s:
thanks
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For mor
Hello,
I'm trying to write a very simple script that takes a list of URLs
for images and gets their data... resizes them to 110x110 (hopefully
preserving aspect ratio) and then puts that data into an ImageField
obj...
any pointers gratefully received
tom
--~--~-~--~~---
Filipe schrieb:
> Michael Radziej wrote:
>> Well, as a work around, if you don't use a database, you should
>> remove
>> "django.core.context_processors.auth",
>> from TEMPLATE_CONTEXT_PROCESSORS in settings.py
>
> hmm, I don't have that in settings.py. However, I do have:
Ah, it's there by
What about using MEDIA_ROOT instead of STATIC_LOC?
isn't MEDIA_ROOT's purpose the same?
--~--~-~--~~~---~--~~
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@googleg
PHP ? and quasi open SMF ? you could help with MyghtyBoard and soom
there would be a nice Django based forum script :)
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, sen
Michael Radziej wrote:
> Well, as a work around, if you don't use a database, you should
> remove
> "django.core.context_processors.auth",
> from TEMPLATE_CONTEXT_PROCESSORS in settings.py
hmm, I don't have that in settings.py. However, I do have:
INSTALLED_APPS = (
'django.contrib.auth
On 10 Sep 2006, at 16:52, Allan Henderson wrote:
>
> Complete newbie problem here but i can't seem to get django to show
> any images or stylesheets etc.
>
> In urls.py:
>
> (r'^images/(?P.*)$', 'django.views.static.serve',
> {'document_root': '/Users/whitebook/django/django_projects/mysit
Thank you, Malcolm, Ivan :) That just saved me helluva lot of work!
--
James
--~--~-~--~~~---~--~~
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
Hello Antoni,
On Wed, 2006-09-13 at 16:04 +0200, aaloy wrote:
> Hello,
>
> I have an strange issue when trying to edit inline my model on the
> Django admin. Some of the models works properly and others not.
> It doesn't give any error but the data is not saved.
>
[... example snipped...]
> I
Thanks Andres,
quite interesting. The way i solved it was based on parts of the wiki
and loads of trial and error.
I made a class that simplifies using custom Manipulators and then
derived a specific class for adding a Patient (model i'm using) where i
initialise the derived class by calling th
Suppose I have a dictionary like this:
data = { 'a':'1', 'b':'2', 'c':'3' }
and a model like this:
class Test(models.Model):
a = models.CharField(maxlength=8)
b = models.CharField(maxlength=8)
b = models.CharField(maxlength=8)
I would like (in a python script) to be able to say
t
On Tue, 2006-09-26 at 13:50 +, James Mulholland wrote:
> Suppose I have a dictionary like this:
>
> data = { 'a':'1', 'b':'2', 'c':'3' }
>
> and a model like this:
>
> class Test(models.Model):
> a = models.CharField(maxlength=8)
> b = models.CharField(maxlength=8)
> b = models.
Thanx for the link!
I solved the problem by simply
forwarding to my own generic viewmethod
and taking request.path to build my own namespace.
I want general views of *All* my contentobjects without the need to
customize any templete ( but still be able to customize if wanted)
--~--~-~--
On Tue, 2006-09-26 at 12:42 +0100, Tom Smith wrote:
> Nearly there with this code...
>
> from PIL import Image,ImageFile
> def get_image(src):
> import urllib
>
> fp = urllib.urlopen(src, "rb")
> p = ImageFile.Parser()
>
> while 1:
> s = fp.read(1024)
>
James Mulholland wrote:
> Suppose I have a dictionary like this:
>
> data = { 'a':'1', 'b':'2', 'c':'3' }
>
> and a model like this:
>
> class Test(models.Model):
> a = models.CharField(maxlength=8)
> b = models.CharField(maxlength=8)
> b = models.CharField(maxlength=8)
>
> I would
> The easiest fix I can think of would be to put a hidden field in your
> form that holds the id of the current user. This will put a 'user'
> entry into your form data, which will allow the create/update generic
> views to submit without error.
I definitely do not want to do this for security re
bump. please help. this is driving me nuts.
--~--~-~--~~~---~--~~
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, se
On 9/25/06, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote:
>
> On Mon, 2006-09-25 at 23:12 +, Steve M wrote:
> > Hi,
> >
> > I have my Django project source files on a SMB share (it is a Linux
> > file server).
> >
> > I am running the development server on a different Linux computer,
> > which
Yes, I got very unlucky with this.
The browser rendered the BOM as a normal invisible character, where I
was expecting only whitespace.
Normally I use UTF-8 without BOM, but I missed some files.
You're right, fixing this would be an extra processing.
It would be a fix for HTML, if the template
Hi Malcom,
I have played a little around it and it seems to work ok adding
filter_interface=models.HORIZONTAL to the Field.
Here is the ticket I've created:
http://code.djangoproject.com/ticket/2828#preview
Thanks.
--~--~-~--~~~---~--~~
You received this message
On 9/26/06, gkelly <[EMAIL PROTECTED]> wrote:
>
> I have the following model and view:
>
> http://pastebin.ca/182428
>
> If I manually edit
> /usr/local/lib/python2.4/site-packages/Django-0.95-py2.4.egg/django/contrib/auth/models.py
> and change User.__str__(self) to return a string like
> 'TEST'+
Nop, still doesn't work with filter_interface=models.HORIZONTAL. But it
worked a couple of times. I will take a further look at it.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to th
Alan,
I've tried using ForeignKey also. It gives me different problems. See
http://groups.google.com/group/django-users/browse_thread/thread/ad493aadb30b3cde/
I'd love to get some more input.
Thanks,
Grant
--~--~-~--~~~---~--~~
You received this message because
Why is there only one forum for "Django Programming"?
Cerberus wrote:
> I decided to start up some forums for anyone that wants to join. I know
> many like google but these forums might be of use as well.
> Thanks.
> http://djangoforums.org/index.php
--~--~-~--~~~---
Any fellow djangonauts going to be at the hackday? I'm going, hope to
see some of you there!
Ciao
Sandro Turriate
hackday.org
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this
What's the proper way to create a field which is set to the date the
object was created via a web view?
I tried doing this in the model:
def Today():
return datetime.date.today()
date_created = models.DateField(default=Today)
Which works when presenting the "create" page to the user, but
On 9/26/06, Mongo <[EMAIL PROTECTED]> wrote:
> Which works when presenting the "create" page to the user, but when
> they submit, the "new_data = request.POST.copy()" causes new_data to be
> constructed without date_created, causing an error when I try to save
> since it.
Default values are *only
I would like it to appear as if it was a default value for the object,
to be honest. :) And by that I mean I would like to be able to display
the default-value of date_created on the create page (and the actual
date_created of the object on an edit page.)
Doing it in save() doesn't help. Doing it
On 9/26/06, Mongo <[EMAIL PROTECTED]> wrote:
> I would like it to appear as if it was a default value for the object,
> to be honest. :) And by that I mean I would like to be able to display
> the default-value of date_created on the create page (and the actual
> date_created of the object on an e
Hi all,
I'm a new subscriber to this list, and am having an issue that I'm
hoping you can help me with (I also posted this as a trouble-ticket,
because I'm not seeing any references to this issue anywhere and it
seems buggy):
It looks like my models are caching their DB query in a way that I
On Sep 26, 2006, at 6:06 PM, Greg Plesur wrote:Hi all,I'm a new subscriber to this list, and am having an issue that I'm hoping you can help me with (I also posted this as a trouble-ticket, because I'm not seeing any references to this issue anywhere and it seems buggy):It looks like my models are
Don,
Don Arbow wrote:
> Did you read this documentation, especially the last line of this paragraph?
>
> http://www.djangoproject.com/documentation/db_api/#id3
>
> In a newly created QuerySet, the cache is empty. The first time a
> QuerySet is evaluated -- and, hence, a database query happens
Hello. I have been reading through as much of the AJAX topics and
AJAX tutorials surround Django as I have had time for, but I am lost in
the flow of things. First some background information, I have three
dynamic & dependent selects (dropdown lists). The options for the
selects are populate
Supposedly django allows you to create an app with a directory called
models that contains files with model definitions in it. Instead of the
default models.py single file. I can't seem to get it to work I have
tracked down what seems to be the correct syntax for the __init__ file
but to no avail.
On Tue, 2006-09-26 at 20:29 -0700, cydeshow wrote:
> Supposedly django allows you to create an app with a directory called
> models that contains files with model definitions in it. Instead of the
> default models.py single file. I can't seem to get it to work I have
> tracked down what seems to b
On 9/27/06, brad <[EMAIL PROTECTED]> wrote:
>
> Here's my idea or at least the little bit that I can put together
> so far: The first select has an onclick="CALL_SOME_FUNCTION" that kicks
> off the process of retreiving the second select's data and make the
> changes using DOM manipulation. N
On Tue, 2006-09-26 at 20:12 -0700, brad wrote:
> Hello. I have been reading through as much of the AJAX topics and
> AJAX tutorials surround Django as I have had time for, but I am lost in
> the flow of things. First some background information, I have three
> dynamic & dependent selects (dr
Nevermind, found thread: http://groups.google.com/group/django-users/browse_thread/thread/96442d089932d521/5e6bdd3ef0926641?lnk=st&q=FilterSpec&rnum=2#5e6bdd3ef0926641
Please disregard.On 9/27/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]
> wrote:Evening all,I was looking at filterspecs last night becau
40 matches
Mail list logo