On wo, 2010-08-25 at 21:49 -0700, Joe Z wrote:
> Is it possible to add 'publisher' into search_fields so that in admin
> page books showed can be narrow down by a specific publisher? I tried
> it but got the following exception:
Not as such, but you can add publisher__name (assuming publisher has
On http://www.djangobook.com/en/2.0/chapter06/
in models.py:
class Book(models.Model):
title = models.CharField(max_length=100)
authors = models.ManyToManyField(Author)
publisher = models.ForeignKey(Publisher)
publication_date = models.DateField()
def __unicode__(self):
i don't know how to del the html lable the red part, but must save
" 1".
1
0
after js running, change the html to display by " 1"
--
cowboy
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-u
On 25 August 2010 20:09, Reinout van Rees wrote:
> Hi all,
>
> I normally deploy everything on linux, but a customer requires windows. I
> have a working setup with apache and mod_wsgi, but I wonder about the
> efficiency.
>
> I see hints like "mod_wsgi, daemon mode" including "but that doesn't w
On 8/25/2010 8:26 PM, Goran wrote:
> I need another verbose_name_plural for Flat pages so i need to
> override class meta for it right? How can I do that?
>
[Caveat: this is a guess from general Python knowledge]
Have you tried creating a subclass of Flatpage, whose body simply
declares a Meta cl
Great answers, thanks! I'd like to complement this thread remembering
the importance of overriding the save method to save just the desired
fields and in this way, avoiding Django to validate read-only fields.
Rodrigo Nicola
Twitter: http://www.twitter.com/rodnic
On Wed, Aug 25, 2010 at 5:29 A
On 8/25/2010 10:00 PM, Yo-Yo Ma wrote:
> I'm wanting to build out a list template that can display any list of
> objects in this manor (pseudo code:
>
> {% for thing in things %}
>
> {{ thing.foo }}
> {{ thing.bar }}
> {{ thing.spam }}
> {{ thing.eggs }}
>
> {% endfor %}
>
> The
I'm wanting to build out a list template that can display any list of
objects in this manor (pseudo code:
{% for thing in things %}
{{ thing.foo }}
{{ thing.bar }}
{{ thing.spam }}
{{ thing.eggs }}
{% endfor %}
The problem is, of course, that I want to list more than just "thing
I need another verbose_name_plural for Flat pages so i need to
override class meta for it right? How can I do that?
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscrib
I'm curious too about both questions.
The only answer I got at one point was to capture email and not username on
registration, and then set username to the email either in the view (which I
believe you'd have to do before the registration signal gets sent???)
I haven't implemented it yet.
J
On
Curious. Is the reason for the lack of reply due to no one using
google app engine GAE? Thanks
On Aug 24, 4:13 pm, nobosh wrote:
> Hello, I just got my first app up:http://hellman470.appspot.com/
>
> I'm now trying to learn how to change the authentication model to
> support email/password, elimi
Hi Guys
I switched on the debug toolbar in order to see what sql queires are
being executed for each request.
I Noticed that the auth_user table is queried once and the
auth_message table is queried once for each request.
This is two queries per request when the user is authenticated with
the app
On 25 août, 18:30, Andrea Imparato wrote:
> Hello all,
>
> is possible to do in templates double for like in C:
>
> for(int i = 0, int j = 0; i<0 && j<0;i++,j++) ?
What's your use case exactly ?
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
Hi folks,
this posting sort of refers to my previous problem from last week as
I'm still working on the birdwatcher's site. I cannot wrap my head
around how to create intelligent navigation links from the current
context or http request. For instance, if the user enters via the url
/de/observers/
AHA!
I've been bitten by that one before. I was fooled by the dash in the
way it's named elsewhere.
Thanks so much Piotr, looks like that was the problem, and I learned
something about the naming of modules.
Seems to be behaving now,
Wendy
On Aug 25, 11:18 am, Piotr Kilczuk wrote:
> > Installed
it was simple:
locations = Location.objects.filter(category=category.id,
status=2).extra(
select={'image': 'SELECT locations_images.image FROM
locations_images WHERE locations_images.location_id =
locations_location.id ORDER BY locations_images.order ASC LIMIT 1'
},
).only('nam
On 08/25/2010 05:51 PM, Xavier Ordoquy wrote:
Hi,
You may have several django versions in your path.
The settings under apears to be django 1.1
In your project, try:
$ python manage.py shell
import django
print django.__file__
print django.VERSION
Yeah, and also do an "import sys" followed by
I think I found the problem; for the record, I wanted text__exact, not
text__equals.
On Wed, Aug 25, 2010 at 1:27 PM, Christos Jonathan Hayward <
christos.jonathan.hayw...@gmail.com> wrote:
> I am trying to get a many-to-many tagging setup working, and I am getting
> an error which may or may not
Thank you so very much. It works like a clock!
I use urlencode to to convert the complete URL hash into a key, that's just
logical.
I wrap set and get. A total of 10 lines of extra code isn't bad, of course
the simple
use of decorator would be even nicer!
Piotr Zalewa-2 wrote:
>
> In such ca
I am trying to get a many-to-many tagging setup working, and I am getting an
error which may or may not be an issue with many-to-many specifically. An
Entity has a many-to-many field to Tag models; a Tag model only has one
(declared) field, text, a TextField. My code:
tag = directory.models.Tag.ob
> Installed /Library/Python/2.6/site-packages/django_sorting-0.1-
> py2.6.egg
> Processing dependencies for django-sorting
> (just specifying 'django-sorting', in installed apps in settings file)
Are you sure it should be 'django-sorting' not 'django_sorting' (with
underscore)?
- is a minus in py
Hi to all django users,
i just completed a project in which I used the extra() database API
function in order to save the number of query used. Unfortunately the
production server doesn't use Postgres but MySQL.
I don't know why but I'm not making it to convert the query so it's
compatible with M
On 8/25/2010 12:30 PM, Andrea Imparato wrote:
> Hello all,
>
> is possible to do in templates double for like in C:
>
> for(int i = 0, int j = 0; i<0 && j<0;i++,j++) ?
>
No.
>
> I can't find nothing interesting in the docs :(
>
Try to avoid thinking of the template language as a programming
la
Hello,
I'm trying to install django-sorting
http://github.com/directeur/django-sorting
Installed using setup tools:
...
Processing django-sorting-0.1.tar.gz
Running django-sorting-0.1/setup.py -q bdist_egg --dist-dir
/tmp/easy_install-OLu5Yy/django-sorting-0.1/egg-dist-tmp-bww4RH
Adding django-sor
Hello all,
is possible to do in templates double for like in C:
for(int i = 0, int j = 0; i<0 && j<0;i++,j++) ?
I can't find nothing interesting in the docs :(
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email
Hi.
I had such a problem lately and it turned out to be caused by using
older template, from django 1.1, which didn't get deleted during
upgrade.
Hope it helps.
Cheers
On 25 Sie, 14:36, Jonas Geiregat wrote:
> I'm using django-1.2.1 on Mac OS X.
>
> I'm trying out the comments framework that come
Hi.
Try putting your (r'^static/(?P.*)$',
'django.views.static.serve', {'document_root': 'static'}), line of
urlconf in if clause.
It works for me.
This way you avoid confusion between your server and your django
urlconf.
The full solution requires you to import settings. The code should
look somet
Hi,
You may have several django versions in your path.
The settings under apears to be django 1.1
In your project, try:
$ python manage.py shell
>>> import django
>>> print django.__file__
>>> print django.VERSION
Regards,
Xavier.
Le 25 août 2010 à 17:41, Robbington a écrit :
> I'm using Sqlite
I'm using Sqlite
DATABASE_ENGINE = 'sqlite3' # 'postgresql_psycopg2',
'postgresql', 'mysql', 'sqlite3' or 'oracle'.
DATABASE_NAME = '/var/www/django/robproject/rbdata.db' #
Or path to database file if using sqlite3.
DATABASE_USER = '' # Not used with sqlite3.
DATA
On 08/25/2010 05:03 PM, Robbington wrote:
I've been using Django for about a month now, with no real problem on
my linode vps with ubuntu. For some reason now everytime I start a new
project I cant sync the database. I get a "Need to fill in the
database name' message even though it clearly fill
On Wed, Aug 25, 2010 at 10:21 PM, Waldemar Kornewald
wrote:
> On Wed, Aug 25, 2010 at 2:36 PM, Russell Keith-Magee
> wrote:
>> On Wed, Aug 25, 2010 at 4:00 PM, Waldemar Kornewald
>> wrote:
>>> As Alex' MongoDB backend demonstrates, all nonrel backends can
>>> retrieve the Query's filters.
>>
>>
Hi all,
I've been using Django for about a month now, with no real problem on
my linode vps with ubuntu. For some reason now everytime I start a new
project I cant sync the database. I get a "Need to fill in the
database name' message even though it clearly filled in. Even if I can
get past that b
Thanks for the response, Steve. After checking with our systems admin it
looks like the files were missing from the media directory on the apache
root path. I copied them over and it's working now. I was check for the
files in the django source folders.
On Wed, Aug 25, 2010 at 9:23 AM, Steve Holde
On 8/25/2010 9:54 AM, Nick wrote:
> Stranger still, I can get to the /media/js/admin/
> RelatedObjectLookups.js but not the jquery library
>
>
> On Aug 24, 4:51 pm, Nick wrote:
>> I have a model set up to use collapsable inlines but for some reason
>> the path to my js files is acting very stran
On Wed, Aug 25, 2010 at 2:36 PM, Russell Keith-Magee
wrote:
> On Wed, Aug 25, 2010 at 4:00 PM, Waldemar Kornewald
> wrote:
>> As Alex' MongoDB backend demonstrates, all nonrel backends can
>> retrieve the Query's filters.
>
> No - Alex's MongoDB backend demonstrates that the basic query
> require
Hello,
Le 25/08/2010 09:37, Andy a écrit :
I'd like to detect the location of each user and then set the default
language and location for him accordingly. The homepage would also be
tailored to each location (country and city).
Can anyone share information on how to do that with Django?
You
Stranger still, I can get to the /media/js/admin/
RelatedObjectLookups.js but not the jquery library
On Aug 24, 4:51 pm, Nick wrote:
> I have a model set up to use collapsable inlines but for some reason
> the path to my js files is acting very strange.
>
> I can find the core.js athttp://mysite
If you're interested in something _much_ nicer than phpMyAdmin and
you're on OS X, check out Querious or Sequel Pro. I've found Django
development about 25% more enjoyable since switching from browser-
based software to desktop software for database management (both local
and remote).
David
On A
On Aug 24, 3:36 pm, Rodney Topor wrote:
> OK, it seems I misunderstood the purpose of this page. I still think
> some of the code is misleading, but I accept that the examples is
> intended to be indicative rather than descriptive, and that it would
> indeed take much more space to describe how t
It's also possible to inspect `request.META['HTTP_ACCEPT_LANGUAGE']`,
although while building an English/Chinese site recently I found this
somewhat unreliable. In the end I decided to use it as a default so
that at least some of the Chinese visitors will see the content in
Chinese right away; thos
Make sure that 'django.middleware.csrf.CsrfViewMiddleware' is listed
in your MIDDLEWARE_CLASSES. There's useful info about the things that
need to be in place in order for Django's CSRF protection to work at
http://docs.djangoproject.com/en/dev/ref/contrib/csrf/.
David
On Aug 26, 12:36 am, Jonas
Hi,
I'm having a mental block this afternoon and am completely stuck on
filtering on a many-to-many relationship and was wondering if anyone
can.
I have two models
class Model1(models.Model):
name = models.CharField(max_length=200)
duration = models.TimeField()
class Model2(models.M
I would caution that what you are doing may make maintenance difficult
later. You may want to evaluate using whether creating the table in the
template is more appropriate.
-- Casey
On 08/25/2010 09:21 AM, Tim Sawyer wrote:
On 25/08/10 13:36, mdolphin wrote:
OK, that's probably a Newbee Que
Use the "safe" filter to disable the auto-escaping that templates
apply to all variables:
http://docs.djangoproject.com/en/1.2/ref/templates/builtins/#safe
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to djan
On 25/08/10 13:36, mdolphin wrote:
OK, that's probably a Newbee Question:
My Code generates an HTML-Table, that I want to show up inside a {%
block %} in my Template. All I get is an encoded output of my
generated HTML-Sourcecode inside the Template. so i.e becomes
and so on. How could I a
I'm using django-1.2.1 on Mac OS X.
I'm trying out the comments framework that comes with django by default.
I'm able to {% load comments %} and {% render_comment_list for post %} and
{% render_comment_form for post %} .
But when I try to post a message I get a 403 error:
"""
CSRF veri
OK, that's probably a Newbee Question:
My Code generates an HTML-Table, that I want to show up inside a {%
block %} in my Template. All I get is an encoded output of my
generated HTML-Sourcecode inside the Template. so i.e becomes
and so on. How could I achieve it to get my generated HTML-
C
hello,
i've a problem extending the TimeFormat class (used by "time" template
filter).
basically, i need a new method:
def F(self):
if self.date.minute == 0:
return self.G()
return u'%s:%s' % (self.G(), self.i())
very similar to the original one except for a G()
On Wed, Aug 25, 2010 at 4:00 PM, Waldemar Kornewald
wrote:
> On Wed, Aug 25, 2010 at 2:04 AM, Russell Keith-Magee
> wrote:
>> Firstly -- Nobody has ever committed to getting Alex's query-refactor
>> branch merged in for Django 1.3. In fact, I'm on record in at least
>> one forum (DC.eu) saying "A
On 08/25/2010 02:23 PM, Jirka Vejrazka wrote:
I think that might be the case... I do extract parameters from GET.
Am I out of luck?
Well, nothing can stop your from doing the caching manually so you can
tune it exactlly to your needs. It's actually not that difficult:
from django.core.cache i
In such case it would better to not cache entire method, but simply
the data - build the unique key per GET requests, check if the data is
already stored in cache, if so - use it, else - retrieve it from
database and store it in cache.
from django.core.cache import cache
def someview(req):
On 08/25/2010 02:19 PM, Sam Walters wrote:
I would need the answer evaluated as quickly as possible, radius
calculation would be slower (how much slower depends on the algorithm
used and other variables).
One of my colleagues tells me the database-internal (so:
postgresql+postgis and so) calcu
> I think that might be the case... I do extract parameters from GET.
>
> Am I out of luck?
Well, nothing can stop your from doing the caching manually so you can
tune it exactlly to your needs. It's actually not that difficult:
from django.core.cache import cache
def my_view(request):
# som
Unless most of your users will be on location-enabled mobile devices,
automatic location detection is usually IP-based, so you'd need to
find either a database or a service with an API to do lookups.
On Aug 25, 3:37 am, Andy wrote:
> I'd like to detect the location of each user and then set the d
Thanks for the replies.
No its not 32 bit/64 bit issue. (both 64 bit and its not a floating
point issue anyway)
Correct: I dont need to *have* the problem except some of the
requirements in the project require passing of 8 decimal place
lat/longs in the url.
I was hoping not to have to take steps
Hello --
I think that might be the case... I do extract parameters from GET.
Am I out of luck?
Jirka Vejrazka wrote:
>
>> Is your AJAX query POST or GET query? Because as you may know, POST
>> queries
>> are not cached, GET queries are.
>
>
> Also, GET requests are not cached in some cas
Thanks much!
a) I'm using GET
b) In current set of queries, JSON data size is quite moderate
PS. I am considering tweaking the links I sent to the AJAX app such that
when possible, it accesses cache file space on the server as a directory,
statically, bypassing Django. That's fast. The set of U
Add your python directory to your PATH
Control Panel/System/Advanced/Environment Variables
You'll need to restart your DOS box to pick up the new PATH. Type SET
in the DOS box to see the values.
Tim.
On 25/08/10 09:21, yotta wrote:
Hi
i am new on Djagon and i was fellowing the tutorial (pa
> Is your AJAX query POST or GET query? Because as you may know, POST queries
> are not cached, GET queries are.
Also, GET requests are not cached in some cases (e.g. when GET
parameters are used) - it's really difficult to figure out what's
wrong without knowing specific details.
Cheers
On 08/25/2010 10:21 AM, yotta wrote:
Hi
i am new on Djagon and i was fellowing the tutorial (part1); but i had
some trouble to execute this command "python manage.py syncdb" and i
got error message like what the command python is not recognized as an
internal command.
the 'mysite' directory is in
Is your AJAX query POST or GET query? Because as you may know, POST queries
are not cached, GET queries are.
Note that if you're still using large pieces of JSON data, upstream caches are
not used (data is always sent from Django) which makes some extra load on
Django app.
> Thanks for you rep
Is one server 32 bit, while the other is 64 bit? It may be that on the old
server, your representations of the number were precise enough to be identical,
but on the new server, there is enough precision in the database to represent
different numbers.
"Reinout van Rees" wrote:
>On 08/25/20
Im using the django-admin (django 1.1.1, Python 2.5.2, postgresql
8.3).
I got a GenericInline Text with some classes and with some instances,
the admin duplicates the entry thus making it impossible to save with
error message "duplicate data for id "
--
You received this message because you are
Hi
i am new on Djagon and i was fellowing the tutorial (part1); but i had
some trouble to execute this command "python manage.py syncdb" and i
got error message like what the command python is not recognized as an
internal command.
the 'mysite' directory is inside the django-121 directory and my
py
Thanks for you reply. I'm away from my coding machine, so I'll just answer a
part of your question --
When I use the cache decorator in a view, I expect that as long as cache is
valid, the code in the view
does not get executed. And that's what I see when rendering a template with
some little con
> Hello,
>
> I'm trying to use native caching in Django as per
> http://docs.djangoproject.com/en/dev/topics/cache/
>
> I followed the setup procedure to the tee (it's not hard, of course). What
> I observe is that my app caches only views that deliver HTML. Since my
> application is heavily AJAX
Sort of -- with AJAX (meaning I just serve JSON) I don't
use RequestContext at all. Just HttpResponse(jsonData), which
works fine for my purposes.
It's really puzzling though why context request should affect
caching. It's a shame I can't use it.
Reinout van Rees wrote:
>
> On 08/24/2010 11:1
On 08/25/2010 02:57 AM, Sam Walters wrote:
Hi fellow Django developers
I have Lat/Lng points stored in my db:
class Airfield(models.Model):
point = models.PointField(srid=4326)
I noticed when i query on my development server with postgresql i DONT
have to have the EXACT number of decimal
On 08/24/2010 11:15 PM, buddhasystem wrote:
I'm trying to use native caching in Django as per
http://docs.djangoproject.com/en/dev/topics/cache/
I followed the setup procedure to the tee (it's not hard, of course). What I
observe is that my app caches only views that deliver HTML. Since my
appl
Hi all,
I normally deploy everything on linux, but a customer requires windows.
I have a working setup with apache and mod_wsgi, but I wonder about
the efficiency.
I see hints like "mod_wsgi, daemon mode" including "but that doesn't
work on windows". Similarly with other apache settings li
If you want to understand why you are getting the error, start by
understanding Python modules -
http://docs.python.org/tutorial/modules.html
Hint - you can't just copy a script around and expect it to work. The
script depends on other files to make it all happen.
If in python, you type,
import
You could use a widget
http://stackoverflow.com/questions/1827526/django-creating-a-form-field-thats-read-only-using-widgets
Best regards,
Sævar
On Aug 24, 7:02 pm, Rodrigo Lombardo wrote:
> Hi,
>
> I'm new to Django and I'm learning a lot reading the docs and some books.
> I'm trying to genera
on ModelAdmin there is read only fields
http://docs.djangoproject.com/en/dev/ref/contrib/admin/#django.contrib.admin.ModelAdmin.readonly_fields
On 24 August 2010 20:02, Rodrigo Lombardo wrote:
> Hi,
>
> I'm new to Django and I'm learning a lot reading the docs and some books.
> I'm trying to gen
I am not able to run django under windows7
python django-admin.py #is recognized if i paste it to c:/first/
Python26 together with python executable.
I am getting error: No module named django.core
File "django-admin.py", line2, in
from django.core import management
It seems the command line
On Wed, Aug 25, 2010 at 2:04 AM, Russell Keith-Magee
wrote:
> On Wed, Aug 25, 2010 at 3:57 AM, Waldemar Kornewald
> wrote:
>> On Aug 24, 9:30 pm, mack the finger wrote:
>>> I'm considering starting a project, and am leaning towards using
>>> google app engine instead of the traditional LAMP stac
I'd like to detect the location of each user and then set the default
language and location for him accordingly. The homepage would also be
tailored to each location (country and city).
Can anyone share information on how to do that with Django?
--
You received this message because you are subsc
76 matches
Mail list logo