Hi,
I followed those steps in the link and its working fine for
static files (like css scripts etc). But when i'm trying to display an
image, its not working. I'm trying to display an image which is in
static/barcodeimages directory (static is the directory to which i set
all static file
This is just a quick hack for anyone else bit by this: tzinfo is never
set when reading DateTimeFields out of the database, at least with
Postgresql.
Now, I have no idea why anyone would want to set TIME_ZONE to anything
but UTC (and the default of an arbitrary US timezone is rather
bizarre), but
according to the link http://docs.djangoproject.com/en/dev/howto/static-files/
site_media is the URL where your media will be rooted and The file /
path/to/media/foo.jpg will be made available at the URL /site_media/
foo.jpg.
so i thought the file which is at ~/../djcode/myproject/static/pic.jpg
Hi All,
I am trying to add check constraints to my table and i was ended with
the below error.
I got this statement "from check_constraints import check" from django
doc site.
(http://code.google.com/p/django-check-constraints/wiki/Features)
Please guide me if I am missing any thing while import
On Sat, May 16, 2009 at 11:14 PM, mickey wrote:
>
> Ok this doesn't sound too intuitive. If anyone else have a better
> solution please do post.
>
> Thanks.
>
> On May 16, 8:01 pm, Alex Gaynor wrote:
> > On Sat, May 16, 2009 at 9:57 PM, mickey wrote:
> >
> > > So are you telling me to pass the
Ok this doesn't sound too intuitive. If anyone else have a better
solution please do post.
Thanks.
On May 16, 8:01 pm, Alex Gaynor wrote:
> On Sat, May 16, 2009 at 9:57 PM, mickey wrote:
>
> > So are you telling me to pass the template name for each and every
> > functions i define in views.py
I've got a new home page and I'd like to test it's performance in
getting users to sign up compared to my existing home page. In Django
terms I have two templates that I would like my existing view to
alternate between - I want to make whatever template the viewer sees
"sticky" - they see the sam
I am looking to make a webmail client proof of concept in django. I
ran across twisted mail and this post:
http://clemesha.org/blog/2009/apr/23/Django-on-Twisted-using-latest-twisted-web-wsgi/
showing how to use django on twisted.
Can anyone point me in the right direction for actually getting da
On May 17, 2009, at 1:26 AM, Apple wrote:
>
> I write some code like following:
>
> #coding=utf8
> from django.shortcuts import render_to_response
> from django.http import *
On Sat, May 16, 2009 at 9:57 PM, mickey wrote:
>
> So are you telling me to pass the template name for each and every
> functions i define in views.py?
>
> >
>
Yes, the best way would probably be to write a wrapper function around
render_to_response that took the template name and put it into the
So are you telling me to pass the template name for each and every
functions i define in views.py?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-use
On 13.05.2009 18:55, Michael wrote:
> Auth leans on some templates in django.contrib.admin for the tests. This
> is known, though not ideal. If you added django.contrib.admin to your
> installed apps, the failures should go away.
>
> I hope that helps,
> Michael
Thanks! That helped.
And I disco
On Fri, 2009-05-15 at 15:12 -0700, nih wrote:
> in the admin change form the select box only shows name.username (eg
> nih)
> is it possible to show the full name in the select box
You are looking to override label_from_instance(). See here
http://docs.djangoproject.com/en/1.0/ref/forms/fields/#
2009/5/17 sampablokuper
> I've been encountering the same problem. It's especially frustrating
> because it seems model validation used to be much easier in Django
> (see
> http://www.cotellese.net/2007/12/11/adding-model-field-validation-to-the-django-admin-page/
> ).
> [...]
>
> Are the Django
On Sat, May 16, 2009 at 8:26 PM, ringemup wrote:
>
>
> For the reference of anyone who comes across this in the future, you
> have to fetch the related model IDs as a list, like so:
>
> Entry.objects.filter(category="some category").values_list('id',
> flat=True)
>
>
> On May 16, 7:24 pm, ringemu
On May 17, 12:07 am, Daniel Roseman
wrote:
> On May 16, 11:32 pm, ajohnsen wrote:
> > I am trying to assign max_value and min_value to a
> > PositiveIntegerField in my model but am getting the error:
>
> > year_built = models.PositiveIntegerField(min_value=1800,
> > max_value=2100)
> > TypeError
For the reference of anyone who comes across this in the future, you
have to fetch the related model IDs as a list, like so:
Entry.objects.filter(category="some category").values_list('id',
flat=True)
On May 16, 7:24 pm, ringemup wrote:
> Thanks -- that was exactly the sort of thing I was loo
Thanks -- that was exactly the sort of thing I was looking for! Just
couldn't figure out how to do it.
>
> Comment.objects.filter(content_type=ContentType.objects.get_for_model(Entry),
> object_pk__in=Entry.objects.filter(category="some category")).
>
--~--~-~--~~~---
Works like a charm.
Thanks a lot Alex, it saves me a lot of searching and trying.
On Sun, May 17, 2009 at 2:37 AM, Alex Gaynor wrote:
>
>
> On Sat, May 16, 2009 at 4:52 PM, Jon wrote:
>
>>
>>
>> Hi all.
>>
>> I think django really rocks, but i have a question:
>>
>> I wrote a script in python t
On May 16, 9:19 pm, newbie wrote:
> Hi,
>
> Thanks for your immediate reply. I've seen the document and
> followed the steps in it already. But was not able achieve any
> progress. In
>
> (r'^site_media/(?P.*)$', 'django.views.static.serve',
> {'document_root': '/path/to/media'}),
>
> d
On May 16, 11:32 pm, ajohnsen wrote:
> Hello,
>
> I am trying to assign max_value and min_value to a
> PositiveIntegerField in my model but am getting the error:
>
> year_built = models.PositiveIntegerField(min_value=1800,
> max_value=2100)
> TypeError: __init__() got an unexpected keyword argume
On May 16, 10:51 pm, Alex Gaynor wrote:
> On Sat, May 16, 2009 at 4:49 PM, zayatzz wrote:
>
> > Hello
>
> > Been trying to figure out where the problem is, but its almost 1am and
> > im out of ideas.
>
> > i have this model:
> > class tuser (models.Model):
> > username = models.CharField(
On Sat, May 16, 2009 at 4:52 PM, Jon wrote:
>
>
> Hi all.
>
> I think django really rocks, but i have a question:
>
> I wrote a script in python that will get some values from servers and
> puts in them in a dictionary.
>
> The data is in the following format
> {'somehost': ['yes', '2'], 'remoteh
Hi all.
I think django really rocks, but i have a question:
I wrote a script in python that will get some values from servers and
puts in them in a dictionary.
The data is in the following format
{'somehost': ['yes', '2'], 'remotehost': ['yes', '1'], 'localhost':
['yes', '1']}
In python, i ca
Hello,
I am trying to assign max_value and min_value to a
PositiveIntegerField in my model but am getting the error:
year_built = models.PositiveIntegerField(min_value=1800,
max_value=2100)
TypeError: __init__() got an unexpected keyword argument 'max_value'
Here is the model:
from django.db i
On Sat, May 16, 2009 at 5:28 PM, ringemup wrote:
>
> Contrib.comments references related object primary keys instead of the
> objects themselves, so is there any easy way to filter comments on a
> property of the related model? For instance, if I have a blog and
> want to retrieve all comments f
Contrib.comments references related object primary keys instead of the
objects themselves, so is there any easy way to filter comments on a
property of the related model? For instance, if I have a blog and
want to retrieve all comments for entries in Category X, is that
possible through the Djang
On Sat, May 16, 2009 at 4:49 PM, zayatzz wrote:
>
> Hello
>
> Been trying to figure out where the problem is, but its almost 1am and
> im out of ideas.
>
> i have this model:
> class tuser (models.Model):
>username = models.CharField(max_length=20, help_text="Enter Username
> of your acco
Hello
Been trying to figure out where the problem is, but its almost 1am and
im out of ideas.
i have this model:
class tuser (models.Model):
username = models.CharField(max_length=20, help_text="Enter Username
of your account")
email = models.EmailField(max_length=100, help_text=
2009/5/16 :
>
> Hi All,
>
> Need help in creating foreign key column in a table.
>
> In the below model I would like to create a foreign key for the field
> 'new_foreign_col' which should refer to 'username' column (non primary
> column) from auth_user table.
>
> class details(models.Model):
>
On May 16, 9:07 am, Joshua Russo wrote:
> Does anyone know what the constraints
> are to using the break command within pdb?
Autoreload spawns a new python interpreter. Nothing survives. So don't
use autoreload.
Another caveat: if you try to set a breakpoint and pdb can't find the
file, it's pr
On Sat, May 16, 2009 at 5:18 PM, Alex Gaynor wrote:
>
>
> On Sat, May 16, 2009 at 3:03 PM, simon101 wrote:
>>
>> Hi
>>
>> I am using ModelForms to create forms from the models [...]
>> but it doesn't contain the id
>> for the object id for the object which the ModelForm pulled it off.
>>
>> Any
Hi,
Thanks for your immediate reply. I've seen the document and
followed the steps in it already. But was not able achieve any
progress. In
(r'^site_media/(?P.*)$', 'django.views.static.serve',
{'document_root': '/path/to/media'}),
does site_media mean the directory in which the templ
On Sat, May 16, 2009 at 3:03 PM, simon101 wrote:
>
> Hi
>
> I am using ModelForms to create forms from the models, and using the
> clean_field and clean methods to validate the fields and form data as
> a whole. I get the self.cleaned_data[] dictionary which contains all
> the cleaned up data f
Hi
I am using ModelForms to create forms from the models, and using the
clean_field and clean methods to validate the fields and form data as
a whole. I get the self.cleaned_data[] dictionary which contains all
the cleaned up data from the html form, but it doesn't contain the id
for the objec
On May 16, 7:37 pm, newbie wrote:
> Hi,
>
> I want to display an image from static files directory in a
> template. The name of the image is stored in a variable(say image).
> When i try to display it in the template using img tag( src =
> {{ image }} ), its not displayed. Can someone he
Hi,
I want to display an image from static files directory in a
template. The name of the image is stored in a variable(say image).
When i try to display it in the template using img tag( src =
{{ image }} ), its not displayed. Can someone help me in this regard.
Thanks,
nazgi.
--~--~--
I write some code like following:
#coding=utf8
from django.shortcuts import render_to_response
from django.http import *
from django.contrib.auth.models import User
from django.
pilot error, no need to reply
On May 16, 10:41 am, adrian wrote:
> I am creating a view to edit a model that has a ManyToMany field.
> The field is defined as:
>
> performer = models.ManyToManyField(Entity, limit_choices_to=
> {'role__exact':'PER'})
>
> Entity is a table of persons or organizati
"I apologize" that is
On May 16, 3:04 pm, Joshua Russo wrote:
> Ok, apologize. I just tried it myself and MySQL did accept the alter
> table. It is certainly not an operation that I have been able to
> perform in MS SQL Server or Oracle, though I wonder if it's something
> that is changing indus
On Sat, May 16, 2009 at 11:39 AM, mickey wrote:
>
> Hi
>
> Does anyone know the fastest way I can print the template name on a
> template?
>
> Perhaps something like {% template_name %}
>
> Thanks.
> >
>
The current template name isn't in the templates context unless you
specifically pass it in.
Hi
Does anyone know the fastest way I can print the template name on a
template?
Perhaps something like {% template_name %}
Thanks.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to t
On Sat, May 16, 2009 at 12:07 PM, pradyumna wrote:
>
> I am a newbie to Django.. I am wondering why I am getting 'Caught an
> exception while rendering: 'Car' object is not iterable?
>
> As per my understanding, in the template, if statement should not be
> true and else portion should be execute
On Sat, May 16, 2009 at 11:07 AM, pradyumna wrote:
>
> I am a newbie to Django.. I am wondering why I am getting 'Caught an
> exception while rendering: 'Car' object is not iterable?
>
> As per my understanding, in the template, if statement should not be
> true and else portion should be execute
I found the answer mysel. Besides having:
SetHandler None
I also needed the same for /edia which was symlinked from: /usr/local/
lib/python2.5/site-packages/django/contrib/
So now the complete (and working) file reads:
# wms.conf
Listen 192.168.1.62:80
ServerAdmin i
I am a newbie to Django.. I am wondering why I am getting 'Caught an
exception while rendering: 'Car' object is not iterable?
As per my understanding, in the template, if statement should not be
true and else portion should be executed.
Can anybody help me on this?
View:
def v_list(
using the filebrowser outside the admin is easy: just change the
templates/stylesheets and remove the staff member decorator.
besides that, you may want to add/remove some functionality. we used
the filebrowser for a public blog-system about 2 years ago.
unfortunately, that site doesn´t exist any
Ok, apologize. I just tried it myself and MySQL did accept the alter
table. It is certainly not an operation that I have been able to
perform in MS SQL Server or Oracle, though I wonder if it's something
that is changing industry wide. MySQL seems to allow a foreign key to
any unique index.
> Thi
I am creating a view to edit a model that has a ManyToMany field.
The field is defined as:
performer = models.ManyToManyField(Entity, limit_choices_to=
{'role__exact':'PER'})
Entity is a table of persons or organizations. Some of them are
performers and some are not (distinguished by "role").
On Sat, May 16, 2009 at 12:23 AM, ozgurisil wrote:
>
> Hello all,
>
> Let's say that I have this string:
>
> s = 'Hello!'
>
> When I pass this variable to a template, I want it to be rendered as
> raw html. Looking at the docs I see that I can either use the safe
> filter:
>
> {{s|safe}}
>
> or d
On Sat, May 16, 2009 at 10:03 AM, Joshua Russo wrote:
>
> I should probably explain that better. Inside the DB foreign keys can
> only be made between a field in a child/related table to a primary key
> field. Generally the primary key fields don't change as often, though
> you can change them jus
Thanks! Works great now.
On May 15, 8:07 pm, Sam Chuparkoff wrote:
> On Fri, 2009-05-15 at 19:53 -0400, Joshua Williams wrote:
> > When trying to access a user defined profile, using get_profile, I
> > am
> > getting an error when accessing the profile for a user. Just so I
> > have my bas
I should probably explain that better. Inside the DB foreign keys can
only be made between a field in a child/related table to a primary key
field. Generally the primary key fields don't change as often, though
you can change them just like any other field it's highly
unrecommended.
If you try to
You want to link to the id field in the auth_user table. Try the
following:
from django.contrib.auth.models import User
class details(models.Model):
user = models.ForeignKey(User)
On May 16, 1:38 pm, lokeshmarema...@gmail.com wrote:
> Hi joshua,
>
> Yes, I just want to link username to deta
On Fri, May 15, 2009 at 10:07 PM, Phil wrote:
>
> Hi,
>
> I'm trying Django with MySQL and the pyodbc connector. However, it
> appears that Django can only cope with the mysqldb connector. I get a
> load of traceback ending with the error:
>
> File "C:\python26\lib\site-packages\django\db\backend
Hi joshua,
Yes, I just want to link username to details table.
Regards,
Lokesh
On May 16, 7:30 pm, Joshua Russo wrote:
> Foreign keys only point to primary key values. That's just how
> relational DBs work
>
> It looks like you just want to link details to a user. Is that
> correct?
>
> On May
Foreign keys only point to primary key values. That's just how
relational DBs work.
It looks like you just want to link details to a user. Is that
correct?
On May 16, 12:46 pm, lokeshmarema...@gmail.com wrote:
> Hi All,
>
> Is it possible to create a foreign key to a model referring to a non
>
Hi All,
Need help in creating foreign key column in a table.
In the below model I would like to create a foreign key for the field
'new_foreign_col' which should refer to 'username' column (non primary
column) from auth_user table.
class details(models.Model):
new_foreign_col =
Tha
>
> On 15 May 2009, at 23:56, MohanParthasarathy wrote:
>
> >
> > Hi,
> >
> > I am very new to django. I am following along the tutorial. But I want
> > to be able to parse the URL which has the following form:
> >
> > http://example.com/data/?ui=2&shva=1#label&name=/fetch
> >
> > From what I c
On Sat, May 16, 2009 at 8:46 AM, wrote:
>
> Hi All,
>
> Is it possible to create a foreign key to a model referring to a non
> primary column from other model.
>
> class details(models.Model):
>username =
>
> ?? -> how I can refer this field as a foreign key to username
> column
Do you want it to simply parse, or you want to add it into urlconf?
If you want to just parse - use urlparse module
http://docs.python.org/library/urlparse.html
if you want to add it into the url config - simply handle 'data/' and
the rest data you will get from GET data through request.GET
d
Hi All,
Is it possible to create a foreign key to a model referring to a non
primary column from other model.
class details(models.Model):
username =
?? -> how I can refer this field as a foreign key to username
column which is from auth_user table.
Thanks in advance.
Regards
On Sat, May 16, 2009 at 3:59 AM, Andy Mikhailenko wrote:
>
> > Any aggregation over generic relations is currently unsupported, it was
> > hoped this would make it into 1.1, but unfortunately some of the way SQL
> > works prevented this (since it requires us to change the underlying Query
> to
> >
Thanks for reply, Jim.
Hmm, just saved full page to disk. Almost the same time... now i think
it's just cost of transferring of big select box. I'll make it a bit
smaller.
Gzip will help me I think)
Thanks again.
On May 16, 4:44 pm, Jim wrote:
> > I have made a small form, only 10 fields. But
Ok I figured it out. I'm not exactly sure what the b or break command
within pdb does but it doesn't seem to work in some instances as I
described in my initial post. Does anyone know what the constraints
are to using the break command within pdb?
What does work is to import pdb in the file you w
> I have made a small form, only 10 fields. But now I see that page
> loads more than two times slower!
Is the page twice as long with string that makes up the 88-choice
field?
There is of course a cost to what you put on a page. Is the speed of
loading changed when you save the page to your f
On May 16, 6:17 am, Bobby Roberts wrote:
> I've got an application i'm writing where I need to use django-tinymce
> and filebrowser on the public side (ie not admin) of the website.
> Can someone provide me with a rundown on how to make those non-admin
> dependent
The django-tinymce part is eas
Hi, all
I have three models in many-to-many-through arrangement. Let's call
them A, B, C, where B is the join model.
I would like to edit B as inline from C, so that the number of inlines
and their pre-filled data (if possible at all) matches the number of A
objects.
If I have, say three object
Hi,
I have a model which looks like:
class Person(models.Model):
friends = models.ManyToManyField("self", through="Friendship")
class Friendship(models.Model):
person_a = models.ForeignKey(Person)
person_b = models.ForeignKey(Person, related_name="_unused_")
Now, as mentioned in:
htt
2009/5/15 Oleg Oltar :
> Hi!
>
> I am writing simple article manager application. Is there a way I can store
> pageviews number for my articles in database (want to display them in
> future, and use for rating on site)
>
> Thanks in advance,
> Oleg
>
You can use google analytics for that.
You can
2009/5/15 Joshua Russo :
>
> I'm starting the debugger like so:
>
> (from the dir containing manage.py) python -m pdb manage.py runserver
>
> it starts just fine, showing it paused at the first line. I set my
> break points using "b filename: line#". This reports that the
> breakpoint is set, and
> Any aggregation over generic relations is currently unsupported, it was
> hoped this would make it into 1.1, but unfortunately some of the way SQL
> works prevented this (since it requires us to change the underlying Query to
> allow support for additional conditions on a join clause).
Alex, th
Hello
I have several views that pass same info into templates. If i want to
change information that gets passed into template then i have to
change several views to get system up to date and this is not good.
Its common sense to replace them with one function instead.
Where and how should i writ
Hello all!
First of all sorry for my bad english:)
I have made a small form, only 10 fields. But now I see that page
loads more than two times slower!
I found problem in this field:
age = forms.ChoiceField(required=True, choices=AGE_CHOICES,
initial='18')
without this field page loads much fast
74 matches
Mail list logo