Re: ForeignKey related bug

2008-01-28 Thread Eric Abrahamsen
> While building a blog type application, I seem to have stumbled upon a > bug. In a nut shell all object attributes have become read only when I > fetch the object from a query set which is fetched using the xxx_set() > API. Hi Chirayu, Looks like the problem is not the FOO_set() manager, but s

Re: ForeignKey related bug

2008-01-28 Thread Eric Abrahamsen
> While building a blog type application, I seem to have stumbled upon a > bug. In a nut shell all object attributes have become read only when I > fetch the object from a query set which is fetched using the xxx_set() > API. Hi Chirayu, Looks like the problem is not the FOO_set() manager, but s

template orderby help

2008-01-28 Thread leahy_rich
Hi Guys, Im trying to do an orderby on my template its not working correctly below is the template code. Im posting the listing to the enquiry form and it is getting the listing correctly no keyword or date filter is given so they remain blank. ID The &listing={{ request.GET.listing }} is the p

ForeignKey related bug

2008-01-28 Thread Chirayu Patel
Hi, While building a blog type application, I seem to have stumbled upon a bug. In a nut shell all object attributes have become read only when I fetch the object from a query set which is fetched using the xxx_set() API. Please see the pdb trace for details. I have added comments to depict th

Re: YUI file upload and form errors

2008-01-28 Thread grahamu
Update: The info about "normal location" for response data is incorrect. With YUI Connection Manager the response data is always in o.responseText. My problem had something to do with "text/html" mime encoding of the escaped string "". Somehow this was getting changed at the browser to "", and tha

Managing the order of subordinate objects

2008-01-28 Thread Peter Rowell
I have run into the same problem on several different websites: a couple of PHP sites and, most recently, two Django sites. This is where you have a 'container object' that has a particular desired order of subordinate objects. Consider: class Newletter(models.Model): title = models.CharFiel

Re: Multi-page search result

2008-01-28 Thread Wanrong Lin
What a pleasant surprise! I am glad that I asked the question, even though I thought I had googled through everything. Thanks a lot for pointing these goodies out. Wanrong SmileyChris wrote: > Using the low-level cache [1] sounds like it'd work fine for you. > > from django.core.cache import

Serving flatpages before other urls

2008-01-28 Thread Michael Newman
Is there anyway to change the order that the urls are checked? For example I have an about us page that is generated by a url conf. I want my designer to make his own about us page with flatpages and therefore 'overwrite' the url that is autogenerated. I know right now flatpages checks the url aft

Re: advice on table joins

2008-01-28 Thread veearrsix
I too am having trouble with querying across multiple tables. my (simplified) models:- class Channel(models.Model):#blog name = models.CharField("Name", maxlength=30) slug = models.SlugField("URL", prepopulate_from=('name',)) class Admin: pass de

Re: Administration site is plain

2008-01-28 Thread Michael Hipp
Thanks, Bill and Alex. A simple symlink did the trick. Thanks, Michael [EMAIL PROTECTED] wrote: > It is probably looking for 404.html because it can't find the css > files, and therefore is returning a 404 for them. Have you followed > these instructions: > http://www.djangoproject.com/documen

Re: How can I parse and process the contents of an URL?

2008-01-28 Thread Michael Elsdörfer
> but the page seems to load forever and I'm stuck! I'm pretty sure I ran into this before, and IIRC it's because Django's runserver, which I assume you are using, can only handle one request at a time - try a different test url. Michael MariusB schrieb: > I'm trying to take a link as an arg

Re: Administration site is plain

2008-01-28 Thread William Siegrist
Make sure your production server knows where to send requests for / media/. You probably need a symlink to django/contrib/admin/media. See "Serving admin files" here (especially if you're using mod_python): http://www.djangoproject.com/documentation/modpython/ -Bill On Jan 28, 2008, at 2:

Re: newforms validation problem

2008-01-28 Thread [EMAIL PROTECTED]
That would just be short_name = "something", what you are doing is creating an object, however you aren't saving it to the database, you are just using it to pre-populate info to a model form. On Jan 28, 4:19 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > Hello that's what I wanted but it

Re: Administration site is plain

2008-01-28 Thread [EMAIL PROTECTED]
It is probably looking for 404.html because it can't find the css files, and therefore is returning a 404 for them. Have you followed these instructions: http://www.djangoproject.com/documentation/modpython/#serving-the-admin-files On Jan 28, 4:48 pm, Michael Hipp <[EMAIL PROTECTED]> wrote: > R

Administration site is plain

2008-01-28 Thread Michael Hipp
Running on my local development server the Administration site looks normal with the nice colors and formatting. Running on my production server it is utterly plain (black and white). It's evidently not picking up some css or templates or something. I don't see anything helpful in the apache l

Re: Unittest test-database not empty

2008-01-28 Thread Russell Keith-Magee
On Jan 29, 2008 4:27 AM, rock <[EMAIL PROTECTED]> wrote: > > I'm using the unittesting-environment for test-driven-development in > Django. It works excellent, but one matter is puzzling. The Django > documentation tells me this: > > "The test database > Tests that require a database (namely, mode

Re: newforms validation problem

2008-01-28 Thread [EMAIL PROTECTED]
Hello that's what I wanted but it doesn't work ('prepopulate_short_name' is an invalid keyword argument for this function) I have player_create_name = request.GET.get('name') tplayer = Player(prepopulate_short_name=player_create_name) playerForm = CreatePlayerForm(instance=tplayer) models: class

Need help installing django on CentOs 5 server and web design

2008-01-28 Thread WeissBlitz
I have developed my first django application and I'm ready to deploy it to my server. I'm have good experience developing and deploying websites under Windows and this will be my introduction to a Linux system. I have a CentOS 5 server and I'm looking for a person that can help me connect, insta

Re: newforms validation problem

2008-01-28 Thread Vance Dubberly
If I get what you are asking correctly, you are trying to pre-populate some fields in a form without printing out the validation errors that occur from not having all the fields populated? If so this should help: # create object instance with pre-populated data obj_instance = Object(prepoulate_f

Re: website side component processing

2008-01-28 Thread Emil
I think you should have a look at inclusion tags, they're basically tailored for this type of thing: http://www.djangoproject.com/documentation/templates_python/#inclusion-tags If you find template tags an option: another great article by James Bennet, that goes through a lot of the basics of wri

Re: Best practice for implementing multilingual content in template

2008-01-28 Thread Emil
Thanks for the tips, Ivan! //emil --~--~-~--~~~---~--~~ 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: Best practice for implementing multilingual content in template

2008-01-28 Thread Ivan Illarionov
Made some corrections: http://pastebin.com/d6337d211 On Jan 28, 10:45 pm, Ivan Illarionov <[EMAIL PROTECTED]> wrote: > IMO code_berzerker's approach is the best for complex models. But in > many cases that don't require a lot of flexibility it can be better to > use simpler approach with text fie

Have get_profile() delegate to one of several profile models depending on type of user

2008-01-28 Thread Chris Pratt
This question has been asked a few times before, but doesn't seem to be getting any responses. I'm working on a project where we have three types of users, each requiring vastly different profile models. The AUTH_PROFILE_MODULE setting, obviously, allows only one profile to be specified. One res

Re: website side component processing

2008-01-28 Thread [EMAIL PROTECTED]
Definitely! It may be a little bit more work upfront, but you get more fine-grained control that way. On Jan 28, 5:28 am, code_berzerker <[EMAIL PROTECTED]> wrote: > I just got new idea that maybe I should use custom template tags to > call processing of all common subpage components. That would

SetEnv on production Server

2008-01-28 Thread Christoph Egger
Hi I'm going to have an django project served from the webserver of a friend of mine so we tried setting up Django. As the installer of 0.96 complained to not find /usr/lib/python2.5/config/Makefile (config/ does not exist) I manually coppied the files to /usr/lib/python2.5/site-packages/django an

Re: Best practice for implementing multilingual content in template

2008-01-28 Thread Ivan Illarionov
IMO code_berzerker's approach is the best for complex models. But in many cases that don't require a lot of flexibility it can be better to use simpler approach with text fields for each language and function/ property to get the right field from templates. I even wrote the metaclass to make this

Unittest test-database not empty

2008-01-28 Thread rock
I'm using the unittesting-environment for test-driven-development in Django. It works excellent, but one matter is puzzling. The Django documentation tells me this: "The test database Tests that require a database (namely, model tests) will not use your "real" (production) database. A separate, b

Re: How can I parse and process the contents of an URL?

2008-01-28 Thread Remco Gerlich
On Jan 28, 2008 5:28 PM, Thomas Guettler <[EMAIL PROTECTED]> wrote: > def url_head(request): >c=urllib.urlopen(request.GET['url']) >content=c.read() > http://example.com/url_head?url=file:/etc/passwd It's very important to do some basic sanity checking on the url. Just saying :-) Remco

Re: Make Money working Online. I Make $850 in 7 Days....

2008-01-28 Thread Eren Türkay
On 28 Jan 2008 Mon 19:54:02 Prachi wrote: > Make Money working Online. I Make $850 in 7 Days > Only because of www.rcash.uni.cc The Only Source where i can make > money without investment. Spammer on mailling list? Piff... --~--~-~--~~~---~--~~ You received th

Top 10 Free Dating Web Sites and much more for free.

2008-01-28 Thread Prachi
Top 10 Free Dating Web Sites and much more for free. You want Free Date then go and search on http://www.10sites.uni.cc Every thing you need is Free here on http://www.10sites.uni.cc http://www.10sites.uni.cc --~--~-~--~~~---~--~~ You received this message because

Make Money working Online. I Make $850 in 7 Days....

2008-01-28 Thread Prachi
Make Money working Online. I Make $850 in 7 Days Only because of www.rcash.uni.cc The Only Source where i can make money without investment. http://www.rcash.uni.cc --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups

newforms validation problem

2008-01-28 Thread [EMAIL PROTECTED]
Hello, I have a view with searches for a given record (using a text field). If the object does not exist show a error and a link: Create On the create view if GET.get('val') then I put that data in the form. I want this just to make it simple for a user to enter a new object if it does not exist

select_related() and Template Logic

2008-01-28 Thread theZero
Hi all. I'm pretty new to django, but I'm catching on slowly but surely. So please bear with me :) For one site I'm working/learning on, I'm trying to build in "Pods" of static content that can be added as necessary to any page (or later, series of pages). The individual pods can be moved into di

Re: Multiple sites

2008-01-28 Thread LRP
Hello, On Jan 27, 11:45 pm, "James Bennett" <[EMAIL PROTECTED]> wrote: > A better solution: Many thanks. I will explore this approach. Lloyd --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To

Re: Announce: 7days7apps.com

2008-01-28 Thread book4e
瞧人这名字取的。 --~--~-~--~~~---~--~~ 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

Re: How can I parse and process the contents of an URL?

2008-01-28 Thread Thomas Guettler
Am Sonntag, 27. Januar 2008 19:39 schrieb MariusB: > I'm trying to take a link as an argument, open it, read it's content > and then display the first 50 characters from it. > First of all, I've tried to put the code in the views.py, but I didn't > make it. Now I made a middleware component with t

Earn 5000 $ Per Month with Gooooooooooooogle

2008-01-28 Thread Elizabth Biship
http://smartforums.org/money Google Adsense is the best way to earn 500$ daily sitting at home on internet. http://smartforums.org/money --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post

Re: Best practice for implementing multilingual content in template

2008-01-28 Thread Emil
Thank you all for the response. I think Jonathans version with custom methods to get the right field in the template would be the simplest for my moderate level of complexity, for now at least. But I've gotten some ideas on how to do it differently now, so thanks again! //emil On Jan 27, 11:33 p

Re: Django multilingual

2008-01-28 Thread code_berzerker
Theres earlier similar discussion. http://groups.google.com/group/django-users/browse_frm/thread/d6e7eab4cc81c7b8 For unlimited landuage support check my post at this thread. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google G

MultiWidget, opposite inline?

2008-01-28 Thread jespern
Hi list, I'm currently cooking up a widget. It's kind of, sort of, the opposite of an edit_inline. When you edit something that is referenced via ForeignKeys, the inline editor is great, but what if you want to do it the other way around? Well, that's what my widget is about, anyway. So far, I'v

Re: user.get_absolute_url()

2008-01-28 Thread Thomas
Artiom, James - many thanks, I thought I was familiar with docs, but yet again ... Many thanks! Thomas On Jan 28, 2:11 pm, "James Bennett" <[EMAIL PROTECTED]> wrote: > On Jan 28, 2008 6:49 AM, Artiom Diomin <[EMAIL PROTECTED]> wrote: > > > For example in Middleware, in process_request. You could

Re: user.get_absolute_url()

2008-01-28 Thread James Bennett
On Jan 28, 2008 6:49 AM, Artiom Diomin <[EMAIL PROTECTED]> wrote: > For example in Middleware, in process_request. You could "monkeypatch" > User on the fly. Or he could use the standard, documented method for overriding a model's get_absolute_url() method: http://www.djangoproject.com/documenta

Re: user.get_absolute_url()

2008-01-28 Thread Artiom Diomin
For example in Middleware, in process_request. You could "monkeypatch" User on the fly. Thomas пишет: > What is the best way to override user.get_absolute_url with custom > code (the django.contrib.auth.models.User method) ? Where should it be > put? > > Thanks, Thomas --~--~-~--~~

Re: exists created_at or updated_at ?

2008-01-28 Thread Bastos
updated_at = models.DateTimeField(auto_now=True) created_at = models.DateTimeField(auto_now_add=True) On Jan 27, 1:54 pm, "Claudio Escudero" <[EMAIL PROTECTED]> wrote: > Anyone know if there is something like created_at or updated_at of Ruby on > Rails. > These fields are filled autom

Re: check if model instance exists

2008-01-28 Thread Tim Chase
> Is there a better way to check if there are any hits on a query than > using query.count()>0 ? > > I find myself doing something like this a lot: > modelList = MyModel.objects.filter(someMember=m) > if modelList.count() > 0: > return modelList[0] This sounds an awful lot like the .get() meth

Re: website side component processing

2008-01-28 Thread code_berzerker
I just got new idea that maybe I should use custom template tags to call processing of all common subpage components. That would be even more efficient and flexible, because I could have many different premade templates to choose from in admin panel and each of them having different set of compone

user.get_absolute_url()

2008-01-28 Thread Thomas
What is the best way to override user.get_absolute_url with custom code (the django.contrib.auth.models.User method) ? Where should it be put? Thanks, Thomas --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django us

Re: Optimistic Locking

2008-01-28 Thread Alistair Lattimore
Thomas, Do you use a custom manager to select out the row before issuing the save to make sure that the in memory timestamp matches that of the database? Al. On Jan 24, 11:16 pm, Thomas Guettler <[EMAIL PROTECTED]> wrote: > Am Donnerstag, 24. Januar 2008 13:08 schrieb Tim Sawyer: > > > Hi Folks

Re: Sending SMS messages

2008-01-28 Thread Joe Bloggs
There is a python API for sending SMS as well as making phone calls, see http://sdk.bt.com , the python bit can be accessed once registered via http://web21c.bt.com/downloads . Regards, Joe On Jan 26, 2008 8:07 AM, John <[EMAIL PROTECTED]> wrote: > > can you share some other service names, not

Re: Django multilingual

2008-01-28 Thread Horst Gutmann
2008/1/28 Ivan Illarionov <[EMAIL PROTECTED]>: > Models that need flexibility have `lang` and `is_translation_of` > fields. Views (or custom managers) filter the output based on `lang` > and add the link to other language if translation exists. Some models > just have two separate text fields for