On 19-Jul-06, at 9:27 PM, arthur debert wrote:
> You should also take a look at nesh's excellent
> ImageWIthThumbnailField:
>
> http://djangoutils.python-hosting.com/wiki/Thumbnails
my one crib is that he has dropped python2.3.5 compatibility, but
this is only in the decorator part and
Actually, that leaves out the order information from LabelIngredients.
I had tried to do this with select_related(), but I couldn't get it to
follow the ForeignKey into Ingredients.
Further wizardy (and explanation) would be greatly appreciated!
That looks to have gotten me what I wanted, thanks.
Would you mind explaining how that does what I want, though? I... well,
I don't get it ;)
The actual line was:
Ingredients.objects.filter( labelingredients__baked_good = 4 )
--~--~-~--~~~---~--~~
You received
Malcolm Tredinnick wrote:
> On Wed, 2006-07-19 at 21:25 -0400, Joe wrote:
> I could have sworn I answered this just yesterday on this list:
> http://groups.google.com/group/django-users/browse_frm/thread/a13b9b12488569ef/549fa8112c0c97a7#549fa8112c0c97a7
>
> Short answer: "no problems".
Sorry,
Joe,
On Thu, 2006-07-20 at 11:41 +1000, Malcolm Tredinnick wrote:
> On Wed, 2006-07-19 at 21:25 -0400, Joe wrote:
[...]
> > The database uses the CHAR(n) (or CHARACTER(n)) datatype in several
> > places, i.e., a fixed length character type, typically for very short
> > "code" type columns.
On Wed, 2006-07-19 at 21:25 -0400, Joe wrote:
> Hi,
>
> I ran manage.py inspectdb on an existing PostgreSQL database and have
> some questions on the results.
>
> Three of the tables use the tsearch2 module which defines a 'tsvector'
> data type (to create a searchable text index). Currently,
Hi,
I ran manage.py inspectdb on an existing PostgreSQL database and have
some questions on the results.
Three of the tables use the tsearch2 module which defines a 'tsvector'
data type (to create a searchable text index). Currently, the PHP app
is unaware of the existence of these columns,
On Wed, 2006-07-19 at 16:18 -0700, Scanner wrote:
[...]
>
> This all seems to do nice things for me especially since it moves the
> representation and validation of this data in to a module whose job is
> to do that, just that the provided django fields and forms were not
> what I was after.
>
On Wed, 2006-07-19 at 22:56 +, Geta wrote:
> What's the easiest way to have Django use an existing table for the
> intermediate table for a ManyToManyField? I have a legacy database,
> with two tables and an intermediate table for the M2M relationship
> between them -- all these are pretty
On 7/19/06, Le Roux <[EMAIL PROTECTED]> wrote:
If I do something like MyModel.objects.filter(id__in=[1, 2,3]).delete(), it doesn't look like the Model instances' delete()method will get called. I have some uploaded files that have acorresponding File model that stores metadata related to files. I
Hi,
We are trying to see if we can retrofit Django on a "legacy" (albeit 3
years old) database. I had seen the FAQ about multi-column primary
keys, but I also seem to recall seeing a comment by Adrian or Jacob
stating that he was working on supporting multi-column keys (and that it
was almost
On 7/20/06, Geta <[EMAIL PROTECTED]> wrote:
I know you canspecify META.db_table to specify database table names and db_column forfield names, but I couldn't see where/if this could be set for aManyToManyField -- is it possible?
There isn't a simple way to do this - however, if you're feeling
On 7/20/06, Neilen Marais <[EMAIL PROTECTED]> wrote:
>
> Hi
>
> A photo-app I'm working on has tags on an image defined as a many to many
> relationship:
>
> class Image(models.Model):
> filename = models.CharField(maxlength=255)
> description = models.TextField()
> tags =
I have a need for extending some of the fields provided by django to do
a whole host of things from the simple and obvious to the sick and
twisted. I have stuff that is working but I was wondering if what I was
doing was the right way to go about it instead of the various bits of
pounding I have
Hi
A photo-app I'm working on has tags on an image defined as a many to many
relationship:
class Image(models.Model):
filename = models.CharField(maxlength=255)
description = models.TextField()
tags = models.ManyToManyField(Tag)
Given several tags: TagA, TagB, ..., I'm trying to
What's the easiest way to have Django use an existing table for the
intermediate table for a ManyToManyField? I have a legacy database,
with two tables and an intermediate table for the M2M relationship
between them -- all these are pretty similar to what Django would
create, but the table and
I wonder if this would be worth pursuing as a new feature for the
SelectField widget.
It makes sense to me that if one sets is_required=False then the widget
should add the "blank" option.
--~--~-~--~~~---~--~~
You received this message because you are
I'm trying to use Django to manage a pre-existing documents directory.
I'm using FilePathFields to point to files in the directory. However,
the directory contains many subdirectories, and files with repeat
names. The Admin interface, by default, just recursively scans
directories and
I think what you're after is:
Ingredients.objects.filter(label_ingredient__baked_good = self.id)
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to
Ivan Sagalaev wrote:
> Sure. This whole pluralization problem can be divided into two:
>
> 1. Enhance pluralization filter to accept language specific set of
> terminations and peek the right one by language-dependent algorithm.
> There a human is responsible for providing the exact values for
>
I can confirm that the odd behavior that you are seeing comes from
setting up the global caching for a site. I see the same thing on a
site under 0.91 that uses global caching, but not at all on other
non-caching sites. (BTW, the work around is to periodically blow away
the files *admin* in the
As far as I know, that is the way to do it. That's the way I've always
done it, but someone might know a better method of doing it.
Chris
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To
Hi,
Perhaps I'm missing something simple, but ever since I enabled caching
middleware in my apps, I've noticed that it's causing lots of strange
behaviour in my admin: updates taking a while to show up, new objects
not showing up, messages taking a while to filter through.
I'm assuming it's
Thanks, Andy. I'll give that a try!
Corey
On Jul 18, 2006, at 9:35 PM, Andrew wrote:
>
> Here's how I did it for a similar situation I had.
>
> class MyCategory(models.Model):
> category = models.CharField(maxlength=50)
> parent_category = models.ForeignKey('self', blank=True,
>
On 7/19/06, Grigory Fateyev <[EMAIL PROTECTED]> wrote:
> Now I do like so:
> [...]
> y=Article.objects.all().order_by('-pub_date').dates('pub_date','year')
> m=Article.objects.all().order_by('-pub_date').dates('pub_date','month')
Unless I'm missing something, what you want is:
date_list = []
BakedGoods, LabelIngredients, Ingredients are my tables.
LabelIngredients holds baked_goods_id, ingredients_id and an order
field. I can get the LabelIngredient objects with:
labelingredients = LabelIngredients.objects.filter( baked_good =
self.id ).order_by( 'order' )
... but what I would
Hello Adrian Holovaty!
On Wed, 19 Jul 2006 10:10:20 -0500 you wrote:
>
> On 7/19/06, Grigory Fateyev <[EMAIL PROTECTED]> wrote:
> > I want to get list of all months where objects present. First of
> > all, using date_based generic views I could not extra_context
> > additional like 'date_list',
Simon, that's just great timing!! Thanks - will check it out.
Simon Willison wrote:
> On 19 Jul 2006, at 16:22, kwe wrote:
>
> > Is there a way to display images in the list_display admin frontend?
> >
> > I tried writing a custom method for the model which returned the
> > necessary html to
You should also take a look at nesh's excellent
ImageWIthThumbnailField:
http://djangoutils.python-hosting.com/wiki/Thumbnails
cheers
arthur
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
On 19 Jul 2006, at 16:22, kwe wrote:
> Is there a way to display images in the list_display admin frontend?
>
> I tried writing a custom method for the model which returned the
> necessary html to display the image - without success. The custom
> method in the list_display just returned the raw
Is there a way to display images in the list_display admin frontend?
I tried writing a custom method for the model which returned the
necessary html to display the image - without success. The custom
method in the list_display just returned the raw html..
On 7/19/06, Grigory Fateyev <[EMAIL PROTECTED]> wrote:
> I want to get list of all months where objects present. First of all,
> using date_based generic views I could not extra_context additional
> like 'date_list', but decide to use my own view def.
Hi Grigory,
You can use the dates()
Hello, djangolers!
I want to get list of all months where objects present. First of all,
using date_based generic views I could not extra_context additional
like 'date_list', but decide to use my own view def.
def list_articles(request):
list_a = Article.objects.all().order_by('-pub_date')
On Jul 19, 2006, at 7:49 AM, Uros Trebec wrote:
> Does anyone know how to use this thing?
I do :)
But you're really going to need to give me more information about
what you're trying to do in order for me to help. Remember: specific
questions get the best answers.
Jacob
I have created a custom manipulator for a search form.
#
from django import forms
from choices import AIRCRAFT_CHOICES, phase_choices, OBJECT_CHOICES,
STATUS_CHOICES
class SelectStatusManipulator(forms.Manipulator):
def __init__(self):
self.fields = (
I second Simon on that -- it's still light years ahead of spaghetti code! =)
On 7/19/06, Simon Willison <[EMAIL PROTECTED]> wrote:
>
>
> On 19 Jul 2006, at 13:50, Maciej Bliziñski wrote:
>
> > is it possible to make the same thing without writing custom SQL code?
>
> No it isn't - but that's
On 19 Jul 2006, at 13:50, Maciej Bliziński wrote:
> is it possible to make the same thing without writing custom SQL code?
No it isn't - but that's fine, that's exactly why Django allows (and
encourages) you to roll your own SQL when you need to:
when I set mysql some fields collate utf8_bin, and then fetch these
fields is array.array,not the string I expected .this will cause that
When I try to login to the admin site I get a TypeError : a2b_base64()
argument 1 must be string or read-only character buffer, not
array.array
It seems
On Wed, 2006-07-19 at 16:57 +0400, Ivan Sagalaev wrote:
> It can look like this:
>
> Tag.objects.filter(document__tags__name='mytag').exclude(name='mytag')
Wow, that's short. Thanks.
The only thing I'm missing now is that this expression returns multiple
instances of each tag, while I need
Hi
If I do something like MyModel.objects.filter(id__in=[1, 2,
3]).delete(), it doesn't look like the Model instances' delete()
method will get called. I have some uploaded files that have a
corresponding File model that stores metadata related to files. I was
considering overriding the
On Wed, 2006-07-19 at 14:50 +0200, Maciej Bliziński wrote:
[...]
> ---
> SELECT
> dt.name,
> count(*)
> FROM
> myapp_tag AS st -- source tag
> INNER JOIN myapp_document_tags AS sti ON (st.id = sti.tag_id)
> INNER
You can learn about ContentTypes from
http://www.djangoproject.com/documentation/models/generic_relations/
and also from the code of django.contrib.comments
Good luck!
Aidas Bendoraitis [aka Archatas]
On 7/19/06, Uros Trebec <[EMAIL PROTECTED]> wrote:
>
> Hi everyone!
>
> I'm trying to figure
Maciej Bliziński wrote:
> Hello djangoers,
>
> Having documents and tags with many-to-many relationship, I'd like to
> take a tag and find its related tags. In other words, what other tags
> are associated with documents that are associated to my tag?
>
> A small(est I could make it) example:
>
Hello djangoers,
Having documents and tags with many-to-many relationship, I'd like to
take a tag and find its related tags. In other words, what other tags
are associated with documents that are associated to my tag?
A small(est I could make it) example:
myapp/models.py:
Hi everyone!
I'm trying to figure out how to use django.contrib.contenttypes. There
is no official documentation, code is not documented enough and I could
only find this [0] blog post from which I can't get anything useful
from.
Does anyone know how to use this thing?
[0]
Quick update, Ian has updated the source in svn to fix the glitch.
I've svn-uped and it everything is hunky-dory...
Thanks very much Ian, from a reported glitch at 10:16 through to
resolution by 12:31. Nice one!
Cheers,
Tone
--~--~-~--~~~---~--~~
You received
I've posted a ticket at http://zyons.python-hosting.com/ticket/3 with a
description of the problem and a possible solution based on the SQL
alias.
Funny, I would have thought there were more MySQL 4.0-4.1 people around
than that (which would have shown the glitch earlier), guess I really
do need
Thanks Ian, Malcolm, this works!;
mysql> select content_type_id, object_id, sum( unique_views) as sum_uv
from counter_objecthourcounter where site_id=1 and effective_date >=
'2006-07-18 09:50:07' and content_type_id in (30) group by
content_type_id, object_id order by sum_uv desc LIMIT 40;
On Wed, 2006-07-19 at 10:40 +, tonemcd wrote:
> I dug around a little, href="http://archives.neohapsis.com/archives/mysql/2005-q2/1966.html;>this
> helped a lot - and I found that this works (4.1.18-standard);
>
> mysql> select content_type_id, object_id, sum( unique_views) from
>
try order by 3 descOn 19/07/2006, at 8:40 PM, tonemcd wrote:I dug around a little, http://archives.neohapsis.com/archives/mysql/2005-q2/1966.html">thishelped a lot - and I found that this works (4.1.18-standard);mysql> select
I dug around a little, http://archives.neohapsis.com/archives/mysql/2005-q2/1966.html;>this
helped a lot - and I found that this works (4.1.18-standard);
mysql> select content_type_id, object_id, sum( unique_views) from
counter_objecthourcounter where site_id=1 and effective_date >=
hmm..the SQL shouldn't be that complex.. it's pretty standardcan you try running it without the date ?or perhaps changethe with content_type_id in (30) to content_type_id = 30On 19/07/2006, at 8:10 PM, tonemcd wrote:Ian,I think that's it - it definitely causes an SQL error on
Ian,
I think that's it - it definitely causes an SQL error on MySQL
4.1.18-standard.
Drat. Our main systems (where I intend to run django 'for real') are
stuck on the 4.1 series for the time being (hence why my machine is
still running 4.1.18-standard). However, as I make the final decisions
on
Hi Laurent,
On Wed, 2006-07-19 at 11:19 +0200, Laurent RAHUEL wrote:
> Hi,
>
> Does anybody already managed to use a Tsearch2 enabled table with django ORM.
> Imagine you defined a model that creates this kind of table :
>
> CREATE TABLE newsitem (
> id INT PRIMARY KEY,
> newstitle
Ah great! Thanks for the quick response!
--~--~-~--~~~---~--~~
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
didn't 'diss' it at all.bugs happen.have you tried running the SQL directly from the mysql command prompt?it doesn't cause an error on mysql 5.0.16 or 5.1.11;(maybe the trackback will help.On 19/07/2006, at 7:56 PM, tonemcd wrote:Sorry Ian, I didn't mean to diss your application in the
Sorry Ian, I didn't mean to diss your application in the main
discusssion forum! I just thought it might be a stupid user problem (I
couldn't find it in the zyons.com forum).
I've been watching the development of zyons for a while with a view to
using it for the first stage of our Zope migration
On Wed, 2006-07-19 at 02:38 -0700, [EMAIL PROTECTED] wrote:
> I have the following model:
>
> class Category(models.Model):
> name = models.CharField(core=True, maxlength=200)
> slug = models.SlugField(prepopulate_from=('name',))
> parent = models.ForeignKey('self', blank=True,
Thank you very much Malcolm ;-)
--~--~-~--~~~---~--~~
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 email to
I have the following model:
class Category(models.Model):
name = models.CharField(core=True, maxlength=200)
slug = models.SlugField(prepopulate_from=('name',))
parent = models.ForeignKey('self', blank=True, null=True,
related_name='child')
description =
Hi Tony.Thanks for giving Zyons a whirl.'popular_objects' is part of the 'counter' app which tracks what people are viewing.you don't need it installed for the rest of the app to run.that being said.he SQL you are showing me doesn't seem to contain the 'group by' command which looks like it is
On Wed, 2006-07-19 at 09:16 +, tonemcd wrote:
> Hi all,
> I'm trying to get the Zyons community/bulletin board system up and
> running - we think it could be extremely useful for a large part of our
> education community, and will assist us in migrating from Zope to
> Django. Trouble is, I
Hi,
Does anybody already managed to use a Tsearch2 enabled table with django ORM.
Imagine you defined a model that creates this kind of table :
CREATE TABLE newsitem (
id INT PRIMARY KEY,
newstitle VARCHAR(255),
newscontent TEXT,
authorid INT,
newsdate TIMESTAMP
);
In order
Hi all,
I'm trying to get the Zyons community/bulletin board system up and
running - we think it could be extremely useful for a large part of our
education community, and will assist us in migrating from Zope to
Django. Trouble is, I can't get it to work on my machine (MacBook Pro,
Python
thanks everybody, I think I´m fine from here on ...
patrick
Am 19.07.2006 um 10:04 schrieb Marc Remolt:
>
> Have a look at the 'make_random_password' method in
> 'django/contrib/auth/model.py' - it's the same principle there. In
> case
> you already have a extended user profile, I would
Have a look at the 'make_random_password' method in
'django/contrib/auth/model.py' - it's the same principle there. In case
you already have a extended user profile, I would store the activation
string there. Otherwise I'd make a dedicated model to store them with a
link to the user, the
On 19-Jul-06, at 1:11 PM, patrickk wrote:
> sorry for being stressful - but could you give an example:
> how to generate that string?
> where do you store it and how handle the expiration?
a very crude example:
http://nrcfosshelpline.in/code/browser/trunk/web/views.py
look at the 'register'
sorry for being stressful - but could you give an example:
how to generate that string?
where do you store it and how handle the expiration?
thanks,
patrick
Am 19.07.2006 um 09:40 schrieb Kenneth Gonsalves:
>
>
> On 19-Jul-06, at 12:57 PM, patrickk wrote:
>
>>
>> that makes sense to me.
>>
>>
On 19-Jul-06, at 12:57 PM, patrickk wrote:
>
> that makes sense to me.
>
> still, I have 2 more questions:
> 1. what kind of query do you use for email confirmation (how do you
> generate it)? anything special to consider here? I did use a
> combination of a password-hash with the date_joined
I did some research in the meantime and I do see the security issues.
I just underestimated the effort of doing a registration.
I already thought about your suggestion. considering the previous
arguments I decided not to store the raw password.
thanks,
patrick
Am 19.07.2006 um 09:19 schrieb
Hi
This is a personal mail. I got your message from the groups, and I
thought of
sending you this.
http://www.clubshop.com/cgi/appx.cgi/3322569
Are you finding it difficult to make money online?
There is no way to truly succeed on the Internet without a program
that actually works!
that makes sense to me.
still, I have 2 more questions:
1. what kind of query do you use for email confirmation (how do you
generate it)? anything special to consider here? I did use a
combination of a password-hash with the date_joined so far, but I´m
not sure that´s the right way to go.
Hmmm,
if you really want to send the password as you described it and have
considered the arguments of my previous posters, why don't you make a
pre-save method for your user model, which stores the clear text password
in a simple extra model (just one-to-one with clear text pass and link
to
Hi This is a personal mail. I got your message from the groups, and Ithought ofsending you this.
http://www.clubshop.com/cgi/appx.cgi/3322569
Are you finding it difficult to make money online?There is no way to truly succeed on the Internet without a program that actually works!Introducing
> For full i18n pluralization use:
>
> (from http://www.djangoproject.com/documentation/i18n/#pluralization)
> [
> {% blocktrans count list|counted as counter %}
> There is only one {{ name }} object.
> {% plural %}
> There are {{ counter }} {{ name }} objects.
> {% endblocktrans %}
> ]
>
> And in
75 matches
Mail list logo