Re: How to subclass a model class?

2008-09-06 Thread Alex Chun
Thanks, Bruno. I will try that first thing Monday. Thanks for helping this newbie out!! On Sep 5, 5:50 pm, bruno desthuilliers <[EMAIL PROTECTED]> wrote: > On 6 sep, 02:19, Alex Chun <[EMAIL PROTECTED]> wrote: > > > Thank you for the response.  I should have said: the

Re: How to subclass a model class?

2008-09-08 Thread Alex Chun
Thank you AmanKow. I will try adding a method to my model to "hold" the additional "field." On Sep 7, 9:57 am, AmanKow <[EMAIL PROTECTED]> wrote: > Monkey patching attributes to the instances would not be the correct > django idiom for adding a calculated field.  There is a simple and > straight

Re: Djangobook Revisions for 1.0 release

2008-09-28 Thread Alex Polite
ut I'm not making any Maybe you could at least put something in the header stating that the book is not up to date? I've been starting out with Django this weekend, using the Djangobook and it took me a while to understand that it's not up to date. Alex -- http://polite.se -

Re: ModelForm and request.POST

2008-09-29 Thread Alex Koshelev
If you what to provide some init state for form - use `initial` param On Sep 30, 2:31 am, globophobe <[EMAIL PROTECTED]> wrote: > I would like to instantiate a modelform with a dictionary to work with > an existing object, e.g. > > a = Article.objects.get(title='Big news') > f = ArticleForm({'tit

Highlight current active page

2008-09-30 Thread Alex Rades
Hi, what kind of pattern do you use to add a class attribute to the current page being viewed? I mean the usual: Home Products FAQ contact us I have this snipped of html defined in the base template and all pages inherit from it. Currently I'm using this templatetag: http://gnuvince.wordpress

dynamic associations?

2008-10-06 Thread Alex G
o specify which attribute I'm after... Does anyone have any suggestions? Thanks in advance, Alex. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send e

Re: Can this be solved without hardcoded SQL?

2008-10-06 Thread Alex Ezell
to replicate GROUP BY functionality in the ORM. A quick search of the documentation seems to reinforce that. I'd love to know if that's no longer correct. I think dropping to raw SQL may be the only option here. /alex --~--~-~--~~~---~--~~ You received

Re: dynamic associations?

2008-10-07 Thread Alex G
'some_relation_or_fk') # but... Traceback (most recent call last): File "", line 1, in File "/Library/Python/2.5/site-packages/django/db/models/fields/ related.py", line 235, in __get__ raise self.field.rel.to.DoesNotExist DoesNotExist So I can't assign

Re: dynamic associations?

2008-10-07 Thread Alex G
I had not, actually, but it seems like it provides for exactly what I'm trying to do. I will look into it further, thank you. On Oct 6, 6:25 pm, bruno desthuilliers <[EMAIL PROTECTED]> wrote: > On 6 oct, 23:53, Alex G <[EMAIL PROTECTED]> wrote:> Dear django-users, >

Re: dynamic associations?

2008-10-08 Thread Alex G
s though its attributes were in the current User table. #To that end, I strapped together a decorator that works like this: @link_model_to(Account, through = 'account') def __init__(self, *args, **kwargs): super(User, self).__init__(*args,**kwargs) I've actually gotten

Re: ManyToManyFieldManager in post_save signal

2008-10-12 Thread Alex Koshelev
There is not way track M2M field change with post_save signal. You can write your own derived M2M field class with needed hooks. On Oct 12, 9:01 pm, Viktor <[EMAIL PROTECTED]> wrote: > Hi, > > I have three simple models Project and Member, where Project.member is > a ManyToManyField to User throu

Re: Highlight current active page

2008-10-13 Thread Alex Rades
rsonally dont' see the needs for loops and extra code. Or is my app to > simple ... :-) > > Regards, > > Gerard. > > Steven Armstrong wrote: >> Alex Rades wrote on 09/30/08 09:03: >>> Hi, >>> what kind of pattern do you use to add a class attribute t

Best practice to build a multilingual site

2008-10-13 Thread Alex Rades
Hi, if we have a model like: class News(models.Model): title = models.CharField(..) content = models.TextField(...) Imagine i want to work with different language (this means adding multilingual content via admin and retrieving it from views/templates) What is the best way to develop thi

Check out a new San Francisco music website I have been working on

2009-01-15 Thread alex kessinger
Hi, I have been working on http://loudfarm.com for a long time. If you are looking for a better way to find live music events in the bay area this site is it. Any feedback is welcome. Thanks, Alex Kessinger --~--~-~--~~~---~--~~ You received this message

Re: Aggregation across foreign keys / complex aggregation and annotation

2009-01-16 Thread Alex Koshelev
Try this: Process.objects.filter(exchange__input__unit__unit="kilogram")\ .annotate(sum_amount=Sum("exchange__amount"))\ .filter(sum_amount__gt=1) On Fri, Jan 16, 2009 at 12:38 PM, Christopher Mutel wrote: > > Following the general rule that no

Re: meet issue in Django tutorail

2009-01-16 Thread Alex Koshelev
Do you have the `__init__.py` file in mysite directory? On Fri, Jan 16, 2009 at 2:21 PM, syo wrote: > > hi , i'm now reading a Django tutorail naming: > "Writing your first Django app, part 1" > > In the "Activating models" part , it asks me to: > 1. add 'mysite.polls' into INSTALLED_APPS

Re: ifequal with floatformat:"0" doesn't work

2009-01-20 Thread Alex Koshelev
Just now {% ifequal %} tag doesn't apply filters to its operands. On Tue, Jan 20, 2009 at 2:58 PM, ltcstyle wrote: > > is this a bug or what? > > {{float_number|floatformat:"0"}} give me correct number 1 > > but > {% ifequal float_number|floatformat:"0" 1 %} > never match > > Any ideas? > > Than

Re: Error when Resending forgotten password

2009-01-22 Thread Alex Koshelev
Try to check your EMAIL_ settings. On Fri, Jan 23, 2009 at 8:55 AM, Oleg Oltar wrote: > Hi! I am getting a strange error when trying to reset, forgotten password. > I am using it this way > ># Password resend group >(r'^reset/(?P[0-9A-Za-z]+)-(?P.

Re: Error: 'PersonForm' object is not callable

2009-01-22 Thread Alex Koshelev
You don't need to "call" form second time: pForm = PersonForm(request.POST.copy(), instance=p) And pForm is the ready to use instance of form. On Fri, Jan 23, 2009 at 8:29 AM, waltbrad wrote: > > Hi folks. PersonForm is a modelform. I'm trying to validate data by > calling an instanc

Re: Refresh Queryset - I know the answer is there somewhere

2009-01-23 Thread Alex Koshelev
Your query executes in module import time and it happens only one time. So you cannot reevaluate it using choices field param like that. Solution - redefine form `__init__` and manually reassign choices to given field every time form is created. def __init__(self, *args, **kwargs): super(MyFor

Re: Several test files

2009-01-23 Thread Alex Koshelev
Yes, you can do that. You can create tests package with some test modules and in `__init__.py` import needed test cases into package namespace. On Fri, Jan 23, 2009 at 12:29 PM, gderazon wrote: > > My tests.py has become too big, I want to split it to several test > files > and still be able to

Querying intermediate model in ManyToMany

2009-01-23 Thread Alex Rades
Hi, I have these two simple models defined (using today's trunk) class Tag(models.Model): name = models.CharField(max_length=100) related = models.ManyToManyField('self', symmetrical=False, through='TagCorrelation', blank=True) class TagCorrelation(models.Model): from_tag = models.

Re: Last-Modified headers and render_to_response

2009-01-24 Thread Alex Koshelev
Just now you can store response object for a while and don't return it immediately. When set needed headers response = render_to_response("foobar.html") response["Last-Modified"] = "some value" return response On Sat, Jan 24, 2009 at 8:24 PM, Viktor Nagy wrote: > Hi, > > I would like to provid

Re: Import Fixtures per test

2009-01-24 Thread Alex Koshelev
Extract this test to its own TestCase with needed fixtures. On Sat, Jan 24, 2009 at 8:15 PM, Vitaly Babiy wrote: > Is there a way to specify which fixtures I want to import per test? > > Vitaly Babiy > > > > --~--~-~--~~~---~--~~ You received this message becaus

Re: Queryset unexpectedly turning into list

2009-01-24 Thread Alex Koshelev
All magic happens in line: if(queryset):#check if query returned somethin To perform this check QuerySet is evaluated and makes query to DB and stores result in list. After that QuerySet slice operation make real slice on underlying cache and of cource return list. On Sun, Jan 25, 2009 at 1:26

Re: Issue with save(commit=False). Can't append primary key.

2009-01-26 Thread Alex Koshelev
Form.save() returns an object. So your code may look like this: comment = commentform.save(commit=False) comment.entry = entry comment.save() On Mon, Jan 26, 2009 at 7:28 PM, Ty wrote: > > Here's a snip of my model: > > class Comment(models.Model): >entry = models.Fo

Re: Django unittest fails to check empty values

2009-01-26 Thread Alex Koshelev
What DB backend do you use? In some cases it rises OperationalError On Mon, Jan 26, 2009 at 2:25 PM, marco sedda wrote: > > Hi, I've a problem with unittest in django: > > I've described a models.py: > >class Season(models.Model): >name = models.CharField(max_length=30, unique=True

Re: Querying intermediate model in ManyToMany

2009-01-26 Thread Alex Rades
Thanks a lot Rajes, now I understand the situation better On Fri, Jan 23, 2009 at 7:05 PM, Rajesh Dhawan wrote: > >> >> class Tag(models.Model): >> name = models.CharField(max_length=100) >> related = models.ManyToManyField('self', symmetrical=False, >> through='TagCorrelation', blank=

Extending User model

2009-01-26 Thread Alex Rades
Hi, I need to have two sets of users in my application: One is the Person and the other is the Company. So, I have to decide between going with the userprofile way or inheriting from User. The problem with userprofile is that i can only register One class with AUTH_PROFILE_MODULE The problem with

Re: admin list display icons for callable?

2009-01-26 Thread Alex Koshelev
Try this: def photo_ad(self): if self.photo: return True return False photo_ad.boolean = True --- Александр Кошелев daeva...@gmail.com On Tue, Jan 27, 2009 at 8:51 AM, Paddy Joy wrote: > > The admin interface shows nice green/red i

Re: Extending User model

2009-01-27 Thread Alex Rades
On Tue, Jan 27, 2009 at 5:12 AM, Malcolm Tredinnick wrote: > > On Tue, 2009-01-27 at 00:11 +0100, Alex Rades wrote: >> Hi, >> I need to have two sets of users in my application: One is the Person >> and the other is the Company. So, I have to decide between going with &

Change uploaded filename

2009-01-30 Thread Alex Jonsson
rking ;). I've also managed to upload the file and then save a copy with a different filename, but that feels very unpractical. I'd somehow like to change the filename before it's uploaded. Any help would be greatly appriciated! Take care, Alex --~--~-~--~~~-

Re: Has anyone looked into writing an SSH backend for file uploads?

2009-01-30 Thread Alex Robbins
It might be even easier to just set up an NFS mount of the other machines. It would be a lot like Jeff's idea, but NFS is pretty tried and true. (I don't know anything about SSHFS, it might be really good too.) On Jan 30, 9:54 am, Jeff FW wrote: > Instead of trying to get Django to do something

Re: How to pass the variable which is defined in the views.py to the jQuery function

2009-01-30 Thread Alex Robbins
You might also consider using simplejson to dump the python variable into something that JavaScript could understand. (This way you can pass more complicated variables like an array or an object.) I recently did that to get a list of tags out to some javascript on the front end. On Jan 29, 11:33 

Re: How to pass the variable which is defined in the views.py to the jQuery function

2009-01-30 Thread Alex Robbins
te = "%s" % simplejson.dumps(tags) Pass variable_to_insert_into_template to the template and then just put {{variable_to_insert_into_template}} somewhere in your code. Just my 2 cents. On Jan 30, 10:42 am, Alex Robbins wrote: > You might also consider using simplejson to dump the p

Re: How do I correctly format a Querydict derived list in a url?

2009-01-30 Thread Alex Koshelev
Try this: return HttpResponseRedirect('/activities/%s/' % "-".join(location_filter)) On Fri, Jan 30, 2009 at 10:26 PM, Alfonso wrote: > > I've got a form delivering multiple variables from a checkbox group > via POST to a view that defines where to redirect to. > > I've got django to pass the

Re: How to pass the variable which is defined in the views.py to the jQuery function

2009-01-30 Thread Alex Robbins
e example should be added in the views.py. After that, I can use > the list by using var x = {{variable_to_insert_into_template}} in my > javascript? > > Regards > Min > > On Jan 31, 3:48 am, Alex Robbins > wrote: > > > Sorry, a code sample would have been more helpful.

Re: "invalid reference to FROM-clause" for nested annotate query

2009-01-31 Thread Alex Koshelev
What database backend do you use? On Sat, Jan 31, 2009 at 6:44 PM, omat wrote: > > Hi all, > > I obtain a list of tag ids by: > tag_ids = TaggedItem.objects.all().order_by('-added__max').annotate(Max > ('added'))[:10] > > and try to use it in the following query to obtain tag objects: > Tag.obj

Customized model methods

2009-02-01 Thread Alex Jonsson
gt;> blog_entry.is_personal() True >> blog_entry.is_whatever() False You probably get the point. Could someone perhaps explain how to do it or point me in the right direction? Thanks, Alex --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Goog

Re: Displaying the names of executed tests

2009-02-02 Thread Alex Koshelev
Look at the `--verbosity` test command option On Mon, Feb 2, 2009 at 3:16 PM, Julien Phalip wrote: > > Hi, > > I'd find quite useful to have the names of all the tests displayed > after they have been executed. Instead of just having something like > 'Ran 3 tests 0.672s', it'd be good to have s

Re: Customized model methods

2009-02-02 Thread Alex Jonsson
is to run a ifequal, and that's no good. Hopefully you get my point? Thanks, Alex On Feb 1, 11:50 pm, Dave Fowler wrote: > Well you might want to start by looking into django-tagging > > http://code.google.com/p/django-tagging/wiki/UsefulTips > > Install that for easy tags, an

Re: Customized model methods

2009-02-02 Thread Alex Jonsson
On Feb 2, 9:50 pm, Daniel Roseman wrote: > You can define as many methods on a model as you like. Models are just > Python classes, and you can do anything with them that you would do > with a normal class. > > def MyModel(models.Model): >     ... field definitions ... > >     def is_sports(self)

Re: 'AdminSite' object has no attribute 'urls' issue

2009-02-04 Thread Alex Gaynor
n is 1.0.2, and python version is 2.6, using sqlite3. > are there any configurations wrong with the tutorial? or a django > version problem? thanks. > > > > Unfortunately the docs you are reading are for the development version :( . The correct way to wire up your admin in 1.0.2 i

Re: 'AdminSite' object has no attribute 'urls' issue

2009-02-04 Thread Alex Gaynor
ject website? > i think the differences of the version of django may confuse greener a > lot. > > On Thu, Feb 5, 2009 at 12:14 PM, ethan zou wrote: > >> now it works. >> thanks a lot. >> >> On Thu, Feb 5, 2009 at 12:10 PM, Alex Gaynor wrote: >>

Re: Model Form Field Ordering

2009-02-04 Thread Alex Koshelev
The is no public/documented API for reorder fields, but you can do some trick with SortedDict: class MyModelForm(forms.ModelForm): mySpecialField = forms.ChoiceField(label='Special', choices=(('a','aa'))) class Meta: model = MyModelType MyModelForm.base_fields.keyOrder = ["mySpecialF

Re: Two forms.Form one page: second form will not show any errors

2009-02-05 Thread Alex Gaynor
view code and the template you are using to render the > > forms might help someone spot what is going wrong. If they're likely to > be > > badly wrapped in email, someplace like dpaste.com would be better than > > putting them inline in your me

Re: how can i create alphabetic list

2009-02-05 Thread Alex Gaynor
On Thu, Feb 5, 2009 at 7:20 AM, Muslu Yüksektepe wrote: > @Rama: > where can i add this code? > > and i wanna use like this. > > my items: > - > aa > aaa > > a > bb > bbb > b > ccc > cc > cc > -- > my list: > a b

Re: Iterating over a dictionary in templates

2009-02-05 Thread Alex Gaynor
On Thu, Feb 5, 2009 at 10:21 AM, Carlos Pero wrote: > > Searching this group, I found a number of ways to iterate over a > dictionary in a template to get access to both the key and the value. > However, none of them covered the technique mentioned in this blog > post: > > > http://www.zedkep.com

Re: Custom Related manager

2009-02-05 Thread Alex Gaynor
om nice and easy. > > > > > > -- > -- > Ales Zoulek > +420 604 332 515 > Jabber: a...@jabber.cz > ICQ: 82647256 > -- > > > > Yes, see how it's done here: http://docs.dj

Re: how can i create alphabetic list

2009-02-05 Thread Alex Gaynor
On Thu, Feb 5, 2009 at 10:03 AM, Muslu Yüksektepe wrote: > > can u give me one example? > > i dont understand > > > On 5 Şubat, 16:35, Alex Gaynor wrote: > > On Thu, Feb 5, 2009 at 7:20 AM, Muslu Yüksektepe > > wrote: > > > > > > > >

Re: Changing the structure of an already running site

2009-02-05 Thread Alex Gaynor
; Say you wanted to add a field to an existing model on a running >> website, what is the correct and safest way to go about doing this? >> >> Thanks, >> Phil >> >> > > > > There are also django-evolution

Re: Two forms.Form one page: second form will not show any errors

2009-02-05 Thread Alex Gaynor
problem with this is before it displays the actual > errors it is displaying __all__. So it looks like this: > > __all__ > Error message raised by my custom validation > > > Thanks again for previous help! > > On Thu, Feb 5, 2009 at 6:31 AM, Alex Gaynor wro

Re: Redundant select on QuerySet delete/update

2009-02-05 Thread Alex Gaynor
ts themselves. To get a better idea of what I'm describing take a look at the source: http://code.djangoproject.com/browser/django/trunk/django/db/models/query.py#L409 Alex -- "I disapprove of what you say, but I will defend to the

Re: Admin and 1-1 fields

2009-02-05 Thread Alex Gaynor
rt enough to add a new 1-1 related record when > necessary. I'm wondering in the code where they do this, as I'm > trying to do the same. > > Thanks > > > This basically occurs in the inline formset: http://code.djangoproject.com/browser/django/trunk/django/forms/models

Re: Redundant select on QuerySet delete/update

2009-02-05 Thread Alex Gaynor
On Thu, Feb 5, 2009 at 3:24 PM, George Sakkis wrote: > > On Feb 5, 3:13 pm, Alex Gaynor wrote: > > On Thu, Feb 5, 2009 at 3:09 PM, George Sakkis >wrote: > > > > > > > > > > > > > Hello, > > > > > I am looking at the raw

Re: Where to place files on apache server.

2009-02-05 Thread Alex Gaynor
), is to put it in some neutral location and to either symlink it to both 2.5 and 2.6 or just add that location to your PYTHONPATH(which is version neutral). Alex -- "I disapprove of what you say, but I will defend to the death your right to say it." --Voltaire "The people'

Re: Where to place files on apache server.

2009-02-05 Thread Alex Gaynor
utral location and to > either > > symlink it to both 2.5 and 2.6 or just add that location to your > > PYTHONPATH(which is version neutral). > > > > Alex > > > PythonPath is an enviromental variable that tells the python interpretter where to look to load modules. A

Re: request.GET Problem

2009-02-05 Thread Alex Gaynor
? > > > thanks > > > I don't believe so, the way HTTP works with the browser is that it only POSTs the value, fyi you might want to look at django.forms since it saves you from worrying about this stuff. Alex -- "I disapprove of what you say, but I will defend to

Re: request.GET Problem

2009-02-05 Thread Alex Gaynor
; and 'test2' in the SelectMultiple > widget, the value in the "request.GET['selectM'].strip()" is only > 'test2'. > > If I want get all the values which I have selected, how to do that? > > > > > > On Feb 6, 12:24 pm, Alex Gayn

Re: Class coverage report for automated tests in django apps

2009-02-06 Thread Alex Gaynor
atements' but > couldn't find any way that gives 'method/class coverage' report. Can > anyone help? > > Thanks in advance. > > > > Perhaps try figleaf, I've never used it but I've heard nice things about it: http://pypi.python.org/pypi/figleaf/

Re: get_FOO_display

2009-02-06 Thread Alex Koshelev
get_FOO_display is an instance method not field. So try this: {{ object.get_invoice_type_display }} On Fri, Feb 6, 2009 at 6:09 PM, Alfonso wrote: > > I've got a field called 'invoice_type' which is a ChoiceField. > > In my template I'm trying to pull out the 'humanized' invoice type by > usi

Re: how can i create alphabetic list

2009-02-06 Thread Alex Gaynor
mage1aciklama = "" > self.image1sil = False > super(Fotoalbum, self).save() > > def get_tag_list(self): > return re.split(" ", self.tags) > > def __unicode__(self): > return self.baslik > > my django version is

Re: how can i create alphabetic list

2009-02-06 Thread Alex Gaynor
On Fri, Feb 6, 2009 at 7:39 AM, Muslu Yüksektepe wrote: > i tryed but it doesnt work. > > 2009/2/5 Muslu Yüksektepe > > thanx i will try tomorrow. >> i hope it will be ok >> > > > > > You need to provide more information than simply it doesn'

Re: how can i create alphabetic list

2009-02-06 Thread Alex Gaynor
t; c6 > > and > > i wanna use letter like this > a b c d e f g > > when i click "a" it have to show only > a1 > a2 > a3 > a4 > or click "b" > b2 > b3 > b4 > b5 > b6 > > later i wanna choose titles. > i hope i c

Re: No module named PIL - Django - Gae

2009-02-06 Thread Alex Gaynor
Engine so I think google has their own image module, you should consult the GAE documentation. Alex -- "I disapprove of what you say, but I will defend to the death your right to say it." --Voltaire "The people's good is the highest law."--Cicero --~--~-~--~~

Re: No module named PIL - Django - Gae

2009-02-06 Thread Alex Gaynor
On Fri, Feb 6, 2009 at 12:09 PM, Karen Tracey wrote: > On Fri, Feb 6, 2009 at 12:05 PM, Alex Gaynor wrote: > >> I'm fairly certain PIL doesn't work on Google App Engine so I think google >> has their own image module, you should consult the GAE documentation.

Re: Can I do this with django?

2009-02-06 Thread Alex Gaynor
; > > Yep this is possible, basically what you're going to want to do is override the save() method on a Project so that when it gets created it just copies it's Clients hourly pay, you can look for other examples of using this technique to accomplish other things(such as automatical

Re: Can I do this with django?

2009-02-06 Thread Alex Gaynor
On Fri, Feb 6, 2009 at 12:58 PM, Kevin Audleman wrote: > > Thanks Alex! > > My Project class has the field > > client = models.ForeignKey(Client') > > Would I use this in my save() method to reference the parent Client? > For instance > > class Project: >

Re: Context processors not executing

2009-02-06 Thread Alex Gaynor
ime something like > this happens to me. I'm really lost here, any help o keyword to google > for will be much appreciated. > > Thanks! > > -- > AlvAro > > > > How are you rendering your template, specifically are you remembering to use RequestContext? Alex

Re: Two quick questions about __search

2009-02-06 Thread Alex Gaynor
t; > 1) It's mentioned here: http://docs.djangoproject.com/en/dev/ref/models/querysets/#search 2) Yes Alex -- "I disapprove of what you say, but I will defend to the death your right to say it." --Voltaire "The people's good is the highest law."--Cicero --~--~-~--~--

Re: Better approach in Database?

2009-02-07 Thread Alex Gaynor
n mind? > > I am using Django with MySql. > > Thanks In Advance > Guri > > > > Using the second table is a far better architecture, since there are many types of queries that you couldn't properly do on a string field, such as how would you ask if user 1 was following

Re: optional foreign key

2009-02-07 Thread Alex Gaynor
On Sat, Feb 7, 2009 at 8:08 PM, J wrote: > Truly amazing. I would have never guessed that the OR operator would > combine two querysets. How does that work? > > Thanks for your help. You solved my problem. > J > > > > > Russell Keith-Magee wrote: > > On Sun, Feb 8, 2009 at 8:03 AM, J > wrote:

Re: external non-ascii character is breaking my script

2009-02-07 Thread Alex Gaynor
ot; or "license" for more information.>>> > s = 'A paper mach\xe9 letter rack' > > >>> print unicode(s, 'utf-8') > > > > Traceback (most recent call last): > > File "", line 1, in &g

Re: Memory Leaks

2009-02-07 Thread Alex Gaynor
None > >return response > > > > > Django isn't known to leak memory and nothing you're doing here is particularly uncommon, or outlandish so I'd guess the issue is with matplotlib, I'd try asking on their mailing list if there are any known issues. Alex

Re: Postgresql v MySQL

2009-02-08 Thread Alex Gaynor
> http://www.postgresql.org/docs/8.3/static/textsearch.html > > -- > PA. > http://alt.textdrive.com/nanoki/ > > > > > Postgres has full text support from 8.3 onwards, however django doesn't have support for using it from within the ORM yet, see http://code.djangopro

Re: admin "Documentation" link not visible

2009-02-08 Thread Alex Gaynor
gt; > Yes you need to have 'django.contrib.admindocs' and have the urls wired up(you should just need to uncomment it from the default urls.py). Alex -- "I disapprove of what you say, but I will defend to the death your right to say it." --Voltaire "The people's

Re: Extending the User model

2009-02-08 Thread Alex Gaynor
On Sun, Feb 8, 2009 at 3:06 PM, Patricio Palma wrote: > > Greetings > > I have a model > > from django.contrib.auth.models import User > class MyUser(User): > >chilean_rut = CLRutField(_('RUT'),primary_key=True) > >class Meta: > > admin = meta.Admin( >fields = ( >(_(

Re: Adding fields to model objects that don't correspond to database state

2009-02-08 Thread Alex Koshelev
try this: def attach_bar(self, bar): if getattr(self, "bars", None) is None: self.bars = [] self.bars.append(bar) On Mon, Feb 9, 2009 at 12:03 AM, Jack Orenstein wrote: > > I have a model object that looks something like this: > > class Foo(models.Model)

Re: Testing Django and HTTP Request

2009-02-08 Thread Alex Gaynor
the nature of the thread it is not > guaranteed to be killed in time. > > Vitaly Babiy > > > > You should be able to save the thread on the Test object during setup() and then kill it on teardown() shouldn't you? Alex -- "I disapprove of what you say, but I will d

Re: Testing Django and HTTP Request

2009-02-08 Thread Alex Gaynor
TP server at the beginning of the > test and keep it around till all test are done. And have a way to tell the > server what to return on the request. > > Vitaly Babiy > > > On Mon, Feb 9, 2009 at 12:08 AM, Alex Gaynor wrote: > >> >> >> On Mon, Feb 9, 2009 a

Re: Testing Django and HTTP Request

2009-02-08 Thread Alex Gaynor
On Mon, Feb 9, 2009 at 12:18 AM, Vitaly Babiy wrote: > Yea, but I see a few problems whit that solution: > >- Hacky >- Still not guaranteed to work( it could take more time) >- Would really slow down the tests > > Vitaly Babiy > > > On Mon, Feb 9, 2009

Re: Testing Django and HTTP Request

2009-02-08 Thread Alex Gaynor
On Mon, Feb 9, 2009 at 12:28 AM, Vitaly Babiy wrote: > Yeah, it does. I am going to have to look to see if can find a better stand > alone server to do this instead of patching django. > > Vitaly Babiy > > > On Mon, Feb 9, 2009 at 12:22 AM, Alex Gaynor wrote: > >> &

Re: What is the Difference between get() and filter() functions in Django Framework

2009-02-08 Thread Alex Gaynor
cts, get() returns a single object and raises an exception if either more than 1 object are returned, or none are returned. Alex -- "I disapprove of what you say, but I will defend to the death your right to say it." --Voltaire "The

Re: date error

2009-02-09 Thread Alex Gaynor
ower(), >'day':self.pub_date.strftime("%d"), >'slug':self.slug}) > > could you help me and explain why i have this error? > > Thank you > > > > I don't have my copy of Practical Dj

Re: Looking to give presentation on Django at work

2009-02-09 Thread Alex Gaynor
use Django: http://www.justinlilly.com/blog/2009/jan/17/django-3ft-presentation/ Perhaps this would be helpful. Alex -- "I disapprove of what you say, but I will defend to the death your right to say it." --Voltaire "The people's good is the highest law."--Cicero --~-

Re: mod_python vs. Django?

2009-02-09 Thread Alex Gaynor
ebserver and a way to interact with it, so you are welcome to use mod_wsgi, or fastcgi or whatever else you can hook up, but you need something. Alex -- "I disapprove of what you say, but I will defend to the death your right to say it." --Voltaire "The people's good is the

Re: Keep getting NameError at /admin/

2009-02-09 Thread Alex Gaynor
ext line to enable the admin: > (r'^admin/(.*)', admin.site.root), > ) > > i have removed evrything else from the project and app and still get > the errror, at the top of the urls.py it makes no difference whether I > have the line admin.autodiscover() or not as

Re: UnicodeEncodeError with gettext

2009-02-09 Thread Alex Gaynor
ters for the translations. > > Any ideas? The translation files are working for the non-unicode > languages, but failing for all UTF-8 based languages. Could it be > something with the .po files being created incorrectly? > > > Django only handles everything as unicode post

Re: Question about media in outside forms

2009-02-09 Thread Alex Gaynor
thanks, > Robert Ramírez Vique > Computer Science Engineer > > > > The best way to do this would be to make a templatetag that took multiple form.media instances, added them together(which can be done with media instances) and then output the response. Alex -- &qu

Re: Strange 404 error in admin

2009-02-09 Thread Alex Gaynor
I > get it for the other items (id < 51)? > > I'm really lost here. There must be some kind of corruption in the > data meaning it cannot find those particular items, but what could it > be? Again, those 2 blog entries work fine when displayed in the > frontend. >

Re: Forms, fields and widgets

2009-02-09 Thread Alex Gaynor
; > -- > Best regards, > Serge mailto:serge.ko...@gmail.com > > > > > I would recommend searching the dev list for a thread titled: "Controlling form/widgets output". Alex -- "I disapprove of what you say, but I will defend to the de

Re: Keep getting NameError at /admin/

2009-02-09 Thread Alex Gaynor
On Mon, Feb 9, 2009 at 6:24 PM, claudio.br...@googlemail.com < claudio.br...@googlemail.com> wrote: > > > > On 9 Feb, 19:16, Daniel Roseman wrote: > > On Feb 9, 6:57 pm, "claudio.br...@googlemail.com" > > > > wrote: > > > Hi Alex > &g

Re: ABC/MTI and Generic Date Based Views

2009-02-09 Thread Alex Gaynor
will automatically denormalize which subclass on object is, and load up the correct one when something is fetched from the ORM(note that this could turn a Base.objects.all() query into O(n) queries). In any event here is the code: http://dpaste.

Re: A ManyToMany Field question.

2009-02-09 Thread Alex Gaynor
On Mon, Feb 9, 2009 at 10:18 PM, khsing wrote: > > I want design a group that can contain other groups, and one group can > belong many groups. > > I write such code below, but not right. > > class Group(models.Model): >groups = models.ManyToManyField(Group) > > any suggestion? > > or how to

Re: django admin not showing the models related data

2009-02-09 Thread Alex Gaynor
_str__ basically change it to __unicode__ and make sure it returns unicode(you can also use __str__ so long as you ensure that it returns utf-8 encoded data, more trouble that it's worth IMO). Alex -- "I disapprove of what you say, but I will

Re: including non-editable fields in forms?

2009-02-09 Thread Alex Gaynor
ie > > > For now you'll simply have to add it to the template. It's a 1.1 maybe feature to have non-editable items in the admin. Alex -- "I disapprove of what you say, but I will defend to the death your right to say it." --Voltaire "The people's good is the h

Re: ABC/MTI and Generic Date Based Views

2009-02-09 Thread Alex Gaynor
On Tue, Feb 10, 2009 at 12:22 AM, seanbrant wrote: > > Sorry about my initial post, Im new here. I'll try harder next time ;) > > I choose MTI and added a entry_type field to the main Entry model. > > > ...(note that this could turn > a Base.objects.all() query into O(n) queries). > > Is there a

Re: including non-editable fields in forms?

2009-02-09 Thread Alex Gaynor
like >> that for those, I suspect. >> >> On the other hand, I've always just inserted it directly into the form >> template when I've had this kind of situation. >> >> Regards, >> Malcolm >> >> >> >> >> > >

Re: comparisons with java framework

2009-02-10 Thread Alex Gaynor
an extremely limited resource on any volunteer project, and > > the core developers have made the decision that having an offline PDF > > version of the docs is a lower priority to improving Django as a tool, > > and improving the documentation that ships with Django and is > >

Re: dynamic ModelChoiceField and handling form submission

2009-02-10 Thread Alex Gaynor
> > > The issue is you are passing the kwarg "user" after the arg. Since user is the first param when you pass request.POST as the first arg it assumes it is user. Reorganize your arguments in some(make user first, or pass request.POST

<    1   2   3   4   5   6   7   8   9   10   >