after making one choice in the list, the model instance would know about this and would offer certain kind of chices2.

2011-11-28 Thread gintare
I would like to have interactive initialization in admin site. I mean that after making one choice in the list, the model instance would know about this and would offer certain kind of chices2. I e, if i make choice1 books, i would get list of the books in the choice2, if i make choice1 institut

Re: django testing. random test order with some 'dependency constraints'

2011-11-28 Thread Gelonida N
Hi Russel, Thanks for your answer. On 11/28/2011 04:12 AM, Russell Keith-Magee wrote: > On Mon, Nov 28, 2011 at 9:39 AM, Gelonida N wrote: > . . . > Unit tests are supposed to be isolated. They shouldn't depend on > execution order, or have any pre-requisite other than those specified > as part

Simple task dispatching (How heavy is celery + RabbitMQ)

2011-11-28 Thread Gelonida N
Hi, I'd like to use a light weight dispatching system for a web server. Basically some django post requests might require processing, which should be done in the back ground due to its run times. The results would be added to the django data base. The browser could verify via AJAX requests whet

Re: Bulk import of data

2011-11-28 Thread Anler Hernandez Peral
Hi, this is probably not your case, but in case it is, here is my story: Creating a script for import CSV files is the best solution as long as they are few, but in my case, the problem was that I need to import nearly 40 VERY BIG CSV files, each one mapping a database table, and I needed to do it

Re: Simple task dispatching (How heavy is celery + RabbitMQ)

2011-11-28 Thread Tom Evans
On Mon, Nov 28, 2011 at 11:14 AM, Gelonida N wrote: > Hi, > > I'd like to use a light weight dispatching system for a web server. > > Basically some django post requests might require processing, which > should be done in the back ground due to its run times. > > The results would be added to the

Re: Simple task dispatching (How heavy is celery + RabbitMQ)

2011-11-28 Thread Markus Gattol
You don't need to roll your own... have a look at https://github.com/dmgctrl/django-ztask It's based on ZeroMQ and really lightweight compared to any alternative with a broker (yes, it's brokerless but that's a good thing I think for most use cases which don't really need a broker). -- You re

Re: Simple task dispatching (How heavy is celery + RabbitMQ)

2011-11-28 Thread Carlos Daniel Ruvalcaba Valenzuela
Celery has a bunch of alternative brokers, depending on your constrains you may not need something as "heavy" as RabbitMQ, you could for example use db broker if you don't have many tasks, it is slower but does not add a new server (apart from celery) to your stack, other option is to use Redis as

Re: Simple task dispatching (How heavy is celery + RabbitMQ)

2011-11-28 Thread Andre Terra
I'm also using redis for both brokering and caching. So far, so good. My use case consists in one HUGE (5 hours) task, and several tiny (30s or less) scheduled tasks. Cheers, AT On Mon, Nov 28, 2011 at 10:54 AM, Carlos Daniel Ruvalcaba Valenzuela < clsdan...@gmail.com> wrote: > Celery has a bun

Re: Security design questions

2011-11-28 Thread Javier Guerra Giraldez
On Mon, Nov 28, 2011 at 2:21 AM, Mike Dewhirst wrote: > 1. Do I have to create many-to-many relationships and before serving a page > make sure the user making the request is "permitted" to see it? that's how i've done this in the past. it's not too much burden. in my case, i had several image

Re: Large Queryset Calculation In Background?

2011-11-28 Thread Nan
We're using MySQL 5 (don't know off the top of my head what specific release). I don't think a master/slave DB configuration is something we can manage to set up at this point. Querysets are fetched from the database in chunks, right? I imagine that the select itself is actually quite quick, bu

Re: Large Queryset Calculation In Background?

2011-11-28 Thread Tom Evans
On Mon, Nov 28, 2011 at 2:54 PM, Nan wrote: > > We're using MySQL 5 (don't know off the top of my head what specific > release).  I don't think a master/slave DB configuration is something > we can manage to set up at this point. > > Querysets are fetched from the database in chunks, right?  I ima

Re: Large Queryset Calculation In Background?

2011-11-28 Thread Javier Guerra Giraldez
On Mon, Nov 28, 2011 at 10:10 AM, Tom Evans wrote: > Django currently always fetches the entire result all at once, > regardless of how you then fetch the data from the queryset. but this result isn't the whole queryset result, it's a chunk of it. the ORM adds 'LIMIT' arguments to the query. I t

Re: Simple task dispatching (How heavy is celery + RabbitMQ)

2011-11-28 Thread Roberto De Ioris
Il giorno 28/nov/2011, alle ore 12:14, Gelonida N ha scritto: > Hi, > > I'd like to use a light weight dispatching system for a web server. > > Basically some django post requests might require processing, which > should be done in the back ground due to its run times. > > The results would be

Re: Large Queryset Calculation In Background?

2011-11-28 Thread Nan
On Nov 28, 10:17 am, Javier Guerra Giraldez wrote: > On Mon, Nov 28, 2011 at 10:10 AM, Tom Evans wrote: > > Django currently always fetches the entire result all at once, > > regardless of how you then fetch the data from the queryset. Ah, I must have been misunderstanding a discussion[1] on D

Re: Large Queryset Calculation In Background?

2011-11-28 Thread Tom Evans
On Mon, Nov 28, 2011 at 3:17 PM, Javier Guerra Giraldez wrote: > On Mon, Nov 28, 2011 at 10:10 AM, Tom Evans wrote: >> Django currently always fetches the entire result all at once, >> regardless of how you then fetch the data from the queryset. > > but this result isn't the whole queryset result

Django or python question about classes

2011-11-28 Thread youpsla
Hello, in my code, I like to overrride the form_valid() method in both CreateView and UpdateView generic class views. I've put my code in views.py. class MyCreateView(UpdateView): . def form_valid(self, form, **kwargs): some code class MyUpdateView(CreateView): .

Re: Django or python question about classes

2011-11-28 Thread Tom Evans
On Mon, Nov 28, 2011 at 4:07 PM, youpsla wrote: > Hello, > in my code, I like to overrride the form_valid() method in both > CreateView and UpdateView generic class views. > > I've put my code in views.py. > > class MyCreateView(UpdateView): >    . >    def form_valid(self, form, **kwargs): >

What server configuration should I use for a Django site like this?

2011-11-28 Thread Andre Lopes
I need to put in production a Django website, but I don't know what machine I should use... this is not a commercial project, probably the monetary return will be very very little in ads... I have: -Django -PostgreSQL -Solr Do you think that will be enough a linode with 512mb ram? - Visitors day

better datepicker

2011-11-28 Thread marjenni
Hi, class SearchForm(forms.Form): date = forms.DateField(required=True, input_formats=('%d/%m/%Y',)) I am trying to change this so that it displays a calendar when the user starts to enter a date. I have seen various examples using JQuery, but I can't find an example that explai

Re: django.conf.urls import question

2011-11-28 Thread Ian Clelland
On Fri, Nov 25, 2011 at 6:39 PM, Chet wrote: > Hello, > > I just finished to tutorial and for in both my urls.py files, if I > use: > > from django.conf.urls import patterns, include, url > > I get an http500 error: TemplateDoesNotExist: 500.html > This message is from Django, trying to tell you

Referring to same model records as a parent

2011-11-28 Thread Swaroop Shankar V
Hi, I am trying to implement a menu system for my project which would enable the admin to create menu's that will be displayed on the webpage. So i should be able to create sub-menus which will have a parent menu. My table structure will be as follows id name url parent_id Here the parent_id will

Boolean test on queryset

2011-11-28 Thread Adam Nelson
When one tests for the boolean value of a queryset in the following way: examples = Example.objects.all() if examples: . do something You might think (I did) that Django will call a __nonzero__ special attribute that would either execute an EXISTS SQL STATEMENT or a SELECT statement w

Re: Boolean test on queryset

2011-11-28 Thread Jirka Vejrazka
Hi Adam, I tend to use: if examples.count(): ...something... HTH Jirka -- 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 group, send em

Re: Security design questions

2011-11-28 Thread Mike Dewhirst
Javier Thank you - that looks great. I'll start coding ... Cheers Mike On 29/11/2011 1:24am, Javier Guerra Giraldez wrote: On Mon, Nov 28, 2011 at 2:21 AM, Mike Dewhirst wrote: 1. Do I have to create many-to-many relationships and before serving a page make sure the user making the request

Re: Boolean test on queryset

2011-11-28 Thread Adam Nelson
Jirka, That doesn't solve the problem. That will still do a very expensive count() operation on the queryset. In fact, examples.count() is what happens when you do bool(examples) anyway. Thanks, Adam On Mon, Nov 28, 2011 at 8:11 PM, Jirka Vejrazka wrote: > Hi Adam, > > I tend to use: > > if

hasattr() and model attrname for foreign keys appending "_id"

2011-11-28 Thread Daniel Stekloff
Hi, I'm new to django, so it's possible I'm doing something wrong. I have a model defined that has the following field: parent_host_uuid = models.ForeignKey(Mgmt_host_model, to_field='uuid', blank=True, db_column="parent_host_uuid") The database has created the column: | parent_host_uuid

Re: django tests. where to create users

2011-11-28 Thread Gelonida N
On 11/28/2011 01:58 AM, Gelonida N wrote: > Hi, > > I'd like to run some django tests, which use the test client and which > should check, that certain users can only access certain contents. > > Where would you create this users / passwords. > - With a fixture > - as part of a test class in the

Re: Simple task dispatching (How heavy is celery + RabbitMQ)

2011-11-28 Thread Gelonida N
On 11/28/2011 12:14 PM, Gelonida N wrote: > Hi, > > I'd like to use a light weight dispatching system for a web server. > > Basically some django post requests might require processing, which > should be done in the back ground due to its run times. > > The results would be added to the django d

Re: django tests. where to create users

2011-11-28 Thread Mike Dewhirst
On 29/11/2011 12:12pm, Gelonida N wrote: So it seems, I am stuck with fixtures at least at the moment I do not know how to create users without fixtures such, that they would be persistent between unit tests. I agree - you are stuck. Perhaps a two tier approach might work. If you bite the bul

Re: Simple task dispatching (How heavy is celery + RabbitMQ)

2011-11-28 Thread Brian Schott
There are plenty of tutorials about memory management with RabbitMQ. There are mechanisms for setting the high watermark for memory to throttle producers. You could look at the database backend for django-kombu. It might have a smaller footprint. django-ztask looks interesting, but you don'

Re: better datepicker

2011-11-28 Thread Mario Gudelj
Hey, I use http://docs.jquery.com/UI/Datepicker on the front end. It's as simple as placing $("#datepicker").datepicker(); inside the page where you want to convert the text fields to date picker fields. I'll you have to do is change the ID inside $("#datepicker").datepicker(); to an ID of your f

Re: Boolean test on queryset

2011-11-28 Thread Ian Clelland
On Monday, November 28, 2011, Adam Nelson wrote: > Jirka, > That doesn't solve the problem. That will still do a very expensive count() operation on the queryset. In fact, examples.count() is what happens when you do bool(examples) anyway. I'm confused here -- examples.count() is definitely not

Customized authentication backend.

2011-11-28 Thread shaini sasidhar
Hi.. Need to customize authentication backend in my Django project.Also want to authenticate based on one of my MySQL table data(table Customers).How can I modify that Customers class in model.py file for declaring user robject.Please help me with some example. -- You received this mes