Re: Generic foreignKey model: Category

2009-02-11 Thread Jake Elliott
if i follow your question - you'd want a ForeignKey in CategoryItem to your Category model, so you can add both your News object and Product object to the same category through CategoryItem. then you'll be able to iterate through all of the items in a categoroy with something like

Re: Generic foreignKey model: Category

2009-02-11 Thread Jake Elliott
hi dan - a little further down on the contenttypes doc page you link to there is documentation on the generic foreign key mechanism bundled with the contenttypes app: http://docs.djangoproject.com/en/dev/ref/contrib/contenttypes/#id1 pretty similar to what you describe ;) On Wed, Feb 11, 2009

Re: signals in 1.0 problem: nesh django utils & django 1.0

2009-02-09 Thread Jake Elliott
hi robocop - is it enough to add the '**kwargs' syntax to your receiver function? or is that already present? like: def _save(self, **kwargs): ... and def delete(**kwargs): ... -jake On Mon, Feb 9, 2009 at 12:15 PM, Robocop wrote: > > Hello, > I've

Re: simple record output

2009-02-02 Thread Jake Elliott
hi john - you can use the 'spaceless' tag in your template: http://docs.djangoproject.com/en/dev/ref/templates/builtins/#spaceless to filter out spaces & carriage returns. -jake On Mon, Feb 2, 2009 at 3:41 PM, John M wrote: > > Grrr, I answered my own quesiton, if I

Re: Dreamhost now supports Django

2008-07-17 Thread jake elliott
On Jul 17, 3:15 pm, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > Can anybody who is in a position to check this out please look at one > thing in particular: assuming the default database is still MySQL, which > version of the python MySQLdb wrapper are they using? If > >         >>> import

Re: Oh boy, I've gone and done it now.

2007-11-05 Thread jake elliott
hi baxter - On Mon, 2007-11-05 at 10:35 -0800, [EMAIL PROTECTED] wrote: > OK, I attempted to install patch 2070, and failed miserably, messing > up /core/handlers/modpython.py among other things. When I realized I > had done so, I tried updating and then reinstalling django to get back > to a

Re: generic views

2007-10-22 Thread jake elliott
On Mon, 2007-10-22 at 14:12 -0500, jake elliott wrote: > this is probably another really simple view. you can use > HttpResponseRedirect - or if you really want to end up using a generic > view remember that you can call them within your own views also. > > #

Re: generic views

2007-10-22 Thread jake elliott
hi bernd, On Mon, 2007-10-22 at 18:40 +0200, Bernd wrote: > I want to use a generic view with an url that had a parameter. This > parameter should filter my queryset. > How does this work? I don't now what to write in the filter-option? > - > e = { > 'template':

Re: template and array like template variable access

2007-10-17 Thread jake elliott
hi johnny, you can use dot syntax for indices also, ie: {{ a_tup.0 }} {{ a_tup.1 }} -jake On Wed, 2007-10-17 at 08:20 -0700, johnny wrote: > > {% for a_tup in rs %} > > {{ a_tup[0] }}/ >{{ a_tup[1] > > {% endfor %} > > Exception Type:

Re: generic views

2007-10-11 Thread jake elliott
Marty Alchin wrote: > You'd replace "what goes here" with what you put in > "template_object_name": "author" (only without the quotes). Of course, > it'd be a little more readable if you use the plural "authors", since > you're getting a list of more than one author. actually you'll use

Re: Problem with nesh.thumbnail

2007-10-04 Thread jake elliott
hi divan, Divan Roulant wrote: > "'myproject.thumbnail' is not a valid tag library: Could not load > template library from django.templatetags.apparto.thumbnail, No module > named myproject.thumbnail" here's the change that's tripping you up:

Re: How to keep track of iterations through a for loop in my template?

2007-10-01 Thread jake elliott
hi greg Greg wrote: > Hello, > I have a table in my template that will contain an x number of rows > depanding on what I get back from the view. I want my table row > background color to rotate between red and white. As of now, I don't > know how to keep track of each iteration through my for

Re: change list in admin

2007-09-27 Thread jake elliott
hi jose Lic. José M. Rodriguez Bacallao wrote: > how can I limit items in "change list" of the admin interface? the admin will use your model's default manager (the first specified manager) to filter results. more information here:

Re: Sorting product

2007-09-26 Thread jake elliott
hi francis - Francis Lavoie wrote: > I have a page that list products. These products are in different > categories, some belongs to other products (like addons). But I need to > sort them as the most important product is at the top. The problem is > that I can't come up with a good solution. I

Re: Union/join of two queryset?

2007-09-24 Thread jake elliott
hi francesco cesco wrote: > I have two QuerySets and I need to join them to pass them as first > parameter to the ObjectPaginator class. > How can I do that? > The "+" operator doesn't work (like it does for lists) and there is no > a method like the list one "extend()". you can use the

Re: elsif in templates?

2007-09-24 Thread jake elliott
hi a. A. Reppel wrote: > does the template language have a elsif clause for if and if{not}equal? nope, you'll have to go with {% if %} {% else %} {% if %} {% endif %} {% else %} {% endif %} best, jake --~--~-~--~~~---~--~~ You received this message

Re: How to call a .htm page without going to the views.py file?

2007-09-21 Thread jake elliott
hi greg - you're looking for this: http://www.djangoproject.com/documentation/generic_views/#django-views-generic-simple-direct-to-template best jake Greg wrote: > Ok, > Very easy question here. Is there anyway that I can directly call > my .htm file from within my urls.py file? > > Now, I

Re: General site organization

2007-09-20 Thread jake elliott
hi florian - Florian Lindner wrote: > I have the site xgm.de with a blog, an abbreviation database and some static > pages. > How would a organize such a site with Django? > Create an app for the blog, an app for the DB and the static pages as > templates of the project? you really have a lot

Re: Can't update my django source via svn

2007-09-19 Thread jake elliott
hi jeff - django devs are in the process of moving servers so i think this is probably just a temporary issue. fwiw i am able to 'svn up' right now with no problem :| best, jake jeffself wrote: > I've never run into this problem before but all of a sudden its not > working. My source is

Re: Add Support for Hex numbers is Admin

2007-09-19 Thread jake elliott
hi kevin, you could convert to int in the model's save() method class MyModel(models.Model): def save(self): self.hexval = int(str(self.hexval), 16) super(MyModel, self).save() or whatever hex->decimal method you need for how you have the hex val stored. but then how to get it

Re: ifequal function not working?

2007-09-13 Thread jake elliott
hi john - John M wrote: > {% ifequal selected_id recordset.id %} never seems to work. > > where selected_id = 1 > recordset has ID from 1 - 10 just a guess - are selected_id and recordset.id really the same type? {% ifequal %} will not match for example '1' == 1 best, jake

Re: 404 Page Help

2007-09-11 Thread jake elliott
hi ryan, how about a context processor? http://www.djangoproject.com/documentation/templates_python/#writing-your-own-context-processors -jake Ryan K wrote: > Hi. All URLs in my templates are preceded by variables I added to the > settings file so I could easily deploy my site on many

Re: Help me understand the error of my ways...

2007-09-07 Thread jake elliott
hi atendo - i think you may have some misunderstandings about what template context is and what it's doing here. maybe another look at this page: http://www.djangoproject.com/documentation/templates_python/#basics will help clear this up for you. best, jake Atendo wrote: > I think I see what

Re: Help me understand the error of my ways...

2007-09-07 Thread jake elliott
hi atendo, Atendo wrote: > If I do that, I get this error: > > > KeyError at / > 'link' > Request Method: GET > Request URL: http://localhost:8080/ > Exception Type: KeyError > Exception Value: 'link' >

Re: Form field deletion

2007-09-07 Thread jake elliott
Oleg Korsak wrote: >> Sure - use the 'fields' option to specify the subset of model fields >> you want to use on the form. >> > form_for_instance() got an unexpected keyword argument 'fields' > this argument to form_for_instance() and form_for_model() is only available in the SVN version of

Re: Help me understand the error of my ways...

2007-09-07 Thread jake elliott
hi atendo, Atendo wrote: > And then in the homepage index.html I've got this: > > {% load industry_widget %} > sorry if i miss the mark here but are you actually invoking the templatetag you've