Re: ImageField, width_field, height_field not working

2009-02-04 Thread alex.gay...@gmail.com
On Feb 4, 3:48 pm, vicvicvic wrote: > Hello! > > I have created a ticket for this issue, with a patch which solves it. > I don't think it breaks anything... > > http://code.djangoproject.com/ticket/10196 That patch does indeed look to be correct, if you haven't

Re: #django community etiquette observations

2009-02-03 Thread alex.gay...@gmail.com
On Feb 4, 12:37 am, Israel Dacanay Canasa wrote: > Yup, just don't mind getting insulted. Since Magus is helping a lot of > people, the least others can do in return is to make him feel good. > > ^:)^ to Magus > > On Wed, Feb 4, 2009 at 1:16 PM, Kenneth Gonsalves >

Re: Custom Aggregate Objects

2009-02-03 Thread alex.gay...@gmail.com
On Feb 3, 1:29 pm, nsitarz wrote: > Well I've successfully subclassed the base aggregate class from > Russell above and it works as expected, however when I try and group > by my new aggregate field I get a FieldError. This makes sense to me > because when I call values on

Re: Custom Aggregate Objects

2009-02-02 Thread alex.gay...@gmail.com
On Feb 2, 9:05 pm, nsitarz wrote: > Hey, > > Back when the ORM aggregate support was a patch in trac I used to > create custom aggregate objects that looked like this: > > class Date(Aggregate): >     pass > > class DateHour(Aggregate): >     def __init__(self, lookup): >    

Re: Application design question

2009-01-31 Thread alex.gay...@gmail.com
On Jan 31, 8:04 pm, eddie wrote: > Hey guys & girls, > > I've just started playing with django, and am not sure of the best way > to do something. > > I've got a basic site, where page a displays model a, page b displays > model b, etc.  Every model has it's own view

Re: Finding and Displaying the Object that a Comment is Created On

2009-01-29 Thread alex.gay...@gmail.com
On Jan 29, 3:48 pm, "dave.mer...@gmail.com" wrote: > This si a somewhat nooby question. > > I have a comment. I want to display the post title for the > comment.object_id. > > In the template I have been trying things like comment.post.title, but > that is not working. > >

Re: admin_perm_test decorator?

2009-01-28 Thread alex.gay...@gmail.com
On Jan 28, 7:49 pm, Ian Cullinan wrote: > The docs > athttp://docs.djangoproject.com/en/dev/ref/contrib/admin/#protecting-cu...say > to use the "decorator provided in django.contrib.admin.utils.admin_perm_test" > to protect custom AdminSite and ModelAdmin views, but

Re: Confused with annotate() and filter().

2009-01-20 Thread alex.gay...@gmail.com
On Jan 20, 11:53 am, tlow wrote: > I think you can not do that with only one query using annotate. > > You could do it manually in python using the code above including the > additional filter on comment_approved and merge all (entry, number) > pairs with

Re: unable to import django.forms.formsets

2009-01-17 Thread alex.gay...@gmail.com
On Jan 17, 12:59 pm, Atishay <contactatis...@gmail.com> wrote: > On Jan 16, 10:06 pm, "alex.gay...@gmail.com" <alex.gay...@gmail.com> > wrote: > > > On Jan 16, 5:47 pm, Atishay <contactatis...@gmail.com> wrote: > > > > Hi > > > &

Re: unable to import django.forms.formsets

2009-01-17 Thread alex.gay...@gmail.com
On Jan 17, 12:59 pm, Atishay <contactatis...@gmail.com> wrote: > On Jan 16, 10:06 pm, "alex.gay...@gmail.com" <alex.gay...@gmail.com> > wrote: > > > On Jan 16, 5:47 pm, Atishay <contactatis...@gmail.com> wrote: > > > > Hi > > > &

Re: unable to import django.forms.formsets

2009-01-16 Thread alex.gay...@gmail.com
On Jan 16, 5:47 pm, Atishay wrote: > Hi > > when i try to import django formsets i get error. I am very new to > django so was not able to fix this. > > In [19]: from django.shortcuts import render_to_response > > In [20]: from django.forms.formsets import

Re: Error with PGSQL and not with SQLite with count() ?

2009-01-13 Thread alex.gay...@gmail.com
On Jan 13, 12:17 pm, Nicolas Steinmetz wrote: > Hello, > > The following view works well with SQLite but since I switched to > PostgreSQL 8.3, I have the following error : > > ValueError at /start/ > The view start.views.index didn't return an HttpResponse object. > > Views

Re: overriding Model.save(), do I need to override Model.create() also?

2009-01-12 Thread alex.gay...@gmail.com
On Jan 12, 10:12 am, "David Zhou" wrote: > On Mon, Jan 12, 2009 at 10:10 AM, rabbi wrote: > > > Is it enough to override the Model.save() method or should I override > > Model.create() also? > > Just Model.save() should be enough.  In the past, I've

Re: How do I add my template content to my html email?

2009-01-10 Thread alex.gay...@gmail.com
You can create a template and render it the same way you would in a view, checkout the render_to_string function(it's in django.template I believe). Alex On Jan 10, 2:41 pm, Michael wrote: > Hello, > I able to send an html email using the code below: > > /// > > def

Re: How relevant django book 1.0 is ?

2009-01-10 Thread alex.gay...@gmail.com
On Jan 10, 7:22 am, timur wrote: > Hello! > > I am newbie in django now reading Django Book > athttp://www.djangobook.com/en/1.0/. > As far as I know it covers django version 0.96, not modern releases of > 1.* branch. So my questions are: > > 1) How relevant this book on

Re: I just tried GEdit and failed

2009-01-07 Thread alex.gay...@gmail.com
Right now I use Gedit as my text editor(I don't use the terminal plugin, I just keep a seperate terminal up), that being said here are the plugins I use: * class browser * code comment * file browser pane * indent lines * Python indentation * smart spaces * snippets depending on what

Re: Dynamic OR statements

2009-01-05 Thread alex.gay...@gmail.com
You need to build up the Q object and then filter on it so: results = RelatedModel.objects.all() q = Q() for category in category_list: q |= Q(categories__slug = category.slug) results = results.filter(q) On Jan 5, 10:52 am, Bluemilkshake wrote: > Hello. Django

Re: Why Django doesn't force testing?

2009-01-05 Thread alex.gay...@gmail.com
Take a look at Django test utils(formerly test maker) (http:// github.com/ericholscher/django-test-utils/tree/master ), this features some of what you're talking about, helping generate test cases for the user. Ultimately it comes down to the developer knowing more about their application than

Re: Migrating MySQL -> Postgre, any working solutions?

2009-01-03 Thread alex.gay...@gmail.com
Not the most exciting, but you could always use the orm to pull data out of the old db and thenswl to put it into the new one(or vice versa). On Jan 3, 4:10 am, Szymon wrote: > Hello, > > I've found in archives message: > > > Check out django_extensions > >

Re: Weird Behavior in Template Rendering: First Letter Only ?!?!

2009-01-01 Thread alex.gay...@gmail.com
I'm not sure what you're passing to the template, but when you iterate over a form it doesn't yield the actual fields, it yields BoundField instances. Alex On Jan 1, 11:57 pm, Keyton Weissinger wrote: > OK. I changed the code below to (note .items): > > {% for key, value_list

Re: select childless parents, i.e. base with no derived classes in model inheritance

2008-12-29 Thread alex.gay...@gmail.com
The first query is correct, and obviously you need to add an extra filter for every other derived class. This is because the only way to check is to join against each derived table. Alex On Dec 29, 6:48 pm, pk wrote: > I have a need to select base classes that does not have

Re: How do I get django to display the results of html tags?

2008-12-29 Thread alex.gay...@gmail.com
This behavior occurs because by default Django templates escape all HTML tags in variable, the safe tag marks the string as being safe, and is thus rendered with its HTML intact. Alex On Dec 29, 2:09 pm, Ana wrote: > Hello Ramdas, > > Thank you!  It worked. > > Ana > > On

Re: wondering how to do something similar to save_model for inline.

2008-12-27 Thread alex.gay...@gmail.com
Take a look at the save formset method: http://docs.djangoproject.com/en/dev/ref/contrib/admin/#save-formset-self-request-form-formset-change On Dec 27, 6:46 pm, Timboy wrote: > I have an admin object where I want to pass in the request.user on > save. It works fine in my

Re: Strange error using modelformset_factory

2008-12-18 Thread alex.gay...@gmail.com
The reason this occurs, even with valid data, is because is_valid() triggers the validation procedures which set the cleaned_data attribute. Alex On Dec 18, 2:33 am, marty3d wrote: > Thanks for the English lesson! :) > > As you both pointed out, the .is_valid()

Re: Postgres Full-text search -- is it possible?

2008-12-15 Thread alex.gay...@gmail.com
It can be done using extra as shown here: http://barryp.org/blog/entries/postgresql-full-text-search-django/ there isn't a way built into django to do it however, there are also a few external search projects to create a nicer search api in django. This one:

Re: Model that only needs 1 data row

2008-12-01 Thread alex.gay...@gmail.com
Take a look at django.contrib.flatpages. On Dec 1, 9:36 pm, JGAllen23 <[EMAIL PROTECTED]> wrote: > I am building a website for a client and one of the pages they need is > an "about us" page which would just require 1 row of data.  What is > the best way to handle this case where a model would