Template questione

2006-06-15 Thread Hugo Wetterberg
Hi All, I was trying to output formatted dates in my template with {{ entry.strftime("%A, %B %d") }} ...where entry is a datetime object. But I got an error where Django said: "Could not parse the remainder: ("%A, %B %d") Now I'm forced to send entry as a ready-formatted string from view, which

Re: Guidance would be most welcome

2006-06-15 Thread Carlos Yoder
Hey there Paul. I'm working with a price comparison website, and we have a similar system going on. You see, products have 1+ prices, stored in a prices table. We get prices daily from dealers, and handle historical prices in a different table, just like Waylan said. The prices_hist table holds t

how can I find my admin css back in apache?

2006-06-15 Thread wgwigw
hi, I ported my web to apache, it works, but the admin site couldn't find the css template now. how can I find it back. the django office site said "2. Or, copy the admin media files so that they live within your Apache document root." but after I copied it to my htdocs, "C:\Program Files\Apache G

Re: Template questione

2006-06-15 Thread Malcolm Tredinnick
On Thu, 2006-06-15 at 00:19 -0700, Hugo Wetterberg wrote: > Hi All, > I was trying to output formatted dates in my template with > {{ entry.strftime("%A, %B %d") }} > > ...where entry is a datetime object. But I got an error where Django > said: > "Could not parse the remainder: ("%A, %B %d") >

Re: how can I find my admin css back in apache?

2006-06-15 Thread [EMAIL PROTECTED]
if your media url is like this:www.mysite.com/media and u put your media file in c:\mysite\media, then u can configure like this: Alias /media c:\mysite\media SetHandler None [EMAIL PROTECTED] 写道: > hi, I ported my web to apache, it works, but the admin site couldn't > find the css templa

Re: how can I find my admin css back in apache?

2006-06-15 Thread wgwigw
sorry, it couldn't work:(. my httpd.conf: SetHandler python-program PythonHandler django.core.handlers.modpython SetEnv DJANGO_SETTINGS_MODULE hotel.settings Alias /media C:\django\django\contrib\admin\media SetHandler None any mistake here? --~--~-~--~~

Feasibility of postgis fields?

2006-06-15 Thread nick
Hi - as a person investigating django for managing metadata that will also have a spatial/gis component (lat/lon bounding boxes), would the reccommended approach be to create a new field for use in my models? Admittedly this would be specific to the postgres+postgis backend. I'd be looking to imp

Re: how can I find my admin css back in apache?

2006-06-15 Thread wgwigw
hi, thanks, it works now:) modify like this: Alias /media C:\django\django\contrib\admin\media SetHandler None --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send

Re: Using DB module(s) in another app (twisted)

2006-06-15 Thread Steven Armstrong
On 06/15/06 04:01, Jos Yule wrote: > Ok, here is what i had to do to get it to work: > > In a 'test.py' file: > > -- > from django.conf import settings > import settings as mysettings > > settings.configure(mysettings) > > from django import db > >

Re: Feasibility of postgis fields?

2006-06-15 Thread Jeroen Ruigrok van der Werven
Hi Nick, On 6/15/06, nick <[EMAIL PROTECTED]> wrote: > Hi - as a person investigating django for managing metadata that will > also have a spatial/gis component (lat/lon bounding boxes), would the > reccommended approach be to create a new field for use in my models? > Admittedly this would be sp

Re: Guidance would be most welcome

2006-06-15 Thread GrumpySimon
Why bother shuffling data between tables? I've got a wiki app I've been working on (slowly - hoping to release soon!), and I add a revision field ( IntegerField ), and just add a new entry with revision+1. The latest version has the latest revision number. Easy :-) Then it's just a matter of som

Re: Template questione

2006-06-15 Thread Hugo Wetterberg
Thank you. That's a beautiful solution, really puts an end to the evil code in templates. /Hugo --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-user

Re: going crazy: foreignkey-reverse-lookup: tests work,my code fails

2006-06-15 Thread Gábor Farkas
James Bennett wrote: > On 6/14/06, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: >> Yeah, sorry about that. We really need to fix this. :-( >> >> But it's not entirely trivial from what I remember last time I dived in >> there. > > Better to let Guido and company fix relative imports in Python, >

why django has no api reference?

2006-06-15 Thread Roger Sun
Just like ruby's http://api.rubyonrails.org/ currently, i don't know where can i refer to these api, i hope the author can do this for us. ^_^ roger -- welcome: http://www.webwork.cn --~--~-~--~~~---~--~~ You received this message because you are subscribed to

Re: why django has no api reference?

2006-06-15 Thread Jeroen Ruigrok van der Werven
On 6/15/06, Roger Sun <[EMAIL PROTECTED]> wrote: > Just like ruby's > http://api.rubyonrails.org/ > > currently, i don't know where can i refer to these api, > i hope the author can do this for us. ^_^ I am currently writing/working on expanding the documentation that's available, I'll take this

Re: why django has no api reference?

2006-06-15 Thread Steven Armstrong
On 06/15/06 13:53, Roger Sun wrote: > Just like ruby's > http://api.rubyonrails.org/ > > currently, i don't know where can i refer to these api, > i hope the author can do this for us. ^_^ > > roger > There's an unofficial api reference under [1] [1] http://djangoapi.quamquam.org/trunk/ --~-

Re: why django has no api reference?

2006-06-15 Thread Jeroen Ruigrok van der Werven
On 6/15/06, Steven Armstrong <[EMAIL PROTECTED]> wrote: > [1] http://djangoapi.quamquam.org/trunk/ Ah cute. Now that might be useful to also have on the main site. Adrian? :D -- Jeroen Ruigrok van der Werven --~--~-~--~~~---~--~~ You received this message becaus

Re: why django has no api reference?

2006-06-15 Thread Roger Sun
exciting news, thanks , Jeroen and Steven. On 6/15/06, Jeroen Ruigrok van der Werven <[EMAIL PROTECTED]> wrote: > > On 6/15/06, Steven Armstrong <[EMAIL PROTECTED]> wrote: > > [1] http://djangoapi.quamquam.org/trunk/ > > Ah cute. Now that might be useful to also have on the main site. > Adrian?

Re: Using DB module(s) in another app (twisted)

2006-06-15 Thread Jos Yule
I haven't plugged any of this into a twisted app yet, so i don't know. I suppose i could put the db stuff into one of the threading defereds to avoid that kind of blocking... Good catch, i need to figure that out. :\ --~--~-~--~~~---~--~~ You received this messag

Re: Using DB module(s) in another app (twisted)

2006-06-15 Thread Steven Armstrong
On 06/15/06 14:59, Jos Yule wrote: > I haven't plugged any of this into a twisted app yet, so i don't know. I'ld be very interested to here how it's going once you get there. > I suppose i could put the db stuff into one of the threading defereds > to avoid that kind of blocking... > That's ex

Re: Using DB module(s) in another app (twisted)

2006-06-15 Thread Jos Yule
I'm starting to wonder if it might be a better idea to somehow do a formal "sync" between app DBs every X minutes, rather then going though the pain of worring about the threading stuff? There isn't _that_ much that is shared between the two DBs currenly, and it might make more sense to have the t

problem with related foreignkey in model

2006-06-15 Thread Antonello Cicchese
Hi everyone, I'm Antonello and I am new to django. I'm trying to write my very first serious app, so now all the problems are coming out. I have a model with two fields like these state =models.ForeignKey(State) city = models.ForeignKey(City) where State is class State(models.Model): nam

Re: Feasibility of postgis fields?

2006-06-15 Thread Adrian Holovaty
On 6/15/06, nick <[EMAIL PROTECTED]> wrote: > Hi - as a person investigating django for managing metadata that will > also have a spatial/gis component (lat/lon bounding boxes), would the > reccommended approach be to create a new field for use in my models? > Admittedly this would be specific to

Re: Enforcing relationships in the Admin

2006-06-15 Thread [EMAIL PROTECTED]
All, I have modified the original example model based on your suggestions, and I feel like I'm another step closer to what I'm trying to accomplish. Thanks for the suggestions! However, one issue that I have with the current solution is scalability. Because there will be thousands of possible

Re: problem with related foreignkey in model

2006-06-15 Thread [EMAIL PROTECTED]
Antonello, I'm trying to achieve the same thing, look at my post here: http://groups.google.com/group/django-users/browse_thread/thread/f126415daa0461c4 Once we figure this out (if we do), I will post the solution to the cookbook. --Nick --~--~-~--~~~---~--~--

Re: M-R / ImageField / file upload / custom manipulator

2006-06-15 Thread [EMAIL PROTECTED]
Hello. I'm wondering if you've found a solution to this or if anyone else knows what the problem might be. I'm having the same problem as you, and my code is nearly identical. Thanks, Julia --~--~-~--~~~---~--~~ You received this message because you are subscri

Re: why django has no api reference?

2006-06-15 Thread [EMAIL PROTECTED]
That is awsome, I wish it were on the main website! Please reference the following Trac entry :) http://code.djangoproject.com/ticket/1248 --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To p

How run django under python 2.4 when python 2.2 is the system default

2006-06-15 Thread mamcxyz
Ok, I have CentOs 3. When I run python: >>Python 2.2.3 (#1, Mar 9 2006, 18:16:14) I install python 2.4 and can acces it with python2.4 >>Python 2.4 (#1, Jun 14 2006, 22:23:14) Now... I'm lost. >From the info I read about CentOs 3 (why CentOS 3? Because that is the provided plataform from our

Re: How run django under python 2.4 when python 2.2 is the system default

2006-06-15 Thread Jeremy Dunck
On 6/15/06, mamcxyz <[EMAIL PROTECTED]> wrote: > How run django under this version of Linux? I install lighttpd > sucesfully. I have subversion, python 2.4, CentOS 3.7... > python2.4 manage.py runserver ? Or you mean for configuration under Apache? --~--~-~--~~~---~-

Re: The only click to add any class

2006-06-15 Thread Grigory Fateyev
Hello Malcolm Tredinnick! On Thu, 15 Jun 2006 12:51:33 +1000 you wrote: > > On Tue, 2006-06-13 at 16:56 +0400, Grigory Fateyev wrote: > Create your form to collect the data you need. Make the submit button > on that form send you to a view method to handle the submission as per > normal (see [1]

Many-to-many relationships via an intermediary table

2006-06-15 Thread [EMAIL PROTECTED]
Hi, I have a News model with a field in it called Topic: topic = model.ManyToManyField(Topic) Now I would like to add a Sequence field to the intermediary table and as it has been suggested, I should delete the ManyToMany field from the News model and create the intermediery table by hand. class

OneToMany and filters

2006-06-15 Thread mathias
Hi, Here's my problem: I have two models: Ticket and Content, a ticket can have several content, so the ticket object contains the key to a ticket. So I have a OneToMany relationship between the two. I have a search page to search for tickets, what I want to do is retrieve all the tickets that h

Re: How run django under python 2.4 when python 2.2 is the system default

2006-06-15 Thread mamcxyz
No, for use under lighttpd only --~--~-~--~~~---~--~~ 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

Re: Foreign keys and applications

2006-06-15 Thread Luke Plant
On Wednesday 14 June 2006 12:20, Viktor wrote: > I have two applications in my project: > ... > But when in my views I try to do: > > c1 = Cls1.objects.get(pk=1) > clss = c1.cls2_set.all() > > I get: > > 'Cls1' object has no attribute 'cls2_set' This is because your models are in different apps.

Re: The only click to add any class

2006-06-15 Thread Jorge Gajon
> And when I save form, got this error: > Invalid value: 'region' should be a 'serp2.apps.common.models.Region'> instance, not a Request The hint is in the error message. You must pass a Region object to the region parameter, new_data['region'] contains only the id that the user selected from t

Re: OneToMany and filters

2006-06-15 Thread Ivan Sagalaev
mathias wrote: > In my view I can retrieve all the tickets: > tickets = Ticket.objects.all() > I can also retrieve the content that matches my search: > contents = Content.object.filter(body__icontains='bla') > > But I can't figure out how to retrieve a QuerySet with all the tickets > from the con

Re: No such column error + tag question

2006-06-15 Thread Luke Plant
On Wednesday 14 June 2006 16:41, Guillermo Fernandez Castellanos wrote: > I've been developping a link model (see at the end of the post, kind > of personal delicious) , and when I try to use the admin interface to > add a url, I obtain the following error: > Request Method: GET > Request U

Re: problem with related foreignkey in model

2006-06-15 Thread Luke Plant
On Thursday 15 June 2006 15:12, Antonello Cicchese wrote: > now the problem is that in my admin i want to display in the city > field only cities related to the previously selected state, how can i > do this? Hacking this in server side will be difficult. My approach would be to use the 'js' A

Re: London/UK Django developer wanted

2006-06-15 Thread Gonzalo
Thanks for the pointers Frankie I know about the DevelopersForHire page I also know the Django community and potentially interested parties is much larger than those listed there, I tried my chances to reach a wider audience. Jacob indeed judging the response this is a good place to post a job .

Re: howto Django + lighttpd + Windows?

2006-06-15 Thread Waylan Limberg
On 6/14/06, Jay Parlar <[EMAIL PROTECTED]> wrote: > > On 6/14/06, mamcxyz <[EMAIL PROTECTED]> wrote: > > > > Yes I know... is for that I try the install onto windows. > > > > Is rare, why then RoR can be installed with lighttp on windows? > > I think they might use Cygwin to do it. Nothing stoppin

Re: Directing URL's to Load Django Projects

2006-06-15 Thread Waylan Limberg
On 6/14/06, Scott McCracken <[EMAIL PROTECTED]> wrote: > > My question is, how do I get www.mydomain.com to point to my Django > files properly - in other words how can I get www.mydomain.com load the > same homepage I get when I go to django.mydomain.com? > Put the .htaccess file and the django.f

Re: Root URI in templates

2006-06-15 Thread Waylan Limberg
On 6/14/06, plungerman <[EMAIL PROTECTED]> wrote: > that is precisely what i would like to do. how you access a > variable defined in settings.py from a template tho? i have > not been able to track this bit down. > James Bennett recently posted an excellent article on this very subject which o

Re: Guidance would be most welcome

2006-06-15 Thread Waylan Limberg
On 6/13/06, Paul Childs <[EMAIL PROTECTED]> wrote: > > Of course it would be nice just to call the save() and delete() methods > and everything would behave as listed in my first post. > This is one of the Summer of Code projects in the works. You can read about it and offer some input on the dev-

Re: going crazy: foreignkey-reverse-lookup: tests work,my code fails

2006-06-15 Thread Curtis
I think this may be the same problem that is documented in http://code.djangoproject.com/ticket/1796 Obviously, making sure that you for e.g. import from 'myproj' is the right way, but I did submit a patch for management.py that seems to fix the problem (while not really addressing the root cause

Check this out. www.1020.org for sale. very rare numeric domain and can be resold for a higher amount. Easy to remember - TEN TWENTY .ORG.

2006-06-15 Thread prince
Check this out. www.1020.org for sale. very rare numeric domain and can be resold for a higher amount. Easy to remember - TEN TWENTY .ORG. Check the stats - At this time, pure numeric domain websites occupied some of the top Alexa global rankings. www.163.com at #13 (ahead of Microsoft and AOL), w

Re: How run django under python 2.4 when python 2.2 is the system default

2006-06-15 Thread Waylan Limberg
On 6/15/06, mamcxyz <[EMAIL PROTECTED]> wrote: > > No, for use under lighttpd only > Well, if your using lightttpd, then you are calling django from a fcgi script. The first line (the shebang) of that script should tell the system which interpreter to use. Probably looks something like this;

Re: How run django under python 2.4 when python 2.2 is the system default

2006-06-15 Thread Jeremy Dunck
On 6/15/06, Waylan Limberg <[EMAIL PROTECTED]> wrote: > Just change the path to point to your install of python2.4. Perhaps > > #!/usr/bin/python24 Off-topic now, but if you're venturing into *nix land, this is the best book for a newbie, I think: Unix Power Tools, 3rd Edition http://www.ama

Re: No such column error + tag question

2006-06-15 Thread Guillermo Fernandez Castellanos
Hi, Thanks for the answer. > > It is really curious because the table seems to exist. > Does the column exist too? Mmm... I'm afraid I do not really get the difference between the two... Let's say that I've checked the tables with sqlite3 (.table and .schema) and that I'm able to enter data into

Custom template tags not loading

2006-06-15 Thread Corey
Hi All! I've written a custom template tag, but I get the error: 'reservationtags' is not a valid tag library: Could not load template library from django.templatetags.reservationtags, No module named reservationtags I've looked in the archives and have tried everything I know so far: 1. templa

Re: Custom template tags not loading

2006-06-15 Thread [EMAIL PROTECTED]
make sure your application exists in the project's settings file INSTALLED_APPS --~--~-~--~~~---~--~~ 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.co

Re: Custom template tags not loading

2006-06-15 Thread Don Arbow
On Jun 15, 2006, at 2:05 PM, Corey wrote: > > Hi All! > > I've written a custom template tag, but I get the error: > 'reservationtags' is not a valid tag library: Could not load template > library from django.templatetags.reservationtags, No module named > reservationtags > > I've looked in the a

Mutually referential many-to-one relationships, Erros with current Trunk?

2006-06-15 Thread [EMAIL PROTECTED]
All, I have tried this ( http://www.djangoproject.com/documentation/models/mutually_referential/) with the current trunk and get the following errors: Traceback (most recent call last): File "/usr/lib/python2.4/site-packages/django/core/handlers/base.py" in get_response 74. response = callba

Re: Foreign keys and applications

2006-06-15 Thread Luke Plant
On Thursday 15 June 2006 19:12, Luke Plant wrote: > This is because your models are in different apps. I can't remember > off-hand what the correct syntax is of course, the way to find out is to use the /admin/doc/ view, or examine the object with 'dir' in a python interactive shell, or the t

Re: Custom template tags not loading

2006-06-15 Thread Corey Oordt
Don,Thanks for the reply. When I put in {% load reservations.reservationtags %} I get:'reservations.reservationtags' is not a valid tag library: Could not load template library from django.templatetags.reservationtags, No module named reservationtagsAny other ideas?Thanks,CoreyOn Jun 15, 2006, at 5

Re: Custom template tags not loading

2006-06-15 Thread Corey Oordt
I'm going to bow my head in shame I was SURE that I put it there! Thanks for making me look ivan! Corey On Jun 15, 2006, at 5:19 PM, [EMAIL PROTECTED] wrote: > > make sure your application exists in the project's settings file > INSTALLED_APPS > > > > --~--~-~--~~---

Re: Generic views and "include"

2006-06-15 Thread Luke Plant
On Wednesday 14 June 2006 13:50, opendev wrote: > Hello, > > I am trying to render the output of multiple generic views under one > template. Is this possible and if so how? The include tag renders > only a template and cannot be used for the output of an entire view > afaik. The output of a view

Re: Enforcing relationships in the Admin

2006-06-15 Thread Malcolm Tredinnick
On Thu, 2006-06-15 at 09:07 -0700, [EMAIL PROTECTED] wrote: > All, > I have modified the original example model based on your suggestions, > and I feel like I'm another step closer to what I'm trying to > accomplish. Thanks for the suggestions! However, one issue that I > have with the current

Problem with request.session.get() method?

2006-06-15 Thread jacob
When a user logs in I set a 'user_id' variable in their session like this: request.session['user_id'] = user_id In another view I check for the user id like this: user_id = request.session.get('user_id') If 'user_id' is set in the user's session, this works fine. If 'user_id' is not set in th

Re: Problem with request.session.get() method?

2006-06-15 Thread jacob
Actually, I think it is coming from a different spot. Here's the full method: 24 def get_user_id(request): 25 user_id = request.session.get('user_id') 26 if user_id: 27 return request.session['user_id'] 28 else: 29 return HttpResponseRedi

Re: Problem with request.session.get() method?

2006-06-15 Thread jacob
Stupid user error on my part. Please disregard this post. Thanks! -jacob --~--~-~--~~~---~--~~ 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

Re: Problem with request.session.get() method?

2006-06-15 Thread Malcolm Tredinnick
On Fri, 2006-06-16 at 01:36 +, jacob wrote: > Actually, I think it is coming from a different spot. Here's the full > method: > > 24 def get_user_id(request): > 25 user_id = request.session.get('user_id') > 26 if user_id: > 27 return request.session['user_

Re: Feasibility of postgis fields?

2006-06-15 Thread nick
Hi thanks for the replies - I'm surprised this is the only way to do it as using the model api would seem neater. Have you encountered many problems separating out the geom fields like this (eg - not being searchable in admin / whatever)? Yes I'd be interested in an example of how custom sql is

whats the most django-ish way to do this

2006-06-15 Thread Joseph Dickson
Greetings.. I'm considering Django as a web framework for a new project, and am trying to wrap my mind around how I would accomplish some things.. One of the things that I need to be able to do is to have a sort of "macro" like ability in my templates. I have to generate a lot of repetitive HTM

Re: whats the most django-ish way to do this

2006-06-15 Thread Malcolm Tredinnick
On Fri, 2006-06-16 at 03:24 +, Joseph Dickson wrote: > Greetings.. > > I'm considering Django as a web framework for a new project, and am > trying to wrap my mind around how I would accomplish some things.. > > One of the things that I need to be able to do is to have a sort of > "macro" li

Problem with templatetags and template inheritance

2006-06-15 Thread Andrew Gwozdziewycz
I'm trying to build a system, which uses generic views, inherited templates and template tags. The example is this: 1. generic view uses "entry_detail.html" 2. entry_detail extends "content.html" 3. "content.html" loads a template tag library called content_utility, and

Re: Problem with templatetags and template inheritance

2006-06-15 Thread Andrew Gwozdziewycz
I found a way to work around this, but it's still bugging me that it doesn't work this way. On Jun 16, 2006, at 12:48 AM, Andrew Gwozdziewycz wrote: > I'm trying to build a system, which uses generic views, inherited > templates and template tags. > > The example is this: > >1. generic

Re: howto Django + lighttpd + Windows?

2006-06-15 Thread Jeroen Ruigrok van der Werven
On 6/14/06, mamcxyz <[EMAIL PROTECTED]> wrote: > Yes I know... is for that I try the install onto windows. > > Is rare, why then RoR can be installed with lighttp on windows? As Istvan said FastCGI doesn't work. That means you can normal CGI. Yes you can, of course, use Apache. I just wonder why