Re: Viewing uploaded files via the admin interface

2009-12-09 Thread Lukas
Yay, big thanks. It works now. On 9 Dez., 07:30, Karen Tracey wrote: > On Tue, Dec 8, 2009 at 4:42 PM, Lukas wrote: > > Hi everyone, > > > i've a problem viewing uploaded files via the admin interface. When I > > try to view the file, everything I get is a ValueError exception: > > invalid liter

Re: CharField cannot have a "max_length" greater than 255 when using "unique=True"

2009-12-09 Thread bruno desthuilliers
On 8 déc, 19:21, germ wrote: > > The point is that utf8 can use up to 3 bytes per character... > > i appreciate your reply. interesting distinction between bytes and > chars. Been here, done that :-/ > i think i still need some more guidance. still not sure how to > resolve with your suggestion

Django-admin edit-form & change-list doesn't show to_field column

2009-12-09 Thread Kostas M
Lets consider a simple case with a ForeignKeyField: class Model1(models.Model): code1 = models.IntegerField() code2 = models.CharField() def __unicode__(self): return unicode(self.code1) class Model2(models.Model): mycode = models.ForeignKey(Model1

Re: question about modelform lifecycle

2009-12-09 Thread bruno desthuilliers
On 9 déc, 06:29, chefsmart wrote: > At what point in a modelform's lifecycle does the underlying object > become accessible? > Specifically, can I access the underlying object in > a modelform's "clean" method? >  Or is it only after one does form.save > () with or without commit = False? Use the

Re: ManyToOne to auth.models.User

2009-12-09 Thread Itay Donenhirsch
use a userprofile see http://docs.djangoproject.com/en/dev/topics/auth/, search for "userprofile" also take a look at http://www.b-list.org/weblog/2006/jun/06/django-tips-extending-user-model/ On Tue, Dec 8, 2009 at 11:53 PM, TiNo wrote: > On Tue, Dec 8, 2009 at 12:58, Itay Donenhirsch wrote: >

Re: question about modelform lifecycle

2009-12-09 Thread chefsmart
Brilliant! Thanks. Just to make it clear for anyone else reading, doing self.instance.pk gives me what I want. I am not really an expert at any level, have no formal training, and am just poking around the "dark alley of code" to find my way, so am just hoping what I am doing is right ;) Regards

Re: Help with apache mod rewrite engine

2009-12-09 Thread Graham Dumpleton
On Dec 9, 6:16 pm, Lakshman Prasad wrote: > You can just replace the regex ^/comments/$ with ^/sees/comments/$ within > the urls.py > > Why can't you do that? Because it will not work. Based on description he is mounting Django application on /sees in Apache, likely as: WSGIScriptAlias /see

Re: import twice when run test

2009-12-09 Thread Dan Fairs
Hi, > > > can't i put "from models import *" in the test code? what should i do? > > This happens if you import the same file using two different names. Eg, here > you are importing it as 'from models import *'. In some other part of your > code, you probably have 'from foo.models import *'. Pytho

Re: import twice when run test

2009-12-09 Thread David De La Harpe Golden
>> Python treats them as >> two different files, and hence the signal is attached twice. > -> models.signals.post_save.connect(flaggedentry_post_save, > sender=FlaggedEntry) > Or is there likely to be something else we've got wrong > in our app? > Well, just in case - watch out for the dispatch

Re: import twice when run test

2009-12-09 Thread Dan Fairs
Hi David, > models.signals.post_save.connect(flaggedentry_post_save, > sender=FlaggedEntry, dispatch_uid='mofin.store.models') Top tip - this worked perfectly. I see this is documented only on the wiki, I couldn't find it in the official docs. > I've found a useful place to put signal registrati

Re: import twice when run test

2009-12-09 Thread Doug Blank
On Thu, Nov 26, 2009 at 6:01 AM, Tom Evans wrote: > On Thu, Nov 26, 2009 at 2:35 AM, fallhunter wrote: >> >> i have this code in my tests.py: >> >> from models import * >> >> and in the models.py I have a signal handler and register it with >> >> post_save.connect( post_save_note, sender=Note ) >

Expiry Date

2009-12-09 Thread Djangobot
Hi all I am very new to Django and Python and I was wondering if anyone could help me on here as I am desperate for help. I am designing a mobi. site and I need to somehow set an expiry date on the competitions that will be run on the site. I have added the field expiry date as a DateField in th

How can child objects inherit data from parents?

2009-12-09 Thread Eric Chamberlain
Hello, We're not sure how can we represent the following data structure in the django model? Grandparent Object First Name - NULL Last Name - NULL City - Anytown Ancestor Object - NULL Parent Object First Name - Bob Last Name - Smith City

Re: Coltrane Weblog Practical Django Projects 2nd Ed, page not found for http://127.0.0.1:8000/weblog/

2009-12-09 Thread Mark Freeman
Bernard, You need to put the url for weblog above flat pages. The empty string '' is catching everything and it never sees your weblog url. Mark On Dec 8, 7:39 am, bernard wrote: > Hi all, > > I am reading through the Practical Django Projects 2nd Edition book > and i am now on the weblog entri

Re: Coltrane Weblog Practical Django Projects 2nd Ed, page not found for http://127.0.0.1:8000/weblog/

2009-12-09 Thread Mark Freeman
Bernard, I originally replied by email, so this may get double posted. Your problem is that you have the URL for the flat pages module above the one for the weblog. The empty string '' is basically a catch all, which is stopping it from ever seeing the weblog. When Django parses the URLs, it does

jsonpickle

2009-12-09 Thread elminio
Hi, I downloaded and installed on windows Jsonpickle In normal python script everything works fine (import jsonpickle) but I dont know how to use it in my django app (in views import jsonpickle doesnt work) - no module named jsonpickle thanks for help -- You received this message because you a

Help me with django templates

2009-12-09 Thread Biju Varghese
{%for jobsp in jobspecs%} {%ifequal jobsp.id jobtitle.jobspec_id %} {{jobsp.id}} {%endifequal%} {%endfor%} -select- {%for jobspec

Setting up a DB connection manually

2009-12-09 Thread BlueBird
Hi, I have a setup where I need to create manually a connection to a SQLite DB. I haven't really succeeded in doing that so far. More precisely, I am running a test suite which uses django.test.utils.setup_test_environment() and the test DB defined settings.TEST_DATABASE_NAME. That works well in

Re: How can child objects inherit data from parents?

2009-12-09 Thread bruno desthuilliers
On 9 déc, 14:10, Eric Chamberlain wrote: > Hello, > > We're not sure how can we represent the following data structure in the > django model? > > Grandparent Object >         First Name - NULL >         Last Name - NULL >         City - Anytown >         Ancestor Object - NULL > > Parent Object >

Re: django error page: traceback too shallow?

2009-12-09 Thread Larrik Jaerico
I've definitely experienced missing levels in the traceback. I don't have anything reproducible, but notcourage isn't making it up. On Dec 8, 8:37 am, Karen Tracey wrote: > On Thu, Dec 3, 2009 at 1:24 AM, notcourage wrote: > > def home (request): > > >        if (request.user.is_authenticated())

newbie following intro-tutorial01 snag -- mysql login fails from python manage.py syncdb

2009-12-09 Thread john_griessen
When I login to mysql from a shell as user django_editor, I can change tables in a database I've called django_server. settings.py contains DATABASE_NAME = 'django_server' # Or path to database file if using sqlite3. DATABASE_USER = 'django_editor' python manage.py syncdb results in

Re: Help me with django templates

2009-12-09 Thread Daniel Roseman
On Dec 9, 2:18 pm, Biju Varghese wrote: > >                 {%for jobsp in jobspecs%} >                         {%ifequal jobsp.id jobtitle.jobspec_id %} >                                 {{jobsp.id}} >                         {%endifequal%} >                 {%endfor%} >                        

Re: Expiry Date

2009-12-09 Thread Daniel Roseman
On Dec 9, 12:07 pm, Djangobot wrote: > Hi all > > I am very new to Django and Python and I was wondering if anyone could > help me on here as I am desperate for help. > > I am designing a mobi. site and I need to somehow set an expiry date > on the competitions that will be run on the site. > > I

Blocking services in django

2009-12-09 Thread David Koblas
I'm trying to get a better understanding of django performance in a production setting. Specifically I've seen notes that say that operations like sending mail will block all production traffic to your server for the duration of the send. That got me thinking about other backend calls, like se

Could Django model dynamically create new class with new table?

2009-12-09 Thread Huang Dong
Suppose I have a class "Book". Typically Django will create a table in database for the class. If there are millions or even billions of books, I don't want to place them into one large table. Instead, I want to group them into different tables ("libraries"), in order to speed up querying given

Re: Could Django model dynamically create new class with new table?

2009-12-09 Thread bruno desthuilliers
On 9 déc, 17:26, Huang Dong wrote: > Suppose I have a class "Book".  Typically Django will create a table > in database for the class.  If there are millions or even billions of > books, I don't want to place them into one large table.  Instead, I > want to group them into different tables ("libra

Question about forms in templates

2009-12-09 Thread jul
Hi, I'm not very clear on how forms work. In the form below, both fields are required. When not filling anything and clicking submit, I got the error messages. Since I didn't specified any action, how can the form know that the form is not valid and get the error messages? Thanks for any explanat

Re: Question about forms in templates

2009-12-09 Thread Daniel Roseman
On Dec 9, 5:14 pm, jul wrote: > Hi, > > I'm not very clear on how forms work. > In the form below, both fields are required. When not filling anything > and clicking submit, I got the error messages. > Since I didn't specified any action, how can the form know that the > form is not valid and get

Re: how to avoid pk collisions at loaddata time

2009-12-09 Thread Phlip
On Dec 8, 5:13 pm, Russell Keith-Magee wrote: > fixture)? As always, suggestions are welcome. The suggestion is - template the json - name each record - the PK is the hash of the name - link FKs by name, so they get the same hash That way a reader can see an PK or FK, stick in its hash, an

Override length of CharField on admin form

2009-12-09 Thread derek
After much searching, the closest answer I can find for this is here: http://groups.google.com/group/django-users/browse_thread/thread/24edd54c637f19a7 with the "solution" being: text = forms.CharField(label="text", max_length=10, widget=forms.TextInput( attrs={'size':'10',

Error creating and saving a Django-object from the other script

2009-12-09 Thread tezro
Hi everyone. I'm using Django 1.1.0, importing it and using in another file "robot_parser.py". I've been using it for months. The script aggregates news from different sources and saves them using Django ORM. Presently I used primary key for urls (http://www.site.com/ news/2009/jan/12/72828/), but

Testing and request META data

2009-12-09 Thread Phlip
On Aug 14 2008, 5:39 am, "Hajo Smulders" wrote: > I need to set the HTTP_REFERER in the request.META data of a test client so > that i can unit test a view. > How do I do this? ie: How do i fake an HTTP header on a test client? Bump? I just hit this problem, and the above question is the only tr

Problems witch Apache - KeyError at / - 'HOME'

2009-12-09 Thread edward9
Hello everybody I'm new and i want to say Hello to Everybody. I have problem with Apache. I install python, django, apache, mod_apache and all what is necessary. Apache configuration is: SetHandler python-program PythonHandler django.core.handlers.modpython

Re: Could Django model dynamically create new class with new table?

2009-12-09 Thread HUANG Dong
Thank you, Bruno. Your answer is really helpful and covered another issue I hadn't noticed yet. But my question may be related to different topic. In my example, number of "libraries" is unknown in develop time, neither does the classification of "books". To be more specific, I want to employ s

Re: newbie following intro-tutorial01 snag -- mysql login fails from python manage.py syncdb

2009-12-09 Thread John Griessen
The problem logging in to mysql was with how I created the new user. Nevermind :-) JG -- 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 unsubscribe from this group, send

Re: Could Django model dynamically create new class with new table?

2009-12-09 Thread Nick Arnett
On Wed, Dec 9, 2009 at 11:18 AM, HUANG Dong wrote: > Thank you, Bruno. Your answer is really helpful and covered another > issue I hadn't noticed yet. But my question may be related to > different topic. In my example, number of "libraries" is unknown in > develop time, neither does the classi

Strange django behaviour

2009-12-09 Thread Maksymus007
For a few weeks I observe strange django behaviour - from time to time I get mails about AttributeError: 'NoneType' object has no attribute 'company' in line 121, which is: cursor.execute("SELECT * FROM interface.stats_sms_errors(%d, '%s'::timestamp with time zone, '%s'::timestamp with time zone

Stuck trying integrate jinja2 - need compatibility extensions

2009-12-09 Thread Todd Blanchard
OK, first let me start by saying I tried to live with the django template processor. But I need more power. I like jinja2's macros - much slicker than having to write a custom tag. So I've downloaded jinja2 and installed it. Good. After trying a couple of integration recipes on the web that

Re: Could Django model dynamically create new class with new table?

2009-12-09 Thread bruno desthuilliers
On 9 déc, 20:18, HUANG Dong wrote: > Thank you, Bruno.  Your answer is really helpful and covered another > issue I hadn't noticed yet.  But my question may be related to > different topic.  In my example, number of "libraries" is unknown in > develop time, neither does the classification of "book

Re: Error creating and saving a Django-object from the other script

2009-12-09 Thread bruno desthuilliers
On 9 déc, 18:58, tezro wrote: (snip) > > That throws an error: TypeError: 'slug' is an invalid keyword argument > for this function. > > What am I doing wrong? Not posting the full traceback - tracebacks are here to help debugging a problem, not to fill your term with random gibberish !-) --

Re: Error creating and saving a Django-object from the other script

2009-12-09 Thread tezro
That was really smart of you, thanks... Here's the traceback, hope it helps. --- Traceback (most recent call last): File "", line 1, in File "robot_parser.py", line 383, in update news = Element(source = the_source, title = title, date = date_published, short = short, full = full, link =

python manage.py list_apps

2009-12-09 Thread Phlip
Djangoids: Given a large application with many apps (could have been called Packages), how to rip out a list of all of them? My initial guess, in the subject line, naturally did not work. -- Phlip http://c2.com/cgi/wiki?MoreliaViridis -- You received this message because you are subscribed

Re: python manage.py list_apps

2009-12-09 Thread Christophe Pettus
On Dec 9, 2009, at 2:11 PM, Phlip wrote: > Given a large application with many apps (could have been called > Packages), how to rip out a list of all of them? Aren't they listed in settings.py? -- -- Christophe Pettus x...@thebuild.com -- You received this message because you are subscribe

Admin two-field ordering resorted by table template: way to turn off?

2009-12-09 Thread Jennifer Bell
I would like my objects to be ordered by two (or more) fields when viewed in the admin changelist. However, I noticed that ordering only works for the first field listed. I'm pretty sure this is because the order of the objects given to the template is overridden by the javascript sort in the def

Re: Blocking services in django

2009-12-09 Thread Russell Keith-Magee
On Wed, Dec 9, 2009 at 11:50 PM, David Koblas wrote: > I'm trying to get a better understanding of django performance in a > production setting. > > Specifically I've seen notes that say that operations like sending mail will > block all production traffic to your server for the duration of the se

Re: python manage.py list_apps

2009-12-09 Thread Phlip
> > Given a large application with many apps (could have been called > > Packages), how to rip out a list of all of them? > > Aren't they listed in settings.py? Hmm. I could have just done python shell -> INSTALLED_APPS instead, I used find .. -name tests.py, and then some cuts and greps. Silly m

Re: how to avoid pk collisions at loaddata time

2009-12-09 Thread Russell Keith-Magee
On Thu, Dec 10, 2009 at 1:23 AM, Phlip wrote: > On Dec 8, 5:13 pm, Russell Keith-Magee wrote: > >> fixture)? As always, suggestions are welcome. > > The suggestion is > >  - template the json I'm not sure how this helps. We already have a 100% reliable method for generating JSON - it's called Si

Re: Testing and request META data

2009-12-09 Thread Russell Keith-Magee
On Thu, Dec 10, 2009 at 2:06 AM, Phlip wrote: > On Aug 14 2008, 5:39 am, "Hajo Smulders" > wrote: > >> I need to set the HTTP_REFERER in the request.META data of a test client so >> that i can unit test a view. >> How do I do this? ie: How do i fake an HTTP header on a test client? > > Bump? I ju

Re: Stuck trying integrate jinja2 - need compatibility extensions

2009-12-09 Thread Michael Elsdörfer
Todd, I recommend that you have a look at Coffin: http://github.com/dcramer/coffin It comes with a {% url %} that should work out of the box. The snippets you linked are not tags, but functions, that is, you would do something like: {{ url('my_view') }} You need the pass the functions in

Re: Problems witch Apache - KeyError at / - 'HOME'

2009-12-09 Thread Karen Tracey
Did you restart Apache after making all your code changes? Please click the Switch to copy-and-paste view link and cut and paste the contents of the text box that will appear. The other version is not good for pasting into email. Karen -- You received this message because you are subscribed to

Re: Strange django behaviour

2009-12-09 Thread Karen Tracey
On Wed, Dec 9, 2009 at 3:09 PM, Maksymus007 wrote: > For a few weeks I observe strange django behaviour - from time to time > I get mails about > > AttributeError: 'NoneType' object has no attribute 'company' > > in line 121, which is: > > cursor.execute("SELECT * FROM interface.stats_sms_errors(

Re: how to avoid pk collisions at loaddata time

2009-12-09 Thread Phlip
On Dec 9, 3:10 pm, Russell Keith-Magee wrote: > Ok; using some non-pk value for PK references is certainly one way to > handle this. There is an issue around how to resolve a hash into an > actual pk value, but that shouldn't be impossible. In Rails, a YAML (JSON) fixture like this... norber

Django Sites in Admin Forms

2009-12-09 Thread bfrederi
In one of my models, I have a foreign key to Django's Site model. When I view my model in admin, it displays the Site entries by their domain (in the __unicode__ method). Is there any way to display the name of the Site instead of the domain in admin? -- You received this message because you are

how to produce XML output from a test run?

2009-12-09 Thread Phlip
Djangoes: Here's a sketch of an XmlTestRunner. http://pypi.python.org/pypi/XmlTestRunner/0.16654 The point is to decorate all the test names (and asserts?), and show them off, probably with XSLT to HTML to a web page. To plug a new test runner into Django, you apparently add to settings.py: TE

Re: how to avoid pk collisions at loaddata time

2009-12-09 Thread Russell Keith-Magee
On Thu, Dec 10, 2009 at 7:59 AM, Phlip wrote: > On Dec 9, 3:10 pm, Russell Keith-Magee wrote: > >> Ok; using some non-pk value for PK references is certainly one way to >> handle this. There is an issue around how to resolve a hash into an >> actual pk value, but that shouldn't be impossible. > >

How to choose one row of data

2009-12-09 Thread Andy
This is a very beginner question: Say a user has just filled out a form and hit the submit button. They are redirected to an order confirmation page. How can I retrieve the one row of data the user just submitted and display it on the order confirmation page? Here is my simple View so far, but

Re: how to produce XML output from a test run?

2009-12-09 Thread Russell Keith-Magee
On Thu, Dec 10, 2009 at 8:24 AM, Phlip wrote: > Djangoes: > > Here's a sketch of an XmlTestRunner. > > http://pypi.python.org/pypi/XmlTestRunner/0.16654 > > The point is to decorate all the test names (and asserts?), and show > them off, probably with XSLT to HTML to a web page. > > To plug a new

Re: how to produce XML output from a test run?

2009-12-09 Thread Phlip
On Dec 9, 4:52 pm, Russell Keith-Magee wrote: > If you want to use an XML test runner instead of the default > Text-based runner, take a copy of django.test.simple.run_tests() and > modify to suit your requirements. > > I will admit that this isn't a great solution It is because it's easy after

Re: how to produce XML output from a test run?

2009-12-09 Thread Russell Keith-Magee
On Thu, Dec 10, 2009 at 9:02 AM, Phlip wrote: > On Dec 9, 4:52 pm, Russell Keith-Magee wrote: > >> If you want to use an XML test runner instead of the default >> Text-based runner, take a copy of django.test.simple.run_tests() and >> modify to suit your requirements. >> >> I will admit that this

Django 1.1 - comments - ‘render_comment_for m’ returns TemplateSyntaxError

2009-12-09 Thread Kenny Meyer
Hello, I want to simply render a built-in comment form in a template, using Django's builtin commenting module, but this returns a TemplateSyntaxError Exception. I need help debugging this error, please, because after googling and using the Django API reference, I'm still not getting any farther.

Re: How to choose one row of data

2009-12-09 Thread Shawn Milochik
If you assign the output of the save() method, you'll get the created object. Instead of: form.save() do: current_order = form.save() Then you can do whatever you like with current_order, which will be an instance of whatever the class 'meta' is of your OrderForm, assuming that OrderForm is a

newbie question on 'clean_' functions

2009-12-09 Thread Kenneth McDonald
In the following bit of code: from django import forms class BuySellForm(forms.Form): symbol = forms.CharField() shares = forms.CharField() price = forms.CharField() print "DATA" def clean_shares(self): print "DATA KEYS", self.data.keys() the BuySellForm con

Re: newbie question on 'clean_' functions

2009-12-09 Thread Kenneth McDonald
P.S. Yes, the form was correctly submitted. Thanks, Ken On Dec 9, 2009, at 8:16 PM, Kenneth McDonald wrote: > In the following bit of code: > > > > from django import forms > > class BuySellForm(forms.Form): > symbol = forms.CharField() > shares = forms.CharField() > price = forms.Ch

Performance monitoring

2009-12-09 Thread Kegan Gan
Hi, Google App Engine provides a rather extensive set of tools to monitor the performance of your applications running in App Engine. Is there something similar for Django? Thanks. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to thi

Re: Django 1.1 - comments - ‘render_comment_form ’ returns TemplateSyntaxError

2009-12-09 Thread Karen Tracey
On Wed, Dec 9, 2009 at 8:24 PM, Kenny Meyer wrote: > > /urls.py[shortened]: > urlpatterns = patterns('', >(r'', include('posts.urls')), >(r'^comments/$', include('django.contrib.comments.urls')), > ) > > Remove the $ from the end of the pattern for the comment urls. Karen -- You receiv

Re: newbie question on 'clean_' functions

2009-12-09 Thread Karen Tracey
On Wed, Dec 9, 2009 at 9:16 PM, Kenneth McDonald < kenneth.m.mcdon...@sbcglobal.net> wrote: > In the following bit of code: > > > > from django import forms > > class BuySellForm(forms.Form): > symbol = forms.CharField() > shares = forms.CharField() > price = forms.CharField() > pr

Re: newbie question on 'clean_' functions

2009-12-09 Thread Kenneth McDonald
> And the code to create and validate the form is...? That might help > in figuring out what is wrong. > Sure. It's just: def buysell(request): form = BuySellForm() return render_to_response('buysellform.html', {'form': form}) in file 'buysell.py', and is referenced as http://..

Jobs for DJango newbies?

2009-12-09 Thread Kenneth McDonald
Where would one find such beasties? Once I've taught myself Django, I'd like to think I might be able to get some sort of job with it, albeit a very junior one. Thanks, Ken -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this gro

Re: newbie question on 'clean_' functions

2009-12-09 Thread Kenneth McDonald
Oops, wrong HTML down there. The actual HTML is: {{ form.as_table }} On Dec 9, 2009, at 9:21 PM, Kenneth McDonald wrote: > >> And the code to create and validate the form is...? That might help >> in figuring out what is wrong. >> >

django-tagging - how to retrieve individual tags for specific models without duplicates

2009-12-09 Thread neridaj
Hello, I can't figure out how to retrieve tags for specific models i.e., I would like to show tags for entries if I'm on a blog/entry page, tags for links if I'm on a blog/links page, etc. If I use {{ entry.tags }} in the templates I get duplicate tags and if an entry has more than one tag those t

Re: newbie question on 'clean_' functions

2009-12-09 Thread Karen Tracey
On Wed, Dec 9, 2009 at 10:21 PM, Kenneth McDonald < kenneth.m.mcdon...@sbcglobal.net> wrote: > > > And the code to create and validate the form is...? That might help > > in figuring out what is wrong. > > > Sure. It's just: > > > > def buysell(request): > form = BuySellForm() > return re

Re: newbie question on 'clean_' functions

2009-12-09 Thread Rishabh Manocha
On Thu, Dec 10, 2009 at 11:21 AM, Kenneth McDonald wrote: > >> And the code to create and validate the form is...?  That might help >> in figuring out what is wrong. >> > Sure. It's just: > > > > def buysell(request): >     form = BuySellForm() >     return render_to_response('buysellform.html', {

Re: newbie question on 'clean_' functions

2009-12-09 Thread Rishabh Manocha
On Thu, Dec 10, 2009 at 12:12 PM, Rishabh Manocha wrote: > On Thu, Dec 10, 2009 at 11:21 AM, Kenneth McDonald > wrote: >> >>> And the code to create and validate the form is...?  That might help >>> in figuring out what is wrong. >>> >> Sure. It's just: >> >> >> >> def buysell(request): >>     fo

Re: Performance monitoring

2009-12-09 Thread Andy McKay
On 09-12-09 6:43 PM, Kegan Gan wrote: > Google App Engine provides a rather extensive set of tools to monitor > the performance of your applications running in App Engine. Is there > something similar for Django? Not that I know of. There's django-debug-toolbar and a quick hack I wrote to track t

Re: Expiry Date

2009-12-09 Thread Djangobot
Thank you Daniel for your kind help. I will use your method as I think it would be the best solution. Have a great day. On Dec 9, 5:37 pm, Daniel Roseman wrote: > On Dec 9, 12:07 pm, Djangobot wrote: > > > > > > > > > Hi all > > > I am very new to Django and Python and I was wondering if anyone

Re: Performance monitoring

2009-12-09 Thread Kegan Gan
Thanks for reply, Andy. I am aware of django-debug-toolbar. I am looking something to run with production. How do people monitor Django application performance in production environment today? Thanks. On Dec 10, 12:28 pm, Andy McKay wrote: > On 09-12-09 6:43 PM, Kegan Gan wrote: > > > Google A

Re: Performance monitoring

2009-12-09 Thread Andy McKay
On 09-12-09 8:43 PM, Kegan Gan wrote: > Thanks for reply, Andy. > > I am aware of django-debug-toolbar. I am looking something to run with > production. > > How do people monitor Django application performance in production > environment today? Hmm I guess if I knew what you were looking for I cou

Re: Performance monitoring

2009-12-09 Thread Sam Walters
You can always place some more performance testing code inside your views: import time t = time.time() search_time=0.00 # #place some code which hits the database here # search_time+=time.time()-t search_time="%.3f"%(search_time) This does not test the memory footprint of your

strange error :'NoneType' object has no attribute 'source'

2009-12-09 Thread gganesh
hi group, I am struck with this strange error message Request Method: GET Request URL:http://127.0.0.1:8000/admissions/enquiry/add/ Exception Type: AttributeError Exception Value: 'NoneType' object has no attribute 'source' Exception Location: /usr/local/lib/python2.6/dis

Re: Could Django model dynamically create new class with new table?

2009-12-09 Thread HUANG Dong
Sorry, my original description may be a bit misleading. In summary, all I want is to create multiple table through Django's "Model" way. Yes, I know this can be done using metaclass. I just did not know how to integrate it into Django's model, and the impacts. Fortunately, it seems Django has a

Re: Performance monitoring

2009-12-09 Thread Mikhail Korobov
Performance monitoring doesn't have to be related to django itself. There are external projects that cant do performance monitoring (CPU, i/o, memory usage over time). You may give munin (http:// munin.projects.linpro.no/) a chance. On Dec 10, 7:43 am, Kegan Gan wrote: > Hi, > > Google App Engine

design starting question

2009-12-09 Thread Mike Dewhirst
I want to design a site to replace an existing one running on my client's Windows 2008 server. Currently, external users are given manually generated basic auth login credentials to view their own directory on the server. It is running Apache 2.2 and there is zero html and no database. The doc

Django documentation error? (minor, but misleading)

2009-12-09 Thread chefsmart
On the page http://www.djangoproject.com/documentation/models/many_to_many/ under Sample API Usage where it says: - " # Add a Publication directly via publications.add by using keyword arguments. >>> new_publication = a2.publications.create(title='Highlights for Children') " I think it should sa

Re: Problems witch Apache - KeyError at / - 'HOME'

2009-12-09 Thread edward9
Yes. I restart Apache every configuration change. Error from text box: Environment: Request Method: GET Request URL: http://127.0.0.1/ Django Version: 1.0.2 final Python Version: 2.5.4 Installed Applications: ['django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'dj