Re: mod_python, multiple django-sites, memory usage

2007-09-10 Thread Atilla
If you are considering running mod_fcgi systems, take a loot at mod_wsgi first. It's quite stable already, the setup is not any more difficult than mod_fcgi and it's a lot more easy to configure the finer details. Additionally, some simplistic tests show quite good performance, although that's yet

Re: How to implement multi-level cascaded DISTINCT JOIN using django's object model?

2007-03-08 Thread Atilla
On 08/03/07, Alex Dong <[EMAIL PROTECTED]> wrote: > > Hi all, > > I have a data model like this: > * a `user` has multiple `questions` > * a `user` could give multiple `answer`s or `comment`s to any > `question`s. > So here, there are > * a one-to-many relationship from `user` to `question` > * a

Re: Any HTML to Latex module available in Python that can be integrated into Django

2007-03-08 Thread Atilla
If you're familiar with XSLT then that should also be a good candidate. The problem there is that things could get complicated, if the HTML document is not a well-formed XML document. On 08/03/07, Kjell Magne Fauske <[EMAIL PROTECTED]> wrote: > > > > On Mar 7, 8:17 pm, "Ramdas S" <[EMAIL PROTECT

Re: newbie question: select_related from parent to child

2007-03-08 Thread Atilla
On 06/03/07, roberto <[EMAIL PROTECTED]> wrote: > > dear all, > > i'm starting to use django and i have what may seem to a lot of you > the stupidest question ever, though i have not been able to solve > this,. > > i have to classes: > > class warriors(models.Model): > username = models.CharFi

Re: newb: Model.objects.select_related().get(id=4)

2007-03-09 Thread Atilla
On 08/03/07, johnny <[EMAIL PROTECTED]> wrote: > > class City(models.Model): > # ... > > class Person(models.Model): > # ... > hometown = models.ForeignKey(City) > > class Book(models.Model): > # ... > author = models.ForeignKey(Person) > edited = models.ForeignKey(Person)

Re: howto add join table field?

2007-03-09 Thread Atilla
On 09/03/07, Greg Donald <[EMAIL PROTECTED]> wrote: > > How can I add a field in a join table? > > I have this: > > class Item(models.Model): > name = models.CharField(maxlength=32) > > class List(models.Model): > name = models.CharField(maxlength=32) > items = models.ManyToManyField(I

Re: select_related() does not select many-to-many relations?

2007-03-09 Thread Atilla
On 08/03/07, akonsu <[EMAIL PROTECTED]> wrote: > > hello, > > as the subject says, select_related() does not return many-to-many > relations. is this a feature or a bug? > > thanks > konstantin > > >From what I've seen select_related() always joins up the related tables and select their values. C

Re: trying to make select_related() work

2007-03-09 Thread Atilla
On 09/03/07, akonsu <[EMAIL PROTECTED]> wrote: > > hello, > > the code below generates two queries to the database. is there a way > to make it get all objects related to object 'aa' and then just look > up the right one when get() is called? > > thanks > konstantin > > class AA(models.Model) : >

Re: trying to translate a join query to django

2007-03-09 Thread Atilla
On 07/03/07, hotani <[EMAIL PROTECTED]> wrote: > > This is the table (model) setup: > [county] (list of counties) > [office] (list of offices) > [active counties] (a relational table with a county_id, office_id and > 'active' column) > [division] (columns: 'name', 'county_id' which points to the f

Re: Api and user auth

2007-03-09 Thread Atilla
On 07/03/07, Grupo Django <[EMAIL PROTECTED]> wrote: > > Hello, I have two questions: > > -Where can I browse the django API? > > - I have made a news app. One of the fields is author, i want to set > its default value to the username logged in the admin zone. How could > I do it? What do I have t

Re: trying to make select_related() work

2007-03-11 Thread Atilla
On 09/03/07, akonsu <[EMAIL PROTECTED]> wrote: > > thanks for your response. > > well, i am trying to get a list of dependents of a given object in a > single query. i want to be able to retrieve the dependents by key (the > object name) from this list. > > i do not see any way of doing this but g

Re: Chaining ManyToMany Filters Update

2007-03-12 Thread Atilla
On 12/03/07, Boris Smus <[EMAIL PROTECTED]> wrote: >[56]:cs.filter(default_recipe__ingredients__ingredient__id=3).filter(default_recipe__ingredients__ingredient__id=1) > Out[56]:[] This would map to a Query that looks like this "... WHERE id=3 AND id=1". that would most certainly return no resul

Re: low performance of FastCGI deployment

2007-03-12 Thread Atilla
I am running a system with basically the same versions of all software packages as you are. It is in production and under stress testing it performed very very well and there've been no issues with performance so far. I am using Apache + FastCGI, server-managed. First thing you might want to look

Re: Related foreign fields in admin application

2007-03-14 Thread Atilla
On 14/03/07, Krassimir Grozdanov <[EMAIL PROTECTED]> wrote: > I am a python and Django novice so please excuse me if my question is > too stupid. > > I have 3 models: Regions, Municipalities and Persons. > In the admin interface, when editing the Person object, I want to > limit the choices for th

Re: newb: Django & CountingDown

2007-03-14 Thread Atilla
On 14/03/07, johnny <[EMAIL PROTECTED]> wrote: > > I have an app that is for online test taking. Most online test are 30 > mins to 2hrs. I need to create count down clock from when the test is > stared. If 30 mins test, then count down will start from 30 mins : 00 > Secs, 29 min: 59 secs and so on

Re: Starting a new, external process

2007-03-14 Thread Atilla
I don't have a full example, but the thread module won't do what you need. You need to spawn an external process to do your job. For this take a look at python's documentation. It's a faily simple thing to do, if you just want to run mencoder on the file, On 14/03/07, Henrik Lied <[EMAIL PROTECTE

Re: start exactly one thread in Django application

2007-03-15 Thread Atilla
On 15/03/07, skink <[EMAIL PROTECTED]> wrote: > > Hi, > > I'd like to start one thread in order to do some periodic actions. > > It should be started automatically, not within some view code. > > Where is the best place to start such thread? > > regards, > skink > What kind of actions are you tal

Re: newb: Django ORM for Custom SQL

2007-03-15 Thread Atilla
> I need to retrieve latest record (each record has a time stamp, > created_at), only one record, from sale table where product_id=1. How > do I do this in Django ORM? I have looked at .objects.extra{}, but I > am getting ProgrammingError 1064. > > I need to get this sql into Django ORM: > > sel

Re: Method problem with .save()

2007-03-15 Thread Atilla
On 15/03/07, DuncanM <[EMAIL PROTECTED]> wrote: > > I have 2 classes: This post is really too long to be able to understand what and where it's going on. "Revision matching query does not exist" is usually caused when you're trying to select something out of the database and your query coudn't m

Re: low performance of FastCGI deployment

2007-03-15 Thread Atilla
On 14/03/07, Alexander Boldakov <[EMAIL PROTECTED]> wrote: > > The web pages served in my django applications are not static media > files, but dynamically generated content (the result of applying XSLT > transformation to the XML data retrieved from XML database). I > consider the architecture of

Re: How to use Django session without browser cookies support

2007-03-15 Thread Atilla
On 13/03/07, Sengtha <[EMAIL PROTECTED]> wrote: > > I am currently working on one project which needs to view page on > browser that doesn't support cookies. > By what I know, all Django sessions are based on browser cookies. And > Django sessions are save in django_session table. I wonder there i

Re: Related foreign fields in admin application

2007-03-16 Thread Atilla
Weeel, there is the newforms-admin branch. I haven't tried it myself though, I've just seen people om the IRC channel discuss it. Judging from the roadmap, it should be pretty usable. http://code.djangoproject.com/wiki/NewformsAdminBranch --~--~-~--~~~---~--~~ You

Re: How much is Django memory footprint?

2007-03-20 Thread Atilla
I've a moderatelly small apllication in production, that runs on FCGI, instead of mod-python. From stress-tests it's prooven to be very fast and responsive. FCGI is dynamically managed by Apache. The memory footprint of my FCGI processes is around 12MB per process, In addition, my Apache processe

Re: How much is Django memory footprint?

2007-03-20 Thread Atilla
On 20/03/07, Nuno Mariz <[EMAIL PROTECTED]> wrote: > > The processing is nothing in special, right now a weblog and a online > store. > I've removed some modules, like fcgi, include and suexec(I can't > remember the instalation of this modules ;) ) and the size of the > processes is now 22Mb. > Do

Re: Illegal mix of collations

2007-03-27 Thread Atilla
On 26/03/07, Gerard M <[EMAIL PROTECTED]> wrote: > > Hello dear django comunnity, Im having a bad time with my database in > MySQL the problem is that when I try to store a word with some "rare" > characters like á é í and many others, django shows this message to > me > > OperationalError at /uplo

Re: fcgi - issues

2007-03-27 Thread Atilla
On 26/03/07, David M. Besonen <[EMAIL PROTECTED]> wrote: > > are there any issues/caveats/problems around using django + fcgi? > > i'm guessing there might things to be wary of, given that > mod_python appears more prominently in the installation > instructions. > > > thanks, > david I am using f

Re: Nested Sets for trees - any models been made before?

2007-03-27 Thread Atilla
> Currently I am trying to store a "tree" in a database and want to use Nested > Sets in order to do this. I was wondering if this exists within Django atm > or if there are plans to add it in the future or has someone developed it on > the side? If the answer to these questions is "NO", is there

Re: special chars "error in Admin"

2007-03-29 Thread Atilla
Have you tried switching to UTF-8, if you need support for "funny" character sets ? You'll need to change your database and table encodings to UTF8 (with appropriate collation, if you need proper sorting) and the output content-type. On 28/03/07, enquest <[EMAIL PROTECTED]> wrote: > > In Django

Re: Long time process and FCGI

2007-03-29 Thread Atilla
Hello, By the looks of it, mod_fcgi has a limit as to how much time it could wait for response from a script. Since you're doing a heavy operation that takes a while, i guess it times out. The point is - if your executed action takes so much time, you're clearly having a wrong conception on whe

Re: Long time process and FCGI

2007-03-30 Thread Atilla
windows programming {delphi} to Web, so my knowledge is kind of > limited with Python) > > Any suggestion? > > > > > Atilla wrote: > > Hello, > > > > By the looks of it, mod_fcgi has a limit as to how much time it could > > wait for response from a scrip

Re: Admin - order ForeignKey by

2007-04-02 Thread Atilla
Have you tried specifying "project__name" ? That should be resolved correctly in the query set. If it doesn't work, you'll have to redefine the order_by method and include the join of the tables there explicitly. On 31/03/07, Gilhad <[EMAIL PROTECTED]> wrote: > > I have something like this: > > c

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

2007-04-02 Thread Atilla
On 30/03/07, oliver <[EMAIL PROTECTED]> wrote: > > 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

Re: URLField to short for google maps

2007-04-02 Thread Atilla
On 01/04/07, TaMeR <[EMAIL PROTECTED]> wrote: > > The standard URLField is to short for the google maps. > I have a basic route that is almost 300 char long and they will get > longer. > I am developing on sqlite3 but I think it has something to do with > Django. > Does anybody know how I can fix

Re: HowTo assign user to group at registration

2007-04-03 Thread Atilla
On 03/04/07, TaMeR <[EMAIL PROTECTED]> wrote: > > > I use two registration forms one for clients one for vendors. > Depending on form used I would like to assign the user to a group. > > How do I use new_user.groups.add('Client') > > Below is my code that does not raise any errors but also does no

Re: Dynamic query building

2007-04-03 Thread Atilla
On 03/04/07, Honza Král <[EMAIL PROTECTED]> wrote: > something like this works for me... > > q = Q( tag__name=first_tag ) > for tag in other_tags: > q = q | Q( tag__name=tag ) What kind of query does this build BTW? Is it smart enough to put them all into a "WHERE name IN ( all-your-tags-here) ?

Re: Ordered list of objects?

2007-04-04 Thread Atilla
On 04/04/07, Nathan R. Yergler <[EMAIL PROTECTED]> wrote: > > I'm working on an app for a client, and one of the requirements is > that they be able to re-order objects in the admin interface. I know > exactly how I'd do with with an object database, but the ideas I've > come up with for doing it

Re: Per-app permissions ?

2007-04-04 Thread Atilla
On 03/04/07, Chris Brand <[EMAIL PROTECTED]> wrote: > > What's the best way to restrict access on a per-app basis ? > I want to have two apps, with some users allowed access to one, others > allowed access to the other, and some allowed access to both. > > Any advice would be very much appreciated

Re: Using a ForeignKey in ordering

2007-04-04 Thread Atilla
On 04/04/07, James Turnbull <[EMAIL PROTECTED]> wrote: > > I'm trying to group items in the Admin interface based on a foreign > key, and I'm hitting a few stumbling blocks. > > Simplified objects are... > > > class MenuItem(models.Model): > > name = models.CharField(maxlength=200) > > > > cla

Re: built-in comment system with custom views

2007-04-04 Thread Atilla
On 03/04/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > Hello, > > I was following tutorial on django built-in comment system in wiki on > djangoproject.com; Everything went fine, however, I can't figure out > how to use them with custom views, I keep getting different errors. > Tutorial exa

Re: Bad SQL when ordering a model by related models

2007-04-10 Thread Atilla
> - structure/models.py > class Issue(models.Model): > (...) > pub_date = models.DateField('Publication date', unique=True) > (...) > > class Meta: > ordering = ['-pub_date'] > - > > - stories/models.py > class Story(models.Model): > (...) > issue = model

Re: Providing action specific feedback messages to users and HttpResponseRedirects

2007-04-13 Thread Atilla
If you're simply trying to display error messages, if something is invalid - check carefully how this is being done in the examples in the documentation. The idea here is that you issue a redirect only when your data is validated, your object is saved and you must proceed to a different step. Now

Re: content type for html parts

2007-04-13 Thread Atilla
The correct type for HTML documents is text/html. The correct type for XHTML documents "should" be application/xhtml+xml, however - IE (maybe not all versions) will bork on that and will not render, but instead give you a save dialog. If your validator fails on "partial" documents, that should be

Re: a way to find out which page (as determined by the paginator) that a specifc object occurs on?

2007-04-16 Thread Atilla
> Of course one should not assume that post pk's are monotonically > increasing as the order the query set is sorted by can have no > relation to the post pk's. This means we can not even do something > simple as a binary search of slices of the query set. If it were the case, it'd be farily easy

Re: temp tables

2007-04-16 Thread Atilla
> Is there a way to force the db connection to stay open if you are > excecuting raw sql that is creating a temp table? When the connection > closes...the temp tables go away. > Temp tables are meant to be temporary. You can't guarantee, even with persistent db-connection pooling that the same

Re: etag and 404.

2007-04-16 Thread Atilla
> When I enable etags, django is sending back an etag on 404 pages. > When a client does a subsequent request for the same nonexistent > page, a 304 response is sent back, because the page has not changed > (based on the etag). > > When I disable etags, multiple requests for a non existent page a

Re: temp tables

2007-04-17 Thread Atilla
On 16/04/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > We are trying to use them to generate a report where a bunch of > calculations are being made... via a custom sql query... then hand all > of the results back to my django view to display. > > After they are displayed...they can be

Re: etag and 404.

2007-04-17 Thread Atilla
On 16/04/07, cactus <[EMAIL PROTECTED]> wrote: > > > I think the behaviour is correct though, why do you want to redefine it ? > > If the behavior is indeed correct, then I don't think I need to > redefine it. > It just seemed odd to return a 'not-modified' response to a query for > a page that di

Re: etag and 404.

2007-04-18 Thread Atilla
I stand corrected, thank you for the referenced reply. I've missed that part of the specification. If you make any changes to the conditional get middleware, please consider sending a patch for it, that could be incorporated in the code later, hopefully. --~--~-~--~~~-

Re: why there is no something like HttpResponseRedirect but status is 303

2007-04-18 Thread Atilla
On 18/04/07, Gilbert Fine <[EMAIL PROTECTED]> wrote: > > Hi All, > >According to HTTP standard, the meaning of 303 status is (copied > from rfc2616): > > 10.3.4 303 See Other > > The response to the request can be found under a different URI and > SHOULD be retrieved using a GET method on that

Re: Encoding in models.py (and maybe other files too)

2007-04-18 Thread Atilla
> >> just asking :) > > > > I don't know about Nicolas, but I'm writing something for a > > Spanish-speaking customer, so I might have a TelephoneField > > ("teléfono") in there, for example. > > the way to do it is verbose_name = _("telephone") Yes, instead of naming your models with "funky" char

Re: Encoding in models.py (and maybe other files too)

2007-04-18 Thread Atilla
On 18/04/07, mamcxyz <[EMAIL PROTECTED]> wrote: > > > Yes, instead of naming your models with "funky" characters, you can > > always set the verbose displayed name to whatever you need it to be. > > The are not funky. Are the normal characters in each labguage. Anyway, > that show too if the "funk

Re: "mpm-prefork" vs. "mpm-worker"

2007-04-25 Thread Atilla
In my experience so far, there's nothing that prevents you from efficiently using the worker MPM with the latest Apache/Mod_python/Django versions. You have to be more careful when it comes to configuration, optimization, concurrency-load-memory when running under worker MPM, but so far I haven't

Re: "mpm-prefork" vs. "mpm-worker"

2007-04-26 Thread Atilla
On 26/04/07, Graham Dumpleton <[EMAIL PROTECTED]> wrote: > > On Apr 25, 7:10 pm, Atilla <[EMAIL PROTECTED]> wrote: > > I personally find it Very bad to bind Django users to 1 apache worker > > model, considering how the Apache modules progress and the performanc

Re: How to change the encoding from UTF-8 to something else ?

2007-05-15 Thread Atilla
On 15/05/07, Martin Tomov <[EMAIL PROTECTED]> wrote: > > http://code.djangoproject.com/ticket/72 > > About this tichet. The last question is mine. > > How to change the encoding, sent by the HTTP headers to something > else, but UTF-8 ? The meta thing in the html is useless. > > Thanks This ticke

Re: More info in Django server logs

2007-05-16 Thread Atilla
On 15/05/07, Kostadin Cholakov <[EMAIL PROTECTED]> wrote: > > Hi > > We are using the development server only! Can you give me some > reference for the necessary changes in the code? Thanks! > > On 5/15/07, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > > > > On Tue, 2007-05-15 at 19:14 +, Ko

Re: browser detection middleware

2007-05-22 Thread Atilla
On 22/05/07, omat <[EMAIL PROTECTED]> wrote: > > Hi all, > > Is it a good idea to use a middleware class to detect the browser > client looking at the HTTP_USER_AGENT so as to serve presentation > logic accordingly, for mobile devices or older browsers, etc...? > > I know this is mostly done by

Re: Generell Questions on Django

2007-05-23 Thread Atilla
On 23/05/07, OliverMarchand <[EMAIL PROTECTED]> wrote: > > Hi, > > I am new to Django (4+years Python experience) and would like to > evaluate for my financial company whether Django may be a good > solution to our problem of designing our applications all a-z from > scratch. Now my colleagues fir

Re: "showable" but not "editable" field in the Admin screens

2007-05-23 Thread Atilla
On 23/05/07, Brian Rosner <[EMAIL PROTECTED]> wrote: > > You may also want to check out http://code.djangoproject.com/ticket/3990. > > On May 22, 5:19 am, "Seiji - technics" <[EMAIL PROTECTED]> wrote: > > Hi all, > > > > Is there a way to show as specific field in the admin screens but > > without

Re: subclassing of models

2007-05-23 Thread Atilla
On 23/05/07, OliverMarchand <[EMAIL PROTECTED]> wrote: > > Dear Djangos, > > Is it possible to subclass a model? This example somehow doesn't work > for in the sense that I only see the geography on the admin screen. > > > from django.db import models > > class Geography(models.Model): >

Re: How to define unsigned integer primary keys with auto increment for MySQL

2007-05-23 Thread Atilla
On 23/05/07, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > > On Tue, 2007-05-22 at 06:43 -0700, Fay wrote: > > I'm using MySQL. The primary key field generated by django uses > > integer, not unsigned. I'd like to us unsigned integer instead. I can > > explicitly specify PositiveIntegerField wit

Re: LIKE '%something%' custom queries

2007-05-23 Thread Atilla
On 23/05/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > I'm reimplementing an in-database tree system and I'm using custom SQL > queries. I want to use % in LIKE but Django doesn't let me. > > The code: > ## > def getBranch(table_name, parent_depth, parent_cutLevel, max_depth): >

Re: subclassing of models

2007-05-23 Thread Atilla
> Given that there is no branch, that statement is incorrect. > > Model inheritance is two stations down the line. Unicode gets finished > first, then query refactor then model inheritance. > > Regards, > Malcolm Well, I'm certainly glad to know this. I hadn't checked up on it for a long time.

Re: Django Forms

2007-05-25 Thread Atilla
On 24/05/07, robo <[EMAIL PROTECTED]> wrote: > > Hi everyone. for the code below at > http://www.djangoproject.com/documentation/forms/ > > def create_place(request): > manipulator = Place.AddManipulator() > > if request.method == 'POST': > # If data was POSTed, we're trying to cr