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
`mycategory.cat
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 a
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 recently been porting many projec
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 remove all the CR's from t
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 M
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 cle
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.
>
> #
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': 'foo.html
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: TemplateS
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 "author_l
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:
http://code.djangoproject.com/wiki/BackwardsIncompati
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 l
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:
http://www.djangoproject.com/documentation/model-api/#modifying
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 t
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 bitwise
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 becaus
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 ha
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
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 locat
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
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
--~--~-~-
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 differen
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
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'
> --
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 dj
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 load
26 matches
Mail list logo