Re: Help with Django installation on OSX 10.4.10

2007-08-27 Thread Brandon Taylor
Hi Joe, One more question... So Django is woring correctly which is great, but I can't seem to get mod_python working for Apache 2. I have the latest version of Apache 2.2.4 and mod_python 3.3.1. I've added the "LoadModule" call to my httpd.conf and Apache isn't complaining. I moved my

Re: is 40 MB RAM enough?

2007-08-27 Thread Paul Rauch
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Kenneth Gonsalves schrieb: > Hi, > > I have a site on WebFaction with 40 MB RAM. It is a very small site > in the sense that it is used for administering an organisation, so > would have just 2-3 users at a time, mainly doing admin stuff. The

objects.get overhead: at least 2 times slower than a select

2007-08-27 Thread Kugutsumen
Why is my select is 2 times faster than objects.get(name=domain)? Why is there so much overhead? d = Domain.objects.get(name=domain) [...] Checked 9 domains at 1434 domain/s Now if instead I just do: cursor.execute("""SELECT id,name from "DNS_domain" WHERE name='%s' """ % domain) row =

Re: is 40 MB RAM enough?

2007-08-27 Thread Graham Dumpleton
On Aug 27, 4:47 pm, Paul Rauch <[EMAIL PROTECTED]> wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > Kenneth Gonsalves schrieb:> Hi, > > > I have a site on WebFaction with 40 MB RAM. It is a very small site > > in the sense that it is used for administering an organisation, so > >

Web developement with Python

2007-08-27 Thread AMBROSE
I need a clear info on why Python is good for enterprise web developement . Can Python be used for a website having several 100 page hits /sec ? I am not bothered of coding complexity . How about linux OS, ,Python and DB2 express edition for webdevelopement? Ambrose PeterMary.com -- coming

Re: How to fill in a comboField in a form

2007-08-27 Thread duna
Hello, I don't know how to do it, I have the same problem. I manage to do it defining the combo with the select html tag in the template directly but what I really want to use it in the way you explain (with form.ComboField). Any ideas? On 23 ago, 12:47, altahay <[EMAIL PROTECTED]> wrote: >

Re: How to fill in a comboField in a form

2007-08-27 Thread Iapain
ComboField takes a list of fields that should be used to validate a value, in that order. >>> f = ComboField(fields=[CharField(max_length=20), EmailField()]) If you just need a dropdown select then use choiceField >>>t = [('test','select')] >>>f = forms.ChoiceField(choices=t) On Aug 23, 4:47

Re: is 40 MB RAM enough?

2007-08-27 Thread Iapain
Yes it is, I am running a huge site on webfaction 40 MB, performance wise its excellent. On Aug 27, 7:57 am, Kenneth Gonsalves <[EMAIL PROTECTED]> wrote: > Hi, > > I have a site on WebFaction with 40 MB RAM. It is a very small site > in the sense that it is used for administering an

Re: Newbie: How to create different person models that share a profile model?

2007-08-27 Thread eXt
In case you didn't read it before: Here is very enlightening summary of things you can do with user model: http://www.amitu.com/blog/2007/july/django-extending-user-model/ regards -- Jakub Wiśniowski --~--~-~--~~~---~--~~ You received this message because you

Re: Dynamic OR queries

2007-08-27 Thread Nis Jørgensen
Steven Armstrong skrev: > Chris Hoeppner wrote on 08/25/07 18:40: > >> Hi there! >> >> I was just wondering how to dynamically "or" together an indetermined >> quantity of Q objects. They're constructed from a string like q=a+b+c, >> which would get stiched together as "(Q(field=a) |

Re: is 40 MB RAM enough?

2007-08-27 Thread Graham Dumpleton
On Aug 27, 12:57 pm, Kenneth Gonsalves <[EMAIL PROTECTED]> wrote: > Hi, > > I have a site on WebFaction with 40 MB RAM. It is a very small site > in the sense that it is used for administering an organisation, so > would have just 2-3 users at a time, mainly doing admin stuff. The > only load is

Re: is 40 MB RAM enough?

2007-08-27 Thread Kenneth Gonsalves
On 27-Aug-07, at 3:05 PM, Iapain wrote: > Yes it is, I am running a huge site on webfaction 40 MB, performance > wise its excellent. what is your RAM usage? How did you tweak apache to achieve that? -- regards kg http://lawgon.livejournal.com http://nrcfosshelpline.in/web/

Re: is 40 MB RAM enough?

2007-08-27 Thread Kenneth Gonsalves
On 27-Aug-07, at 4:07 PM, Graham Dumpleton wrote: >> in for more RAM? > > BTW, have you also made sure you have read: > > http://blog.webfaction.com/tips-to-keep-your-django-mod-python- > memory-usage-down yes > > Maybe your size problems are due to not turning debug off. it's off --

Re: Web developement with Python

2007-08-27 Thread Jon Atkinson
This is a very broad question, with some very ill-defined adjectives :-) Generally, given enough resources then Django can scale up to websites of 'enterprise' (what does that actually mean?) level. As is stated in the FAQ [1], Django sites have happily held up to million hits/hour

Re: Django app for locations? (countries, provinces, cities, venues...)

2007-08-27 Thread Nis Jørgensen
Austin Govella skrev: > Is there an existing Django app for managing locations? > > Specificall, countries, states/provinces, cities, and specific > locations with addresses. > > > > (I was just adding such an app to my project, but thought I might be > duplicating someone better effort...) >

dynamic links

2007-08-27 Thread Rufman
hey i want to make a link in my template dynamic. e.g. I want to click on a "rubric" that links to a view that displays all the content. I have the following URL patterns to reach the rubric: /rubric/view and to reach the content /bullet///view --> the link i need in the template that renders

Meta options`

2007-08-27 Thread Lic. José M. Rodriguez Bacallao
how can I add my custom options to the Meta model class? -- Lic. José M. Rodriguez Bacallao Cupet - Todos somos muy ignorantes, lo que ocurre es que no todos ignoramos lo mismo. Recuerda: El arca de Noe fue construida por

memcache: getting all cached keys?

2007-08-27 Thread patrickk
I´ve just used Fredriks cache view (http://effbot.org/zone/django- memcached-view.htm) and now I´d like to additionally display all cached sites/fragments. Question is: How do I get all the sites/fragments currently in cache? Thanks, patrick

Re: objects.get overhead: at least 2 times slower than a select

2007-08-27 Thread Jeremy Dunck
On 8/27/07, Kugutsumen <[EMAIL PROTECTED]> wrote: > > Why is my select is 2 times faster than objects.get(name=domain)? > > Why is there so much overhead? Have a look at the code. :) > d = Domain.objects.get(name=domain) [...] > Checked 9 domains at 1434 domain/s > > Now if instead I just

Re: objects.get overhead: at least 2 times slower than a select

2007-08-27 Thread Jeremy Dunck
On 8/27/07, Jeremy Dunck <[EMAIL PROTECTED]> wrote: > On 8/27/07, Kugutsumen <[EMAIL PROTECTED]> wrote: > > > > Why is my select is 2 times faster than objects.get(name=domain)? > > > > Why is there so much overhead? > > Have a look at the code. :) Ah, one more thing-- try commenting out the

Re: using django components outside of django

2007-08-27 Thread Nicola Larosa
Lee Connell wrote: > Will there be an issue using the django ORM in twisted, being an > asynchronous framework? Is there going to be threading issues i need > to be aware of? Yes, there are issues. :-) The ORM, as the whole of Django, is synchronous code, and not aware of the async events

UnicodeDecodeError with memcache

2007-08-27 Thread patrickk
With using the cache_page decorator, I´m getting a Unicode Error on my page: UnicodeDecodeError at /spezialprogramme/ 'ascii' codec can't decode byte 0x80 in position 0: ordinal not in range(128) Any ideas? Thanks, Patrick --~--~-~--~~~---~--~~ You received

Re: UnicodeDecodeError with memcache

2007-08-27 Thread Iapain
> UnicodeDecodeError at /spezialprogramme/ > 'ascii' codec can't decode byte 0x80 in position 0: ordinal not in > range(128) try using smart_str, it it doesnt work then use less restrictive decode --~--~-~--~~~---~--~~ You received this message because you are

Re: is 40 MB RAM enough?

2007-08-27 Thread Iapain
> what is your RAM usage? How did you tweak apache to achieve that? I didnt check RAM usage, but site always work like express instead i did clean coding and tried to optimize my code. --~--~-~--~~~---~--~~ You received this message because you are subscribed to

Re: UnicodeDecodeError with memcache

2007-08-27 Thread patrickk
so you say I should use __str__ instead of __unicode__, right? according to the django-docs, that´s not recommended though ... On 27 Aug., 16:40, Iapain <[EMAIL PROTECTED]> wrote: > > UnicodeDecodeError at /spezialprogramme/ > > 'ascii' codec can't decode byte 0x80 in position 0: ordinal not in

Audit Trail updates (was Re: Marty Alchin's AuditTrail)

2007-08-27 Thread George Vilches
perrito666 wrote: > Ah thank you, ill keep an eye, so far the only think I did to it was a > small hack to handle the error raised by trying to copy a fk to the > audit table but it is a not very clean hack. > Perrito. Took me an extra couple of days, but I've got all my modifications to

Re: objects.get overhead: at least 2 times slower than a select

2007-08-27 Thread James Bennett
On 8/27/07, Jeremy Dunck <[EMAIL PROTECTED]> wrote: > Ah, one more thing-- try commenting out the signalling. There's a > known performance issue there. Even without it, the ORM will be slower, and should be expected to be slower -- doing a straight select doesn't involve much overhead because

Re: dynamic links

2007-08-27 Thread Iapain
> i want to make a link in my template dynamic. e.g. I want to click on > a "rubric" that links to a view that displays all the content. I have > the following URL patterns to reach the rubric: /rubric/view and to > reach the content /bullet///view --> the link i > need in the template that

Re: dynamic links

2007-08-27 Thread James Bennett
On 8/27/07, Rufman <[EMAIL PROTECTED]> wrote: > Does anyone have an idea how i can get the day_id and rubric_id in a > link, if they are not attributes of the model that is being displayed? > (if i were hard coding with PHP i would just make them get or post > parameters)

Re: objects.get overhead: at least 2 times slower than a select

2007-08-27 Thread Jeremy Dunck
On 8/27/07, James Bennett <[EMAIL PROTECTED]> wrote: > There will never be a situation where that's as fast as the > straight select. from __future__ import wayback_machine :) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the

Re: objects.get overhead: at least 2 times slower than a select

2007-08-27 Thread John Melesky
On Aug 27, 2007, at 2:05 AM, Kugutsumen wrote: > cursor.execute("""SELECT id,name from "DNS_domain" WHERE name='%s' > """ > % domain) > row = cursor.fetchone() If you do just need those two fields, and no object methods, you can use the "values" queryset method. Something like: d =

Re: generating PDF using Reportlab's SimpleDocTemplate

2007-08-27 Thread abrightwell
You are absolutely right. I have tested this approach and for my purposes it is working great. Thanks for the insight. On Aug 23, 9:50 pm, Ned Batchelder <[EMAIL PROTECTED]> wrote: > You can probably skip the StringIO. HttpResponses support a file-like > interface, so you can write directly

Anonymous Users

2007-08-27 Thread Darrin Thompson
Reading the auth docs for Djano 0.96, it appears to me that there is no model backing the idea of an anonymous user. Before I read the docs I was expecting that I could let my model refer to users and some of them would be anonymous, some of them real. Now I'm sure that the Django developers

Re: Help with Django installation on OSX 10.4.10

2007-08-27 Thread Sydney Weidman
If I remember correctly, you'll see the file listing if you don't have handlers set properly for the location. What is in your httpd.conf or virtual host config file for the htdocs directory? I'm assuming you've looked at: http://www.djangoproject.com/documentation/modpython/ - syd On Aug 27,

Re: Newbie: How to create different person models that share a profile model?

2007-08-27 Thread rskm1
On Aug 24, 7:28 pm, "Ariel Mauricio Nunez Gomez" <[EMAIL PROTECTED]> wrote: > Note: The user profile part was taken from this useful blog entry on James > Bennet > site:http://www.b-list.org/weblog/2006/06/06/django-tips-extending-user-model Yeah, that's the advice I keep seeing when this

Re: how to get class name from a relation name

2007-08-27 Thread Grégoire Cachet
Thanks Russell, it works with the get_accessor_name() method combinated with the model attribute. 2007/8/23, Russell Keith-Magee <[EMAIL PROTECTED]>: > > > On 8/22/07, Grégoire Cachet <[EMAIL PROTECTED]> wrote: > > Hi, > > > > I would like to get the class name from a relation name (OneToOne) >

Re: Anonymous Users

2007-08-27 Thread r_f_d
I am not sure what exactly you want to model in regard to an 'anonymous' user. By definition, these would be users of an application that nothing is required to be known about and can only access information that is provided by views that do not require authenticated users. Generally, if you

Re: Web developement with Python

2007-08-27 Thread Joseph Heck
To answer your specific question about can Django handle 100 page hits/sec, the answer is yes. Like any other technology, how you achieve that scale depends on a lot of things other than just the framework. There's a nice (but not detailed) interview about Pownce at

Re: Anonymous Users

2007-08-27 Thread Darrin Thompson
On 8/27/07, r_f_d <[EMAIL PROTECTED]> wrote: > > Generally, if you want to track or store any > information about a specific user, you probably would want to create a > specific user object/db record for the user and require them to > authenticate. If you could be a bit more specific as far as

Re: Anonymous Users

2007-08-27 Thread Jay Parlar
On 8/27/07, Darrin Thompson <[EMAIL PROTECTED]> wrote: > I'm building a real estate search. I have existing and future > competition. It's to my advantage to track a few preferences and > favorites for anonymous users before they register. > > I'm pretty sure it isn't that hard and I'm not the

Re: Anonymous Users

2007-08-27 Thread James Bennett
On 8/27/07, Darrin Thompson <[EMAIL PROTECTED]> wrote: > I'm building a real estate search. I have existing and future > competition. It's to my advantage to track a few preferences and > favorites for anonymous users before they register. http://www.djangoproject.com/documentation/sessions/ --

Re: objects.get overhead: at least 2 times slower than a select

2007-08-27 Thread Kugutsumen
Thanks John, I am going to try that. That's what I was looking for. And to answer Jeremy, I don't understand why would I want to have name as a primary key. The surrogate autofield primary key does a much better job being referenced as a foreign key all over the place. Using adaptive-readahead

request_started signal

2007-08-27 Thread Michel Thadeu Sabchuk
Hi guys, I´m improving my forum app and I letting moderator add warnings to users. A moderator can´t add a warning to a user if this user got a warning on the last 2 minutes (to avoid 2 moderators give warning with the same subject). I don´t know how to trigger the admin interface and, when the

"Declarative" Forms with the Django newforms

2007-08-27 Thread Smel
Hi, I have posted about a simple way to reuse your model definition in a more flexible manner than the form_for_model way, and I want also to have a more nice html rendering than the as_p or as_table methods can do. if your are interested this is link , and there is also a demo project to

Re: Error when creating thumbnails based on a class that is edit_inline

2007-08-27 Thread Greg
Looking more into the problem i noticed that when I do a 'assert False, self.get_photo_filename()' I get nothing in return. When I do the same thing (without edit_inline) I get the the filename of the image. Does anybody know why when I use edit_inline my self.get_photo_filename statement from

Re: Problem in current svn TRUNK

2007-08-27 Thread Peter Nixon
On Wed 11 Jul 2007, Michael Radziej wrote: > Hi, > > you're using the alpha version of SuSE ... well ... there might very well > be a problem very deep in one of the libraries. The alpha releases aren't > very reliable. I'd suggest that you try it with another OS. Hi Guys I would like to point

single sign on for integrated django,trac and phpBB site

2007-08-27 Thread Ian Lawrence
Hi, I found this: http://automatthias.wordpress.com/2006/12/18/killing-phpbb-softly/ excellent post about phpBB and Django integration. I was wondering if anyone has integrated single sign on with trac?..it seems trac uses .htaccess and not a database table so maybe it is not possible? Thanks

Re: Newbie: How to create different person models that share a profile model?

2007-08-27 Thread Ariel Mauricio Nunez Gomez
Thanks a lot for pointing that out. My apologies. So, for other readers of the thread: class UserProfile(models.Model): user = models.ForeignKey(User, unique=True, edit_inline=models.TABULAR, num_in_admin=1,min_num_in_admin=1, max_num_in_admin=1,num_extra_on_change=0) : Makes the profile

Authenticating Django against FreeRADIUS

2007-08-27 Thread Peter Nixon
Maybe this code I whipped up tonight to teach Django to speak RADIUS will be usefull to someone... http://peternixon.net/news/2007/08/27/open-source/authenticating-django-against-freeradius/ Cheers -- Peter Nixon http://peternixon.net/ --~--~-~--~~~---~--~~

Re: Problem in current svn TRUNK

2007-08-27 Thread Jeremy Dunck
On 7/11/07, Peter Nixon <[EMAIL PROTECTED]> wrote: ... > In any case, I listed the important packages in use on the system: > postgresql-server-8.2.4-5 > python-2.5.1-12 > python-psycopg2-2.0.6-2.5 > python-django-snapshot-5646-1 > > While these are all new packages, the only one which is

newforms.form_for_model() does not map CharField with choices into SELECT

2007-08-27 Thread sagi s
I am generating a form for a model that contains a CharField with choices. According to the documentation I expect to see this translated into a SELECT form field but all I get is a simple TEXT form field: models.py: class Publication(models.Model): PUBLICATION_TYPES = ( ('B',

Re: How to access upload_to property of FileField in views?

2007-08-27 Thread daev
In view: upload_to = Jewel._meta.get_field( "file" ).upload_to --~--~-~--~~~---~--~~ 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

QuerySet & memory

2007-08-27 Thread Tomas Kopecek
Hello, I've thought, that QuerySets whose are iterated does not allocate memory for all objects. But simple test shows otherwise. When I iterate through SomeModel.objects.all() I get same memory consumption like with list(SomeModel.objects.all()). It is very frustrating, because with test

AttributeError

2007-08-27 Thread jorgehugoma
I'm unshelving an object that i wrote in the views module and a get AtributeError, 'module' object has no attribute Myobject. And run one of its functions. Any idea what i am doing wrong?? Jorge Hugo Murillo

Neo-Cons: Make Bush Dictator Of The World

2007-08-27 Thread [EMAIL PROTECTED]
Neo-Cons: Make Bush Dictator Of The World Maniacal right-wing Family Security Matters organization, which has ties to Cheney, Rumsfeld and Perle, carries screed that calls for Bush to declare martial law, become emperor of the planet, lifetime president, and ethnically cleanse Iraq by means of

Re: QuerySet & memory

2007-08-27 Thread Jeremy Dunck
On 8/27/07, Tomas Kopecek <[EMAIL PROTECTED]> wrote: > I've thought, that QuerySets whose are iterated does not allocate memory > for all objects. QuerySet.iterator does what you want. QuerySet.__iter__ (the python method that is called from the for loop) returns an iterator over the results of

Re: QuerySet & memory

2007-08-27 Thread Doug B
There isn't much difference. Once you ennumerate,slice, or iterate a queryset that's when the actual database query occurs. It will pull in all matching object in order to save you additional queries. Why not iterate in batches, by slicing the query? That way if you set you step to say 100,

Re: QuerySet & memory

2007-08-27 Thread James Bennett
On 8/27/07, Jeremy Dunck <[EMAIL PROTECTED]> wrote: > QuerySet.iterator does what you want. I was going to follow up with a documentation link, but it appears we lost the documentation for QuerySet.iterator at some point. Opened a ticket In any case, Jeremy's right: the "iterator" method

Re: is 40 MB RAM enough?

2007-08-27 Thread Kenneth Gonsalves
On 27-Aug-07, at 8:18 PM, Iapain wrote: >> what is your RAM usage? How did you tweak apache to achieve that? > > I didnt check RAM usage, but site always work like express instead i > did clean coding and tried to optimize my code. this is the command that webfaction uses to check RAM usage:

Re: Error loading MySQLdb module

2007-08-27 Thread [EMAIL PROTECTED]
where might I find the PYTHONPATH variable? On Aug 11, 6:39 pm, "James Bennett" <[EMAIL PROTECTED]> wrote: > On 8/11/07, Kelsey Ruger <[EMAIL PROTECTED]> wrote: > > > I have the same problem even though I have installedMySQLdb. > > Open up a Python interpreter, and try: > > importMySQLdb > > If