Re: using API to populate db

2006-04-05 Thread Todd O'Bryan
Never mind. I saw the issue about having to create Question(something='something') rather than just Question() and that solved the problem. Is this viewed as a bug or just an unfortunate circumstance? Todd On Apr 5, 2006, at 11:08 PM, Todd O'Bryan wrote: > > I've exported some old data,

using API to populate db

2006-04-05 Thread Todd O'Bryan
I've exported some old data, in an old (somewhat terrible) format as XML, and I'm trying to read it back in and populate a Django model. When I try to save an object, however, I get this error: File "/Users/tobryan1/Documents/eclipse/workspace/django-projects/

mr: DateField and "global name 'date_query' is not defined" error

2006-04-05 Thread arthur debert
I stumbled upon this error message after porting a project to magic-removal. In the admin, if I try to get the list view for something like: class SomeModel(models.Model): title = models.CharField(maxlength=200) date_due = models.DateField(blank= True, null=True) class Admin:

Re: Locale from URL Middleware

2006-04-05 Thread limodou
On 4/5/06, Simon Willison <[EMAIL PROTECTED]> wrote: > > On 5 Apr 2006, at 12:26, limodou wrote: > > > Why you need do this? Because django can auto judge the language from > > your browser request http head, or context settings, or settings. If > > you like , you can provide a language selection

Re: A model which is recursively referring to itself in Magic Removal

2006-04-05 Thread Luke Plant
On Wednesday 05 April 2006 21:35, Rudolph wrote: > Is that an inconsistancy to be removed (ie a bug)? No, it's intended behaviour. The _set stuff is only there because for the 'other' end of these relationships it is possible that there is no name defined, so there needs to be a way of coming

Re: ImageField upload_to

2006-04-05 Thread Max Battcher
timster wrote: > Should the super() method work even though I'm not using MR? No. super().save() only works in MR. You'll need the _pre_save() and _post_save() hooks in .91 or trunk. -- --Max Battcher-- http://www.worldmaker.net/ "I'm gonna win, trust in me / I have come to save this world

Re: ImageField upload_to

2006-04-05 Thread Max Battcher
timster wrote: > Should the super() method work even though I'm not using MR? No. super().save() only works in MR. You'll need the _pre_save() and _post_save() hooks in .91 or trunk. -- --Max Battcher-- http://www.worldmaker.net/ "I'm gonna win, trust in me / I have come to save this world

Re: Locale from URL Middleware

2006-04-05 Thread atlithorn
Glad I am not alone :) There is a little irritation in using the middleware posted above because I obviously have to account for the language in all lines in my urls.py (r'(\w\w/)?... and so on). I would prefer for this to have the same result as using an "include" statement, ie the prefix would

Re: Stupid newbie question about documentation

2006-04-05 Thread [EMAIL PROTECTED]
... and don't forget the excellent Django API browser here: http://djangoapi.quamquam.org/magic-removal/ Derek --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send

Re: Stupid newbie question about documentation

2006-04-05 Thread James Bennett
On 4/5/06, arthur debert <[EMAIL PROTECTED]> wrote: > 1) fire the shell (cd to your project dir) then: >python manage.py shell >from django.contrib.auth.models import User >dir(User) or dir(User,objetcts.all()[0]) User.__doc__ will also get you this information, in a form which lets

Re: Stupid newbie question about documentation

2006-04-05 Thread Todd O'Bryan
Thank you, thank you, thank you. On Apr 5, 2006, at 5:10 PM, arthur debert wrote: > I guess what you are looking for is: > u = User.objects.get(username='namehere') > > but you could also: > > 1) fire the shell (cd to your project dir) then: >python manage.py shell >from

Re: Stupid newbie question about documentation

2006-04-05 Thread arthur debert
Hi Todd. I guess what you are looking for is: u = User.objects.get(username='namehere') but you could also: 1) fire the shell (cd to your project dir) then: python manage.py shell from django.contrib.auth.models import User dir(User) or dir(User,objetcts.all()[0]) 2) on the admin

Stupid newbie question about documentation

2006-04-05 Thread Todd O'Bryan
In m-r, I want to write u = User.objects.get(login='namehere') except that login isn't the name of the attribute. Where can I look to find all the attributes of an instance? I know about the dir() function, but it just gives me methods, right? Is there someplace Python-internal to do this,

Re: A model which is recursively referring to itself in Magic Removal

2006-04-05 Thread Rudolph
Is that an inconsistancy to be removed (ie a bug)? Rudolph --~--~-~--~~~---~--~~ 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

Re: Help with performance?

2006-04-05 Thread akaihola
Here's one technique for optimizing cases where you just get too many queries: http://code.djangoproject.com/wiki/CookBookPreloadRelated --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post

Re: Help with performance?

2006-04-05 Thread akaihola
Joseph, actually the page behind that link describes my profiling hack for the internal webserver, not mod_python. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send

Re: Locale from URL Middleware

2006-04-05 Thread Rudolph
I would like to add another good reason: Another nice effect language codes in the URL is that search engine crawlers can easily get all your content. My customers often want something like this: www.example.com -> site in the main language of your visitors www.example.nl -> site in Dutch

Re: Help with performance?

2006-04-05 Thread akaihola
It's also useful to inspect {{sql_queries}} (see core/context_processors.py). If Django is doing tons of SQL queries, you'll have to sort out how to optimize. I reduced the number of queries on one of my more complex pages from over 6000 to just five. I'll contribute something about this on the

Re: How do I handel multiple foriegn keys in single model

2006-04-05 Thread akaihola
First you retrieve the person and e-mail type objects, then add a PersonEmail object using them. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to

Re: How do I handel multiple foriegn keys in single model

2006-04-05 Thread akaihola
Kenneth, what, many persons can have the same e-mail address?!? --~--~-~--~~~---~--~~ 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: Locale from URL Middleware

2006-04-05 Thread akaihola
I very much agree with Simon and Jan. A middleware like this would be nice to have in django.contrib. One useful enhancement would be the ability to specify in where in the URL the language can be specified. On one of my sites the syntax of the URL is always /userid/locale/page... so it would be

Re: ImageField upload_to

2006-04-05 Thread timster
Thanks for the reply Ian. I seem to have solved this for the most part. The second message in that thread was very helpful. I was able to use that solution almost exactly. I added the following save() method to my model: def save(self): if self.image: import shutil from os

Re: django-admin and manage.py without shell-access

2006-04-05 Thread Waylan Limberg
On 4/5/06, òÏÍÁÎ éÍÁÎËÕÌÏ× <[EMAIL PROTECTED]> wrote: > Thank you for your reply > > 2006/4/5, limodou <[EMAIL PROTECTED]>: > > > > I think the answer is NO. And I have a question, if you haven't telnet > > access, and how to configure your settings.py and how to configure > > your web server

Re: Locale from URL Middleware

2006-04-05 Thread Jan Claeys
Op wo, 05-04-2006 te 16:34 +0100, schreef Simon Willison: > I for one much prefer the language to be specified in the URL Or sometimes using a cookie... > rather > than being derived from the browser settings. I would prefer this > behaviour to be supported (at least as an option) in Django

Re: A model which is recursively referring to itself in Magic Removal

2006-04-05 Thread Nebojsa Djordjevic
Rudolph wrote: > parent = models.ForeignKey('Item', blank = True, null = True, > related_name = 'child',) > > When trying to get the childs of an object by issueing > item.child_set.all(), it raises an exception: > 'Item' object has no attribute 'child_set'. Because you used

Re: Locale from URL Middleware

2006-04-05 Thread Simon Willison
On 5 Apr 2006, at 12:26, limodou wrote: > Why you need do this? Because django can auto judge the language from > your browser request http head, or context settings, or settings. If > you like , you can provide a language selection in web page, and > that's enough. The url doesnot need to be

Re: Locale from URL Middleware

2006-04-05 Thread atlithorn
I understand how django does it. Unfortunately I am forced to maintain a web structure that requires this functionality so that's why I wrote it. But I actually prefer this over the ambiguity in the browser settings which most people do not set anyway and the extra step required to select the

magic-removal ebuild

2006-04-05 Thread Douglas Campos
For the gentooers, I've built a magic removal svn ebuild If anyone wants it, pvt-me --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to

Re: Locale from URL Middleware

2006-04-05 Thread limodou
On 4/5/06, atlithorn <[EMAIL PROTECTED]> wrote: > > Just in case anyone is interested... I wrote my own middleware class to > support selecting languages from the URL itself. eg: > > www.example.com - default english > www.example.com/de - same page with german trans > > It was a simple

Locale from URL Middleware

2006-04-05 Thread atlithorn
Just in case anyone is interested... I wrote my own middleware class to support selecting languages from the URL itself. eg: www.example.com - default english www.example.com/de - same page with german trans It was a simple copy-paste of the LocaleMiddleWare from the distro: ##

Re: ANN:Woodlog Testing

2006-04-05 Thread PythonistL
Limodou, Thanks a lot for the explanation and help. Best regards, L. --~--~-~--~~~---~--~~ 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: ANN:Woodlog Testing

2006-04-05 Thread limodou
On 4/5/06, PythonistL <[EMAIL PROTECTED]> wrote: > > Limodou, > Thanks a lot for your help. > Now I understand much better. > Best regards, > L. You are welcome. -- I like python! My Blog: http://www.donews.net/limodou My Django Site: http://www.djangocn.org NewEdit Maillist:

Re: ANN:Woodlog Testing

2006-04-05 Thread PythonistL
Limodou, Thanks a lot for your help. Now I understand much better. Best regards, L. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to

Re: ANN:Woodlog Testing

2006-04-05 Thread limodou
On 4/5/06, PythonistL <[EMAIL PROTECTED]> wrote: > > Limodou, > Thanks for replies. > I am also working on a application that more users should be used by. > So, I would like to learn a little more how to create > url dynamicly( on fly). Can you please let me know where in you > file(s) you make

Re: django-admin and manage.py without shell-access

2006-04-05 Thread Roman
Thanks, it looks like a satisfactory decision for the "poor man's hosting" --~--~-~--~~~---~--~~ 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: ANN:Woodlog Testing

2006-04-05 Thread PythonistL
Limodou, Thanks for replies. I am also working on a application that more users should be used by. So, I would like to learn a little more how to create url dynamicly( on fly). Can you please let me know where in you file(s) you make that. Thanks a lot L.

Re: django-admin and manage.py without shell-access

2006-04-05 Thread Ivan Sagalaev
Roman wrote: >I need to place my django-powered web site on a server which haven't >SSH-access (ftp only). Can I execute analogues of "django-admin" and >"manage.py" through web interface? > > There is no web interface but you can write a script with something like this: from

Re: django-admin and manage.py without shell-access

2006-04-05 Thread limodou
On 4/5/06, Roman <[EMAIL PROTECTED]> wrote: > > I need to place my django-powered web site on a server which haven't > SSH-access (ftp only). Can I execute analogues of "django-admin" and > "manage.py" through web interface? > Is there something like web-wrapper for these commands? > I think

django-admin and manage.py without shell-access

2006-04-05 Thread Roman
I need to place my django-powered web site on a server which haven't SSH-access (ftp only). Can I execute analogues of "django-admin" and "manage.py" through web interface? Is there something like web-wrapper for these commands? Thank you. -- Roman

Re: ANN:Woodlog Testing

2006-04-05 Thread limodou
On 4/5/06, PythonistL <[EMAIL PROTECTED]> wrote: > > Limodou,thank you for your reply. > I am sorry but I do not fully understand your answer > > You say that every user has his own blog but also that there is not > user > directory. But when I want to use my blog as a user, I have a different

Re: ANN:Woodlog Testing

2006-04-05 Thread PythonistL
Limodou,thank you for your reply. I am sorry but I do not fully understand your answer You say that every user has his own blog but also that there is not user directory. But when I want to use my blog as a user, I have a different URL, e.i.a directory is also different, from another user. I

Re: ANN:Woodlog Testing

2006-04-05 Thread limodou
On 4/5/06, PythonistL <[EMAIL PROTECTED]> wrote: > > Hello Limodou, > It looks very nice. > Can you please answer my question? > What is the file rpc.py for? woodlog support xmlrpc access. So rpc.py is a xmlrpc functions congif file. > Does every user have his own blog in his directory? Yes.

Re: ANN:Woodlog Testing

2006-04-05 Thread PythonistL
Hello Limodou, It looks very nice. Can you please answer my question? What is the file rpc.py for? Does every user have his own blog in his directory? And what files must every user have in his directory and which can be common(the same )? Thank you for your reply L.