Re: Accessing model fields automatically..

2007-03-30 Thread Malcolm Tredinnick
On Sat, 2007-03-31 at 05:27 +, Ramashish Baranwal wrote: > Hi, > > I am trying to export a model's data to XML. To do this I'm using the > model class's _meta.fields. However it doesn't list ManyToManyField > objects. How can I get those? > > My code looks something like this- > > #

Accessing model fields automatically..

2007-03-30 Thread Ramashish Baranwal
Hi, I am trying to export a model's data to XML. To do this I'm using the model class's _meta.fields. However it doesn't list ManyToManyField objects. How can I get those? My code looks something like this- # returns data of inst in a dict def get_data(inst): data = {} for field in

Re: Noob: How to bind objects to specific users?

2007-03-30 Thread Ben Stahl
Those solutions make sense, that was just what I was looking for, thanks! That should be in the docs somewhere... --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send

Re: XML-RPC call for django unit testing

2007-03-30 Thread Russell Keith-Magee
On 3/29/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > Hi > I 'm trying to test django app using built-in django unit > testing. Some of it make a call to xml-rpc server using xmlrpclib. > Now, I use django testing framework and can run unit testing except > that I can't enable

Re: newb: Lxml Objectify

2007-03-30 Thread Malcolm Tredinnick
On Sat, 2007-03-31 at 01:45 +, johnny wrote: > > > Breakfast at Tiffany's > Movie > Classic > > > > Borat > Movie > Comedy > > > > How do you represent DVD id=1 and it's elements, and DVD id=2 and it's > elements as child of root "Library"? > Like this:? > > from lxml import etree >

Re: urls.py regex problem

2007-03-30 Thread Malcolm Tredinnick
On Sat, 2007-03-31 at 01:44 +, benrawk wrote: > Hello, > > When I am running the simple current_datetime example from the django > book, and then edit my urls.py to look like the one in the book, the > page doesn't server. > > Book urls.py: > from django.conf.urls.defaults import * >

Re: common model

2007-03-30 Thread Malcolm Tredinnick
On Fri, 2007-03-30 at 20:34 +, drackett wrote: > If I have multiple items that I want to use a common model, is there a > way to do this? currently I have: > > class Link(models.Model): > author = models.ForeignKey(User) > link = URLField() > description =

Re: custom admin backend form layout depending on user vs admin

2007-03-30 Thread Malcolm Tredinnick
On Fri, 2007-03-30 at 09:50 -0700, TaMeR wrote: > > Below I have posted a short form of my modules. > In the admin backend, when a user goes in to the Vehicle form the > company field should be filled with the users own company data but the > admin should still get the select box. > > This is a

Re: Locate subset language problem

2007-03-30 Thread Malcolm Tredinnick
On Fri, 2007-03-30 at 17:05 +, Nuno Mariz wrote: > Hi Malcolm, > Simple example: > > In my settings.py: > gettext = lambda s: s > LANGUAGES = ( > ('pt', gettext('Portuguese')), > ('en', gettext('English')), > ) > > Imagine a client accessing to my site with a browser using 'pt-br',

newb: Lxml Objectify

2007-03-30 Thread johnny
Breakfast at Tiffany's Movie Classic Borat Movie Comedy How do you represent DVD id=1 and it's elements, and DVD id=2 and it's elements as child of root "Library"? Like this:? from lxml import etree from lxml import objectify root = objectify.Element("Library") child[1] =

urls.py regex problem

2007-03-30 Thread benrawk
Hello, When I am running the simple current_datetime example from the django book, and then edit my urls.py to look like the one in the book, the page doesn't server. Book urls.py: from django.conf.urls.defaults import * f from mysite.views import current_datetime urlpatterns =

Re: Multiple types of users More options

2007-03-30 Thread Kenneth Gonsalves
On 30-Mar-07, at 8:45 PM, johncock wrote: > We need multiple types of users. Different profiles and different > permission. this has been repeatedly discussed. The auth.user model gives the bare essentials. extending this is up to the individual developer. O course, until model inheritance

Re: Python-specific question: variable scope

2007-03-30 Thread Aidas Bendoraitis
It's not strongly related to some specific problem, but more to the better python perception and self-training. Thank you all for your time and attention. Thank you, Jerremy D, for the interesting solutions. Regards, Aidas Bendoraitis [aka Archatas] On 3/31/07, Forest Bond <[EMAIL PROTECTED]>

Re: Python-specific question: variable scope

2007-03-30 Thread Forest Bond
On Fri, Mar 30, 2007 at 08:07:51PM +0200, Aidas Bendoraitis wrote: > > Actually the was no circular import since I haven't imported a from b, > but just b from a. Sorry, mis-read your code, I thought there were only two modules. > And unfortunately your answer didn't solve the original

Re: newbie question regarding newForm POST information

2007-03-30 Thread tyman26
I see what you are saying, but I was trying to do something a little more complicated. I wasn't trying to validate any data, but rather load choices into a select box based on information from the POST. I have 2 select boxes in a form where one has info regarding all the countries in the world.

Re: Advanced Search on Django?

2007-03-30 Thread Jay Parlar
On 3/30/07, js <[EMAIL PROTECTED]> wrote: > > Hi, > > Now I'm trying to write a 'Advanced search' function like this. > http://code.djangoproject.com/query > > Because I'm still new to Python and Django > writing flexible query like this is a bit hard. > So I svn checkouted djangoproject.com's

Re: trying to setup field sets in admin, keep getting error

2007-03-30 Thread James Bennett
On 3/30/07, drackett <[EMAIL PROTECTED]> wrote: > I see.. if there were more than one item in there, the last comma > isn't necessary anymore, correct? Correct. The comma is needed on a single-element tuple so that Python can distinguish between something that's in parentheses for grouping

Re: Python-specific question: variable scope

2007-03-30 Thread Jeremy Dillworth
Here's a few ideas: Solution 1 - use the __main__ module The downside to this is that it always reads x from the "top-level" module, in other words, the script that is being run. So when you run a1, you'll get "a1" when you run a2 module b will then find "a2". a1.py -- import

Re: Prevent URLs from being called directly

2007-03-30 Thread Helge
On Mar 30, 10:12 pm, "Ian" <[EMAIL PROTECTED]> wrote: > This situation is greatly helped if the same view displays the form as > well as processes it. So it could look something like this: > > def write_entry(request): > form = EntryForm() > if request.POST: > form =

Re: Python-specific question: variable scope

2007-03-30 Thread Jeremy Dunck
On 3/30/07, Jeremy Dunck <[EMAIL PROTECTED]> wrote: ... > In general, no. Python is lexically scoped, so that when b.test is > called, it checks the scope of test, then b, then __builtins__, then > fails with NameError. Good intro to scoping, if needed:

common model

2007-03-30 Thread drackett
If I have multiple items that I want to use a common model, is there a way to do this? currently I have: class Link(models.Model): author = models.ForeignKey(User) link = URLField() description = TextField(blank=True) entry_date =

Re: Python-specific question: variable scope

2007-03-30 Thread Jeremy Dunck
On 3/30/07, Aidas Bendoraitis <[EMAIL PROTECTED]> wrote: ... > b.py: > --- > def test(): > print x > > -- > Is it possible to access the x of the module a.py in the module b.py? > What would be the functions/statements to make it possible? Or in > general, how to

Re: time ouput not a valid input format

2007-03-30 Thread gkelly
I was refering to line 187 (and maybe 184 as well): 170 class TimeField(Field): 171 def __init__(self, input_formats=None, *args, **kwargs): 172 super(TimeField, self).__init__(*args, **kwargs) 173 self.input_formats = input_formats or

Re: Prevent URLs from being called directly

2007-03-30 Thread Ian
This situation is greatly helped if the same view displays the form as well as processes it. So it could look something like this: def write_entry(request): form = EntryForm() if request.POST: form = EntryForm(request.POST) if form.is_valid(): ... save entry,

Re: trying to setup field sets in admin, keep getting error

2007-03-30 Thread drackett
I see.. if there were more than one item in there, the last comma isn't necessary anymore, correct? ('more', { 'classes': 'collapse', 'fields' : ('entry_date', 'entry_something') }), On Mar 30, 2:50 pm, "James Bennett" <[EMAIL PROTECTED]> wrote: > On 3/30/07, drackett <[EMAIL PROTECTED]>

time ouput not a valid input format

2007-03-30 Thread gkelly
This could be a configuration error on my end, but it seems to me to be a bug (or feature request). using newforms: class MyForm(forms.Form): time = forms.TimeField(input_formats=('%H:%M',)) I want just an hour:minute field. The input works fine, but the output always outputs %H:%M:%S

Re: trying to setup field sets in admin, keep getting error

2007-03-30 Thread James Bennett
On 3/30/07, drackett <[EMAIL PROTECTED]> wrote: > ('more', { 'classes': 'collapse', 'fields' : > ('entry_date') }), This line is the culprit; change it to ('more', { 'classes': 'collapse', 'fields' : ('entry_date',) }), Take note of the comma after 'entry_date'. The

trying to setup field sets in admin, keep getting error

2007-03-30 Thread drackett
I am trying to setup field sets on my first project, however, when I add the admin section below, I get the error "My_blog has no field named 'e' " This error goes away if I remove the "fields=" from below. I got the code straight from the documentation, what am I doing wrong? :\ Thanks! class

trying to setup field sets in admin, keep getting error

2007-03-30 Thread drackett
I am trying to setup field sets on my first project, however, when I add the admin section below, I get the error "My_blog has no field named 'e' " This error goes away if I remove the "fields=" from below. I got the code straight from the documentation, what am I doing wrong? :\ Thanks! class

Advanced Search on Django?

2007-03-30 Thread js
Hi, Now I'm trying to write a 'Advanced search' function like this. http://code.djangoproject.com/query Because I'm still new to Python and Django writing flexible query like this is a bit hard. So I svn checkouted djangoproject.com's source and tried to look at the custom query's code, but I

Re: newbie question regarding newForm POST information

2007-03-30 Thread risomt
I'm a bit confused by what you're trying to do with the actual data itself... I haven't used newforms a great deal yet, but anytime that it has been necessary to modify data coming in from request.POST I've either done it within the view itself or within the newforms data validation system. for

Re: Python-specific question: variable scope

2007-03-30 Thread Aidas Bendoraitis
Maybe this leads to nothing and is more-or-less a theoretical question, but anyway, I'll give you another example: a1.py x = "A1" import b a2.py x = "A2" import b b.py - # the module which imports me is a blackbox to me def

Re: Python-specific question: variable scope

2007-03-30 Thread Rubic
b.py: import a ... def test(): print a.x -- Jeff Bauer Rubicon, Inc. On Mar 30, 6:43 am, "Aidas Bendoraitis" <[EMAIL PROTECTED]> wrote: > Let's say I have the files main.py, a.py and b.py > > main.py: > --- > x="some local value" > import a > ... > > a.py: >

Re: Python-specific question: variable scope

2007-03-30 Thread Aidas Bendoraitis
Actually the was no circular import since I haven't imported a from b, but just b from a. And unfortunately your answer didn't solve the original question, which is getting the value from the module that imports the current module. Or maybe the is a way to include another file and parse it with

M2M relationships via an intermediary table .. how do i get to the data in my template?

2007-03-30 Thread oliver
Hi, I am starting out with django and python, don't have much experience in either. I have managed to create a few "simple" website with django and really enjoy working with it. But I am a bit stuck on my latest project. I am using a M2M relation via an intermediary table.

Re: newbie - deploy error

2007-03-30 Thread [EMAIL PROTECTED]
Frank, you may want to confirm that you can import mysite3 from Python. You may want to ensure that mysite3 is within your python site- packages or there is a symbolic link (tougher to do on windows) to the mysite3 folder. Or place the mysite3 folder (for testing) right in the site-packages

Re: Locate subset language problem

2007-03-30 Thread Nuno Mariz
Hi Malcolm, Simple example: In my settings.py: gettext = lambda s: s LANGUAGES = ( ('pt', gettext('Portuguese')), ('en', gettext('English')), ) Imagine a client accessing to my site with a browser using 'pt-br', my applications falls in 'pt-br'(because of

custom admin backend form layout depending on user vs admin

2007-03-30 Thread TaMeR
Below I have posted a short form of my modules. In the admin backend, when a user goes in to the Vehicle form the company field should be filled with the users own company data but the admin should still get the select box. This is a big one then I don't have to create all the forms and can

newbie question regarding newForm POST information

2007-03-30 Thread tyman26
Is it possible to access the POST information from within my forms.py file after a page submission? I am confused on how to access this information from within the constructor of if I can even do this. -- forms.py -- from django import newforms as forms class

Re: User profile and sliding date range data model?

2007-03-30 Thread Rob Hudson
James Bennett wrote: > On 3/29/07, Rob Hudson <[EMAIL PROTECTED]> wrote: >> I can't think of a way to account for "up to last 3 years" and "up to >> the next 5 years" or variation thereof. > > paid_up_until = models.DateField() > > Then use Python's standard 'datetime.timedelta' to handle

UML to Django Code Generator

2007-03-30 Thread [EMAIL PROTECTED]
Hello, I created a UML to Django Code Generator... If you're intereseted look at my Blog... http://andikoerner.blogspot.com/ or get it direct: http://www.jaak.de/upload/DjanGenXML.zip I would be happy if you would test my program. Will be in svn soon, but at this time it's just zipped... bye,

returning bools from custom methods

2007-03-30 Thread Eric Spaulding
Hello -- I've added a custom method to a model that returns a boolean -- I've tried something like this: class Liquid(models.Model): # ... def ruins_everything(self): return bool(0) ... which does show up as "False" in the list of the admin. What I'm wondering is, what would I

Re: maxlength is always 10 with text widget

2007-03-30 Thread tyman26
> txtfld_attrs_dict = { 'class': 'default_txt_field'} > contact_first = > forms.CharField(widget=forms.TextInput(attrs=txtfld_attrs_dict),max_length=25,label=u'Contact > First') I figured out the problem, you have to set the dictionary representation within the widget parameter if you use a

Multiple types of users More options

2007-03-30 Thread johncock
Hi there, I'm evaluating Django for a project and the framework fits in many ways. However on one issue it would be nice with some help to hand-sew the glove: We need multiple types of users. Different profiles and different permission. To be more specific: it is a event site where different

Re: unordered_list in templates

2007-03-30 Thread Grupo Django
I have written a custom tag. Here is the code: register = template.Library() def bloque_menu(posicion): def items(bloque, padre): entradasMenu = bloque.menu_set.filter(padre = padre,visible=1) salida="" if entradasMenu:

Free Teleseminar for Real Estate Investors

2007-03-30 Thread Wealthaddress.com
FREE TELE-SEMINAR! How to create an effective business plan for Rehabbers/Flippers to be used for obtaining private money and institutional credit lines. Lee Salinas, MBA, CPA resides in San Antonio and is a full time real estate investor. He has purchased over 200 properties since he began

Re: IOError: Client read error (Timeout?)

2007-03-30 Thread Enrico
Hi Jeremy, I get this almost daily. The 'application/x-www-form-urlencoded' felt weird for a page that doesn't have forms. I'm not worried also, just curious. :) Thanks. Enrico --~--~-~--~~~---~--~~ You received this message because you are subscribed to the

Re: Left Joins / Inheritance / Plugins ...whatever...

2007-03-30 Thread akonsu
hello, I myself hink that your solution with foreign keys is good. the fact that django requires raw sql to handle left joins is its limitation but not that of your design. another solution that comes to mind is to have a table of generic "attributes" for each patron. this way you will have two

newforms and child models

2007-03-30 Thread [EMAIL PROTECTED]
I've been trying to update some existing code to use newforms. My initial experiment substituting a newforms produced form for a form created by a custom manipulator worked fine. However, I ran into some difficulty attempting to use a form_for_instance produced form to substitute for a

Re: IOError: Client read error (Timeout?)

2007-03-30 Thread Jeremy Dunck
On 3/30/07, Enrico <[EMAIL PROTECTED]> wrote: > > I keep getting this error randomly. > > The only differences I see from other requests is the > 'HTTP_CONTENT_TYPE': 'application/x-www-form-urlencoded' and > POST:. > > Is there anyone getting this error? > Is there a solution to this? Yes, I do

Re: Django/mod_python high memory usage - possible leak?

2007-03-30 Thread xgdlm
> > This week I decided to give a try to a new configuration. I'm now > > running django on lighttpd / fcgi and I have no swap at all. > > So I'm aware the mod_python is the prefered way to use django ... buy > > I'm quite happy with that new server configuration :) > > Can you give some more

Re: Long time process and FCGI

2007-03-30 Thread Anderson Santos
Thank you, again. Now I think I have enough information to find my way =D On 3/30/07, xgdlm <[EMAIL PROTECTED]> wrote: > > > I am just not sure about how to call the shell script. > > I would call the shell script withing a cronjob command : > python /path/to/sendmail.py > > this script would

Re: Long time process and FCGI

2007-03-30 Thread xgdlm
> I am just not sure about how to call the shell script. I would call the shell script withing a cronjob command : python /path/to/sendmail.py this script would do someting roughly like : - if there_is_a_mailing_to_send : for mail in mailtosend : do send mail - > read from a

Re: Django/mod_python high memory usage - possible leak?

2007-03-30 Thread Jeremy Dunck
On 3/30/07, xgdlm <[EMAIL PROTECTED]> wrote: ... > This week I decided to give a try to a new configuration. I'm now > running django on lighttpd / fcgi and I have no swap at all. > So I'm aware the mod_python is the prefered way to use django ... buy > I'm quite happy with that new server

Re: Long time process and FCGI

2007-03-30 Thread Anderson Santos
I was looking for how to execute a script and I was just thinking how to use django code and here is your e-mail! Thank you! I am just not sure about how to call the shell script. should I use the os.system(command) or the os.popen ? That seems that popen just return when I close the script

Re: Long time process and FCGI

2007-03-30 Thread xgdlm
Hello, Sending email within a view seems to me quite a strange process :) You should send your emails within a shell python (or whatever) process. What I would do ... I would within my view, write some kind of data to a database or a text file or whatever. Then, have a cronjob that check that

Re: Django/mod_python high memory usage - possible leak?

2007-03-30 Thread xgdlm
Hello, I've notice the same memory consuption on my servers. I'm running django appz on 3 LVS loadbalanced mod_python apache http servers. If, for instance, I do a maintnance on one of the server Swap is increasing a lot on the two remaining servers, even if those two servers should handle the

Re: Locate subset language problem

2007-03-30 Thread Malcolm Tredinnick
Hey Nuno, On Fri, 2007-03-30 at 11:36 +, Nuno Mariz wrote: > Seems that is not possible to disable a subset language in locale > system. What do you mean by "disable the subset language" here? > I can't define only the "pt" locale, because if the user uses in his > browser "pt-br" it loads

Re: Python-specific question: variable scope

2007-03-30 Thread Forest Bond
On Fri, Mar 30, 2007 at 01:43:41PM +0200, Aidas Bendoraitis wrote: > > Let's say I have the files main.py, a.py and b.py > > main.py: > --- > x="some local value" > import a > ... > > > a.py: > --- > x="some other local value" > import b > ... > > > b.py: > --- > def

Python-specific question: variable scope

2007-03-30 Thread Aidas Bendoraitis
Let's say I have the files main.py, a.py and b.py main.py: --- x="some local value" import a ... a.py: --- x="some other local value" import b ... b.py: --- def test(): print x -- Is it possible to access the x of the module a.py in the module

Locate subset language problem

2007-03-30 Thread Nuno Mariz
Seems that is not possible to disable a subset language in locale system. I can't define only the "pt" locale, because if the user uses in his browser "pt-br" it loads the "pt-br" and not the "pt" that was defined in LANGUAGE settings: gettext = lambda s: s LANGUAGES = ( ('pt',

Re: Left Joins / Inheritance / Plugins ...whatever...

2007-03-30 Thread Corey Oordt
Mike, What comes to mind is an intermediary table, a Many-to_many table. Design 1: This design depends on a separate Model that lists the available plugins, but would require a manual join of the plugin_table_id to the appropriate model/table. The plugin model tells you which type of link

Re: Automated deployment

2007-03-30 Thread Rick van Hattem
On Mar 30, 8:26 am, "IvanK" <[EMAIL PROTECTED]> wrote: > Now I come from the rails camp (obviously deserting :)) and I've been > wondering does Django has anything like capistrano for automated > deployment, cause it's really easy with rails to just write "rake > deploy" and have your production

Re: Long time process and FCGI

2007-03-30 Thread Anderson Santos
In my case, it's quite urgent (it must work today), so do you have any example to execute this external script? Is it simple python (*.py) files? I was reading the link you sent, it's really interesting and it could be useful in a visual progress process, I will try it with another project.

Re: Django/mod_python high memory usage - possible leak?

2007-03-30 Thread Steven Armstrong
Graham Dumpleton wrote on 03/30/07 12:27: > On Mar 30, 6:31 pm, Steven Armstrong <[EMAIL PROTECTED]> wrote: >> My understanding is that every apache child pulls in all modules >> (mod_python, mod_perl, mod_php, mod_your_favorite_mod_here) which all >> consume memory. So you end up with loads of

Re: regressionstests for latested SVN

2007-03-30 Thread Malcolm Tredinnick
On Fri, 2007-03-30 at 12:43 +0200, [EMAIL PROTECTED] wrote: > Hi all, > > I've updated to the latested django SVN version 4868 and installing it into > my system I ran the regression test of the same version. > > It seems to me that the tests are broken ? > My database is a MySQL 5.0.27 with

Re: Prevent URLs from being called directly

2007-03-30 Thread Helge
Hey guys, Thanks a lot for all your answers! Helge --~--~-~--~~~---~--~~ 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

regressionstests for latested SVN

2007-03-30 Thread dummy
Hi all, I've updated to the latested django SVN version 4868 and installing it into my system I ran the regression test of the same version. It seems to me that the tests are broken ? My database is a MySQL 5.0.27 with MySQLDB 1.2.1-p2, Python 2.5 if it matters. I attached the log results.

Re: Prevent URLs from being called directly

2007-03-30 Thread Cam McVey
On 3/30/07, Arvin Schnell <[EMAIL PROTECTED]> wrote: > > On Fri, Mar 30, 2007 at 03:01:44AM -0700, Helge wrote: > > *SNIP* > > I wonder if there is a standard way in Django to prevent URLs from > > being called directly. > > You can use the require_POST decorator to ensure that the view > has

Re: Django/mod_python high memory usage - possible leak?

2007-03-30 Thread Graham Dumpleton
On Mar 30, 6:31 pm, Steven Armstrong <[EMAIL PROTECTED]> wrote: > My understanding is that every apache child pulls in all modules > (mod_python, mod_perl, mod_php, mod_your_favorite_mod_here) which all > consume memory. So you end up with loads of processes using ??MB of RAM > to serve up e.g. a

Re: Prevent URLs from being called directly

2007-03-30 Thread Arvin Schnell
On Fri, Mar 30, 2007 at 03:01:44AM -0700, Helge wrote: > > Hi, > > I have a function in my views.py that expects POST data from a form. > As long as this function is called correctly, i. e. from within the > form, everything works fine. But if I call this function directly by > typing it in the

Re: Securing the admin site

2007-03-30 Thread trickyb
On Mar 30, 2:37 am, "James Bennett" <[EMAIL PROTECTED]> wrote: > I guess I'm not sure what's meant by "securing" here; accessing > anything in the admin app requires the user to be authenticated and > marked as staff first. And there's really no harm in someone stumbling > across the admin login

Re: Prevent URLs from being called directly

2007-03-30 Thread Malcolm Tredinnick
On Fri, 2007-03-30 at 03:01 -0700, Helge wrote: > Hi, > > I have a function in my views.py that expects POST data from a form. > As long as this function is called correctly, i. e. from within the > form, everything works fine. But if I call this function directly by > typing it in the URL, I'm

Prevent URLs from being called directly

2007-03-30 Thread Helge
Hi, I have a function in my views.py that expects POST data from a form. As long as this function is called correctly, i. e. from within the form, everything works fine. But if I call this function directly by typing it in the URL, I'm getting an error page complaining about missing data (which

admin utilites in front end view

2007-03-30 Thread stereoit
Hi, I'm trying to provide end users with a view into DB (syslog viewer), well actually I'm trying to imitate Admin part. I have pagination working, but is there a way how to use the filter bar and search form from admin part (I love them) in fronted view? I've searched groups and posts seems to

Re: Newform and i18n

2007-03-30 Thread olive
Ticket is #3877. I did not found a way to assign the ticket to you Malcom. It has been assigned to Hugo. On 30 mar, 08:53, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > On Fri, 2007-03-30 at 01:43 -0700, olive wrote: > > Hello, > > > Here is how I define a form in my views: > > > class

Re: Newform and i18n

2007-03-30 Thread Malcolm Tredinnick
On Fri, 2007-03-30 at 01:43 -0700, olive wrote: > Hello, > > Here is how I define a form in my views: > > class MyForm(forms.Form): > name= forms.CharField(label=_('Name')) > ... > > The problem is _('Name') is translated when I restart the server > (Django or Apache), > but

seeking experienced (german speaking) django and linux (ubuntu) user for conference in south germany

2007-03-30 Thread mpathy
Hi There! I'm Markus Majer, and I'm from the german Ubuntu community. I plannig a ubuntu / open source booth at a web developer confernce in Ludwigsburg called "Webinale 2007".. Some english information is provided here:

Newform and i18n

2007-03-30 Thread olive
Hello, Here is how I define a form in my views: class MyForm(forms.Form): name= forms.CharField(label=_('Name')) ... The problem is _('Name') is translated when I restart the server (Django or Apache), but not when I switch the browser locale. I tried both from

Re: Long time process and FCGI

2007-03-30 Thread Atilla
Well, one thing that you could do is to execute an external script from your view. Then you'd immediatelly return from the view, and the script could mail them in the background. That is, of course, if you don't need any feedback to be displayed. If you do need to do something like that, you'll

Re: a very slow view, > 30secs to load

2007-03-30 Thread Milan Andric
On Mar 30, 1:08 am, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > > I'm confused. First you said it took 0.2 seconds, then you say it took > 47 seconds and then 3 seconds. Both of those numbers are bigger than > 0.2. I know this because I took advanced maths courses at university. > Yea, I

Re: Django/mod_python high memory usage - possible leak?

2007-03-30 Thread Steven Armstrong
[EMAIL PROTECTED] wrote on 03/29/07 20:15: > I'm running a production Django application on two loadbalanced > webservers and a single, dedicated Postgres server handling around > 500k requests/day. I'm using memcached, and my database server > performance has been fantastic. > > Lately, I've

Re: User profile and sliding date range data model?

2007-03-30 Thread David Reynolds
On 30 Mar 2007, at 9:21 am, David Reynolds wrote: > > One of the things that annoys me about datetime is that it doesn't > handle leap years properly. However, if you use python-dateutil[1] it > has a relativedelta so you can do things like: > datetime.date.today()+relativedelta(years=+3)

Re: User profile and sliding date range data model?

2007-03-30 Thread David Reynolds
On 30 Mar 2007, at 2:32 am, James Bennett wrote: > > On 3/29/07, Rob Hudson <[EMAIL PROTECTED]> wrote: >> I can't think of a way to account for "up to last 3 years" and "up to >> the next 5 years" or variation thereof. > > paid_up_until = models.DateField() > > Then use Python's standard

Re: a very slow view, > 30secs to load

2007-03-30 Thread Malcolm Tredinnick
On Fri, 2007-03-30 at 07:49 +, Milan Andric wrote: > > > On Mar 29, 8:31 pm, "Gary Wilson" <[EMAIL PROTECTED]> wrote: [...] > > When you say that the view is functioning very quickly, do you mean > > the time from request to page render? If so, the template is already > > getting run and

Re: development server

2007-03-30 Thread Tim Chase
> The terminal being scrambled part of the story is strange. It sounds > like your terminal settings are a bit screwy, but it's always hard to > diagnose that. One thing you could try to debug this is to redirect > stdout and stderr to a file when you start manage.py, then you/we > could have

Re: a very slow view, > 30secs to load

2007-03-30 Thread Milan Andric
On Mar 29, 8:31 pm, "Gary Wilson" <[EMAIL PROTECTED]> wrote: > On Mar 29, 2:26 pm, "Milan Andric" <[EMAIL PROTECTED]> wrote: > > > But in the dev environment I can see pretty well that the view is > > functioning very quickly. So your hunch about the problem lying in > > the templates is

Re: Automated deployment

2007-03-30 Thread James Bennett
On 3/30/07, IvanK <[EMAIL PROTECTED]> wrote: > Now I come from the rails camp (obviously deserting :)) and I've been > wondering does Django has anything like capistrano for automated > deployment, cause it's really easy with rails to just write "rake > deploy" and have your production be in sync

AttributeError: 'module' object has no attribute 'myapp'

2007-03-30 Thread Vinay Sajip
I created a vanilla project using 'django-admin.py startproject mysite' and then created a vanilla app in mysite using 'manage.py startapp myapp'. I ensured that 'mysite.myapp' was added to mysite.settings.INSTALLED_APPS, and also updated some other settings in mysite.settings.py. All well and