Re: how to access a tuple in a template

2007-12-20 Thread Julian

thanks, great!
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Queryset unions... Is that a bug?

2007-12-20 Thread Malcolm Tredinnick


On Thu, 2007-12-20 at 21:33 -0800, Julien wrote:
> Thanks for the hint!
> 
> This is not the first time that I stumble on the fact that the
> documentation is ahead of the code. And that's very problematic
> because you spend hours trying to understand why it doesn't work as
> the doc says, while it's in fact a bug in the code or a feature that
> hasn't been merged in the trunk yet...

The documentation isn't in front of the code; that would be horrendously
unfair to our users. Sometimes bugs creep in though. Creating "or" joins
of querysets works sometimes and fails in some particular cases. These
things get fixed when we discover them.

Malcolm

-- 
Quantum mechanics: the dreams stuff is made of. 
http://www.pointy-stick.com/blog/


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: relational database

2007-12-20 Thread Jeff Anderson

Thanks!
I'll use the intermediary model for my solution.

Best Regards,

Jeff Anderson

Malcolm Tredinnick wrote:
> On Thu, 2007-12-20 at 22:23 -0700, Jeff Anderson wrote:
>   
>> I am used to designing relational databases, and I love django's
>> capabilities with the models and its database APIs.
>>
>> I have an app with the following models:
>>
>> Room
>> Furniture
>>
>> Room will store records like: "living room", "family room", "kitchen",
>> etc...
>> Furniture will store records like: "chair", "table", "rug", etc...
>>
>> Each room can have a chair in it, and a chair may be in multiple rooms.
>> My first thought was to use a many to many model. This would be fine,
>> until I wanted to keep a count of each type of furniture. The kitchen
>> has 4 chairs, the living room has 2.
>>
>> In a regular relational database, I'd just have a table in between that
>> stored the room id, the furniture id, and the furniture count. I'm not
>> 100% sure how to accomplish this with django's models. Should I have a
>> third model: 'count' with the manytomany room relationship, and the
>> manytomany furniture relationship, along with an integer count? Is this
>> the correct, clean way to do it? I'm not sure how that will translate to
>> my views code when I want to find a room that **only** has chairs and
>> tables.
>> 
>
> At the moment you do it this way:
> http://www.djangoproject.com/documentation/models/m2m_intermediary/ (the
> Writer model is the intermediary).
>
> "Coming Soon" (for values of 'soon' that mean 'yeah, when we get time'),
> we'll add a "through" attribute to ManyToManyField so that you can
> specify the intermediate model (which will be written just the same as
> above) but still have the benefit of direct many-to-many access when you
> need it. The only drawback of the manual intermediate table at the
> moment is that if you want to get from Reporter to Article, you need to
> manually write in the Writer model in the query construction, which is a
> little less neat than for a ManyToManyField.
>
> Regards,
> 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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Queryset unions... Is that a bug?

2007-12-20 Thread Julien

Thanks for the hint!

This is not the first time that I stumble on the fact that the
documentation is ahead of the code. And that's very problematic
because you spend hours trying to understand why it doesn't work as
the doc says, while it's in fact a bug in the code or a feature that
hasn't been merged in the trunk yet...

Cheers!

Julien

On Dec 21, 4:24 pm, Malcolm Tredinnick <[EMAIL PROTECTED]>
wrote:
> On Thu, 2007-12-20 at 21:11 -0800, Julien wrote:
> > Hi,
>
> > I've been struggling with union-ing querysets. Here's an example:
>
> > >>> qs1=User.objects.filter()
> > >>> qs1=User.objects.filter()
> > >>> qs1
> > []
> > >>> qs2
> > []
> > >>> qs1 | qs2
> > []
> > >>> qs1 or qs2
> > []
>
> > I thought that "|" was equivalent to a "or", as mentioned in the doc:
> >http://www.djangoproject.com/documentation/db-api/#complex-lookups-wi...
>
> > I'm fairly new to Django, but this look like a bug to me. Is that so?
>
> Yeah, it's a bug. See, for example, tickets #2080 and #2253. They're
> fixed on the queryset-refactor branch, so will be merged into trunk when
> that's done.
>
> Regards,
> Malcolm
>
> --
> What if there were no hypothetical questions?http://www.pointy-stick.com/blog/
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Queryset unions... Is that a bug?

2007-12-20 Thread Malcolm Tredinnick


On Thu, 2007-12-20 at 21:11 -0800, Julien wrote:
> Hi,
> 
> I've been struggling with union-ing querysets. Here's an example:
> 
> >>> qs1=User.objects.filter()
> >>> qs1=User.objects.filter()
> >>> qs1
> []
> >>> qs2
> []
> >>> qs1 | qs2
> []
> >>> qs1 or qs2
> []
> 
> I thought that "|" was equivalent to a "or", as mentioned in the doc:
> http://www.djangoproject.com/documentation/db-api/#complex-lookups-with-q-objects
> 
> I'm fairly new to Django, but this look like a bug to me. Is that so?

Yeah, it's a bug. See, for example, tickets #2080 and #2253. They're
fixed on the queryset-refactor branch, so will be merged into trunk when
that's done.

Regards,
Malcolm

-- 
What if there were no hypothetical questions? 
http://www.pointy-stick.com/blog/


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



relational database

2007-12-20 Thread Jeff Anderson

I am used to designing relational databases, and I love django's
capabilities with the models and its database APIs.

I have an app with the following models:

Room
Furniture

Room will store records like: "living room", "family room", "kitchen",
etc...
Furniture will store records like: "chair", "table", "rug", etc...

Each room can have a chair in it, and a chair may be in multiple rooms.
My first thought was to use a many to many model. This would be fine,
until I wanted to keep a count of each type of furniture. The kitchen
has 4 chairs, the living room has 2.

In a regular relational database, I'd just have a table in between that
stored the room id, the furniture id, and the furniture count. I'm not
100% sure how to accomplish this with django's models. Should I have a
third model: 'count' with the manytomany room relationship, and the
manytomany furniture relationship, along with an integer count? Is this
the correct, clean way to do it? I'm not sure how that will translate to
my views code when I want to find a room that **only** has chairs and
tables.
Any help and opinion is welcome and appreciated.

Thanks!

Jeff Anderson

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Queryset unions... Is that a bug?

2007-12-20 Thread Julien

Hi,

I've been struggling with union-ing querysets. Here's an example:

>>> qs1=User.objects.filter()
>>> qs1=User.objects.filter()
>>> qs1
[]
>>> qs2
[]
>>> qs1 | qs2
[]
>>> qs1 or qs2
[]

I thought that "|" was equivalent to a "or", as mentioned in the doc:
http://www.djangoproject.com/documentation/db-api/#complex-lookups-with-q-objects

I'm fairly new to Django, but this look like a bug to me. Is that so?

Thanks!

Julien
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: django newforms and base_fields

2007-12-20 Thread Empty

This is not a very secure thing to do.  But if you must, then just use
initial to set the value.

Michael Trier
blog.michaeltrier.com

On Dec 20, 2007 2:32 PM, mike <[EMAIL PROTECTED]> wrote:
>
> Hello, I am looking for a way to auto-populate a newforms field, I
> would like to have the input hidden, and be auto-populated with the
> name field of the Customer class the Issue class is a foreign key to
> the Customer class can anyone point me in the right direction, any
> help would be appreciated, should I use base_fields or is there a
> better way?
>
>
> def add_edit_customer(request, id=None):
>if id is None:
> CustomerEntryForm = forms.form_for_model(Customer)
>else:
> IssueEntryForm = forms.form_for_model(Issue)
> entry = get_object_or_404(Customer, pk=id)
> issues = Issue.objects.filter(name=entry.name)
> CustomerEntryForm = forms.form_for_instance(entry)
> cust1 = Customer.objects.get(pk=id)
> issues = Issue.objects.filter(customer=cust1)
> IssueEntryForm.base_fields['customer'].widget =
> widgets.HiddenInput()
> IssueEntryForm.base_fields['customer'] = cust1.name
>
> >
>

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Form result notices

2007-12-20 Thread Empty

> I'll look into it, but before I go too far down one track, could
> anybody give some advice on how to approach it using sessions?

Here's an example:

http://staticallytyped.com/2007/05/17/rails-flash-now-for-django/

It's simply middleware that handles stuffing, retrieving, and clearing.

Michael Trier
blog.michaeltrier.com

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Database filters

2007-12-20 Thread kbochert



On Dec 20, 11:49 am, pk <[EMAIL PROTECTED]> wrote:
> Are you using the built-in Group and User classes? If what you are
> quoting is cut-and-pasted from your console, you maybe using your own
> model? Maybe you should show us the actual source code.
>
> FYI -- the built-in classes are django.contrib.auth.models.Group
> and ..User
> not Groups nor Users
>
OOps. just a typo. I did use the singular.  Those lines were copied
from the console, not pasted - I'm using Win200 & don't know how to
copy from the console.
My description  also did not mention the
>>>from django.contrib.auth.models import User, Group
with which I started the shell session.


The models are the built-in django models.

>>>U.all().filter(groups__name = 'Admin')
returns a list of all the users as long as any existing groups_name
is  used.

>>>U.all().filter(groups__name = 'Non_existant_groupname')
returns an empty list.

 My Django version (from django/__init__py' is
VERSION = (0, 97, 'pre')

It was an svn snapshot retrieved for me by the folks at the Satchmo
product on
9 Sep 07, labeled 'django_5947'  (if any of that means something to
you!)

-regards
-Karl
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Authenticate Trac against Django users.

2007-12-20 Thread Kenneth Gonsalves


On 21-Dec-07, at 12:59 AM, Waylan Limberg wrote:

> I've worked up the beginnings of a Trac plugin that authenticates
> against Django users. I've since determined that I'm not likely to use
> it.

why are you unlikely to use it?

-- 

regards
kg
http://lawgon.livejournal.com
http://nrcfosshelpline.in/web/
Foss Conference for the common man: http://registration.fossconf.in/web/



--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Making translations appear without server restart?

2007-12-20 Thread James

On Dec 19, 7:47 pm, Rajesh Dhawan <[EMAIL PROTECTED]> wrote:
> > As I mentioned in my other post, it doesn't work for the one process.
>
> My previous code snippet missed an important statement. You will need
> to first get an instance of _transactions from trans_real.py before
> you declare it to be global. So, check if something like this helps:
>
> from django.utils import translation
> translation.deactivate_all()
> _translations = translation.trans_real._translations # <--- Note this
> globals _translations
> _translations = {}
> from datetime import datetime
> globals _translations_loadtime
> _translations_loadtime = datetime.now()
>  translation.activate()
>

Tried the above, but _translations is still getting repopulated
somewhere and won't pick up the new translations.

> 
> James Bennett has a nice article about server startup in which one
> section talks about registries. It might be worth it to peruse that
> even though it doesn't directly address this problem.
>
> See:http://www.b-list.org/weblog/2007/nov/05/server-startup/

Useful information, thanks.
James
>
> -Rajesh
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: forms.form_for_model

2007-12-20 Thread rskm1

On Dec 20, 2:58 pm, mike <[EMAIL PROTECTED]> wrote:
> anyone know how to auto assign a variable to my form field?
>
> IssueEntryForm.base_fields['customer'].widget = widgets.HiddenInput()
> IssueEntryForm.base_fields['customer'].widget = HELP

I'm not sure I understand the question; what exactly do you mean by
"auto assign a variable"?

If you're looking for a way to set the value of a field in an un-bound
form, just do the usual:
  IssueEntryForm.initial['customer'] = "Blah, Inc."

Since there was no visibly editable field, the *bound* form you create
after the HttpRequest.POST submission comes back will have an
unmolested "Blah, Inc." value in
IssueEntryForm.cleaned_data['customer']


(If that's not what you were after, you may want to elaborate.  Your
example code looks like you want to dynamically determine what the
widget for the field will be, but that doesn't match the question you
asked...)

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: how to access a tuple in a template

2007-12-20 Thread Alex Koshelev

{{tuple.0}}
{{tuple.1}}

On 21 дек, 01:30, Julian <[EMAIL PROTECTED]> wrote:
> hi,
>
> i am passing a tuple (1,2) to a template in a variable like this:
>
> render_to_response("template.html",{"tuple":(1,2)})
>
> how can i access the single-values without a for-loop in the template?
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Form result notices

2007-12-20 Thread Julien

Hi guys, thanks for your replies.

What I'm trying to achieve is to give feedback with a quick notice
each time the user accomplishes an action (e.g. create/edit/delete/
send/etc.).
So I need a quite generic and flexible solution.

The "Messages" solution pointed out by James looks very good, except
that it only works when the user is authenticated. The same article
also mentions that to make it work for non authenticated users you
should use sessions: http://www.djangoproject.com/documentation/sessions/

I'll look into it, but before I go too far down one track, could
anybody give some advice on how to approach it using sessions?

Cheers!

Julien

On Dec 21, 12:39 am, "James Bennett" <[EMAIL PROTECTED]> wrote:
> On Dec 20, 2007 6:09 AM, Julien <[EMAIL PROTECTED]> wrote:
>
> > I'd like to hear your advice on the best way to go with displaying
> > form result notices.
>
> > For example, after editing an object via a newform, the following page
> > displays a notice that says "Object successfully updated".
>
> It's documented here:
>
> http://www.djangoproject.com/documentation/authentication/#messages
>
> --
> "Bureaucrat Conrad, you are technically correct -- the best kind of correct."
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: how to handle a zero-based pagination in templates as one-based?

2007-12-20 Thread Julian

okay, thanks. i think this will bring me to a comfortable solution.
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Time zone settings

2007-12-20 Thread Ryan K

Nevermind on this.
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: how to handle a zero-based pagination in templates as one-based?

2007-12-20 Thread Brian Rosner

On 2007-12-20 14:33:47 -0700, Julian <[EMAIL PROTECTED]> said:

> 
> hi there,
> 
> I do want to use pagination, but I don't know how to solve a problem.
> 
> template-code:
> 
> {% for p in paginator.page_range %}
> {{p}}
> {% endfor %}
> 
> but obviously it should be:
> 
> {% for p in paginator.page_range %}
> {{p}}
> {% endfor %}

You need to write a templatetag to do this. Check out 
http://www.djangoproject.com/documentation/templates_python/#shortcut-for-simple-tags


because 

> in my-view I use the objectpaginator object zero-based, but
> page_range (for the template-output) is one-based.
> 
> this wouldn't be a problem if i could switch to 1-based object-
> pagination. so how do i dow? write my own object-pagionation-subclass?
> 
> 

-- 
Brian Rosner
http://oebfare.com



--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Time zone settings

2007-12-20 Thread Ryan K

Hello. I want to use the pytz package. It has a tzinfo objects called
pytz.UTC that it recommends you store as the general timezone. Is
there a way for Django to set the tz to pytz.UTC whenever it deals
with datetimes?

Thanks,
Ryan Kaskel
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: capturing multiple events on a signle date in a Calendar app

2007-12-20 Thread Rajesh Dhawan



On Dec 20, 4:38 pm, "Ramdas S" <[EMAIL PROTECTED]> wrote:
> Thanks Rajesh,
>
> I am not sure about  Choices, since there are some 12 stages, with condition
> at couple of  stages. I do not know how to conditionalize the choice fields.

I just threw in the choices option there as from your initial spec it
looked like the tender has a limited number of known stages. Since
that's not true, you can just use a plain CharField without the
options attribute.

> Also this would mean that for a single tender, we create 12-14 instances of
> the Calendar Table. Advise, please

I don't see anything wrong with that. Personally, I think it's more
flexible than creating a lot of dedicated date_* fields for each of
the stages.

Also, this approach facilitates easily building query sets that fetch
everything happening to all tenders on a given date as you had
requested. And it also lets you invent new stages without any future
model changes.

-Rajesh



--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: capturing multiple events on a signle date in a Calendar app

2007-12-20 Thread Rajesh Dhawan


>
> What is the best method to capture, all events happening on a specific day.
>
> The view must give a report
>
> when you try the url  calendar/2007/dec/20
> On December 20th 2007
>
> Tender 222 date of announcement
> Tender 243 last date for receiving bids
> Tender 227 date for recieving final bid
> Tender 270 date of opening of bid

Here's one way to model that:

class Calendar(models.Model):
date = models.DateField() # what date
tender = models.ForeignKey(Tender) # which tender
# what happens to this tender on this date:
tender_stage = models.CharField(choices=TENDER_STAGE_CHOICES)

where TENDER_STAGE_CHOICES is something like:
TENDER_STAGE_CHOICES = (
('announcement', 'Date of announcement'),
('bid-last-date', 'Date for receiving final bid'),
#...and so on
)

In this model, the tender_stage field gives the date field its meaning
(e.g. if tender_stage is 'announcement', the date is an announcement
date.)

-Rajesh
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



forms.form_for_model

2007-12-20 Thread mike

anyone know how to auto assign a variable to my form field?


IssueEntryForm.base_fields['customer'].widget = widgets.HiddenInput()
IssueEntryForm.base_fields['customer'].widget = HELP

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: date_hierarchy on a ForeignKey?

2007-12-20 Thread Rajesh Dhawan

Hi John,

> My hunch is the answer is "No," but is it possible to do a
> 'date_heirarchy' on a ForeignKey date object? Haven't been able to
> find anything in the archive on the topic. Pointers gratefully
> accepted.

Your hunch is right. The admin date_hierarchy works only with date and
datetime objects that are direct fields of the model.

-Rajesh
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Authenticate Trac against Django users.

2007-12-20 Thread Dirk Eschler

On Donnerstag, 20. Dezember 2007, Waylan Limberg wrote:
> I've worked up the beginnings of a Trac plugin that authenticates
> against Django users. I've since determined that I'm not likely to use
> it. So, is anyone interested in using and/or maintaining it? If so,
> I'll throw it up on trac-hacks.org.
>
> The basic functionality works. I can login to my django app and then
> I'm instantly logged into trac (without retyping my username and
> password). If I log out of my django app, I'm instantly logged out of
> trac.
>
> It works by getting the django session from the django cookie and
> extracting the user from the django database. Of course, for this to
> work, both the trac and django instances need to be on the same
> machine (to access eachother) and behind the same domain (to access
> the cookie). I also have the beginnings of some code to assign
> permissions within django for trac via django's user groups. For some
> undetermined reason I haven't been able to override the login/out
> links in the  nav and there's some debug code that needs removed.
>
> PS. I've cross-posted this to both django-users and trac-users as
> there may be interest in each group. I'll try to copy both lists with
> responses to any questions.

Hello Waylan,

please throw it up! :)

I've been looking for something like that for quite some time.

Best Regards,
Dirk Eschler

-- 
Dirk Eschler 
http://www.krusader.org

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



date_hierarchy on a ForeignKey?

2007-12-20 Thread JHeasly

My hunch is the answer is "No," but is it possible to do a
'date_heirarchy' on a ForeignKey date object? Haven't been able to
find anything in the archive on the topic. Pointers gratefully
accepted.

John
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Database filters

2007-12-20 Thread pk

Are you using the built-in Group and User classes? If what you are
quoting is cut-and-pasted from your console, you maybe using your own
model? Maybe you should show us the actual source code.

FYI -- the built-in classes are django.contrib.auth.models.Group
and ..User
not Groups nor Users

P>P.K.


On Dec 20, 11:13 am, kbochert <[EMAIL PROTECTED]> wrote:
> I have an app, and I have added 3 Users in 2 Groups.
> How do I get the users that belong to a specific Group??
>
> Using the shell on the built in Django models I get:>>> G = Groups.objects
> >>> U = Users.objects
> >>> U.all()
>
> [, ]>>> G.all()
>
> [, ]
>
> Ok so far?  ( the double User: in U.all() concerns me a bit)
>
> >>>U.all().filter(groups__id = 1)
> []
> >>>U.all().filter(groups__id = 2)
>
> []
>
> Makes sense- I've used the admin to put one user in each group.
>
> >>>U.all().filter(groups__name = 'Admin')
>
> [, ]
>
> ??? Why both users???
> Shouldn't this give me a list of the Users in the 'Admin' group?
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Very Easy Question

2007-12-20 Thread Richard D. Worth
Don't know why you're getting that (I've never tried 0.96, only svn), but
the easiest thing is just to copy the django subfolder into
C:\Pythong25\lib\site-packages\

To test that it works, enter a python prompt and type:
>>> import django
>>>

- Richard

On Dec 19, 2007 3:55 PM, Trev <[EMAIL PROTECTED]> wrote:

>
> Hi, This should take 2 seconds for an experience Django user.
> I'm trying to install Django on windows XP. I've installed python 2.5
> and MySQL with MySQLdb as the interface.
> However when I try installing django from DOS I get this error
>
> C:\Django-0.96.1>setup.py install
> running install
> running build
> running build_py
> error: package directory '\django' does not exist
>
> There is actually a django subdirectory in Django-0.96.1 so I can't
> figure it out.
> Please Help!
>
>
> >
>

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Very Easy Question

2007-12-20 Thread Alexey Moskvin

Looks strange, I have never used "install.py" for WinXP, see this
tutorial: http://thinkhole.org/wp/django-on-windows/.

On 19 дек, 23:55, Trev <[EMAIL PROTECTED]> wrote:
> Hi, This should take 2 seconds for an experience Django user.
> I'm trying to install Django on windows XP. I've installed python 2.5
> and MySQL with MySQLdb as the interface.
> However when I try installing django from DOS I get this error
>
> C:\Django-0.96.1>setup.py install
> running install
> running build
> running build_py
> error: package directory '\django' does not exist
>
> There is actually a django subdirectory in Django-0.96.1 so I can't
> figure it out.
> Please Help!
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Getting exception when trying to generate feed

2007-12-20 Thread Rajesh Dhawan

> The class main_feed is,
>
> def main_feed (Feed):

That should be:

class main_feed(Feed):

-Rajesh
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Access this site - Project Management

2007-12-20 Thread Sergio Laranja

Access this site - Project Management
http://sergiolaranja.blogspot.com/

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Getting exception when trying to generate feed

2007-12-20 Thread shabda

I am trying to generate a feed.
So I added the following lines to urls.py

feeds = {'latest': main_feed}
urlpatterns += patterns('',
  (r'^rss/(?P.*)/$', 'django.contrib.syndication.views.feed',
{'feed_dict': feeds})
  )

The class main_feed is,

def main_feed (Feed):
blog = Blog.objects.all()[0]
title = blog.title
link = "/rss/latest/"
description = blog.description
def items (self):
   entries = BlogEntry.entry.all()[:blog.recents * 2]
   return entries

Now I should be getting the feed at /rss/latest/ , but I am getting an
error like
TypeError at /rss/latest/
main_feed() takes exactly 1 argument (2 given)

Full error stack,
Traceback:
File "C:\Python24\lib\site-packages\django\core\handlers\base.py" in
get_response
  82. response = callback(request, *callback_args,
**callback_kwargs)
File "C:\Python24\lib\site-packages\django\contrib\syndication
\views.py" in feed
  19. feedgen = f(slug, request).get_feed(param)

Exception Type: TypeError at /rss/latest/
Exception Value: main_feed() takes exactly 1 argument (2 given)

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: PYSQLITE

2007-12-20 Thread newDjangoer

Yes I am running OS X 10.4.11. I guess I will move up to 2.5. thanks!

On Dec 20, 11:54 am, Jan Rademaker <[EMAIL PROTECTED]> wrote:
> newDjangoer wrote:
> > I am installing pysqlite 2.4.0. I have python 2.3.5 installed and
> > sqlite 3.1.3. When I run the python setup.py build I get this :
>
> > skcompxp:~/Desktop/pysqlite-2.4.0 sptxk$ python setup.py build
> > running build
> > running build_py
> > running build_ext
> > building 'pysqlite2._sqlite' extension
> > gcc -fno-strict-aliasing -Wno-long-double -no-cpp-precomp -mno-fused-
> > madd -fno-common -dynamic -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -
> > DMODULE_NAME="pysqlite2.dbapi2" -I/usr/include -I/System/Library/
> > Frameworks/Python.framework/Versions/2.3/include/python2.3 -c src/
> > row.c -o build/temp.darwin-8.11.1-i386-2.3/src/row.o
> > unable to execute gcc: No such file or directory
> > error: command 'gcc' failed with exit status 1
> > skcompxp:~/Desktop/pysqlite-2.4.0 sptxk$
>
> You need gcc, which is a C compiler. Judging by the error messages you
> run some version of OS X, correct? If so, you can either install the
> 'Developer Tools', which can be found on the OS X install disk, or
> install Python 2.5 which has sqlite support built-in.
>
> I would say; upgrade to 2.5. There's a nice installer available 
> athttp://www.python.org/download/releases/2.5.1/.1
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: PYSQLITE

2007-12-20 Thread Jan Rademaker



newDjangoer wrote:
> I am installing pysqlite 2.4.0. I have python 2.3.5 installed and
> sqlite 3.1.3. When I run the python setup.py build I get this :
>
> skcompxp:~/Desktop/pysqlite-2.4.0 sptxk$ python setup.py build
> running build
> running build_py
> running build_ext
> building 'pysqlite2._sqlite' extension
> gcc -fno-strict-aliasing -Wno-long-double -no-cpp-precomp -mno-fused-
> madd -fno-common -dynamic -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -
> DMODULE_NAME="pysqlite2.dbapi2" -I/usr/include -I/System/Library/
> Frameworks/Python.framework/Versions/2.3/include/python2.3 -c src/
> row.c -o build/temp.darwin-8.11.1-i386-2.3/src/row.o
> unable to execute gcc: No such file or directory
> error: command 'gcc' failed with exit status 1
> skcompxp:~/Desktop/pysqlite-2.4.0 sptxk$

You need gcc, which is a C compiler. Judging by the error messages you
run some version of OS X, correct? If so, you can either install the
'Developer Tools', which can be found on the OS X install disk, or
install Python 2.5 which has sqlite support built-in.

I would say; upgrade to 2.5. There's a nice installer available at
http://www.python.org/download/releases/2.5.1/.
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Any SELECT returns no results via Django

2007-12-20 Thread Jan Rademaker



On Dec 20, 1:41 am, Gloria W <[EMAIL PROTECTED]> wrote:
> I am boggled. A SELECT from the MySql command line works just fine.
> But within Django, it returns nothing. It doesn't matter what SQL
> statement I issue.
>
> Here is my syntax:
>
>  from django.db import connection
>   cursor = connection.cursor()
>   cursor.execute("use editorial_production_2007_12_14; SELECT
> category_id,message_id FROM categories_messages")
>
>  rows = cursor.fetchall()

Btw, if 'editorial_production_2007_12_14' is the name of the database
you specified in settings.py there's no reason to manually select it.
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Any SELECT returns no results via Django

2007-12-20 Thread Jan Rademaker



On Dec 20, 1:41 am, Gloria W <[EMAIL PROTECTED]> wrote:
> I am boggled. A SELECT from the MySql command line works just fine.
> But within Django, it returns nothing. It doesn't matter what SQL
> statement I issue.
>
> Here is my syntax:
>
>  from django.db import connection
>   cursor = connection.cursor()
>   cursor.execute("use editorial_production_2007_12_14; SELECT
> category_id,message_id FROM categories_messages")
>
>  rows = cursor.fetchall()

Try executing those queries one at a time. I don't know about the
other database backends, but the MySQL driver can only execute 1 query
at a time.

>
> I'm stuck using Django 0.95 and Python 2.4 on an X86-64 Linux box.
>
> Has anyone else experienced this?
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



PYSQLITE

2007-12-20 Thread newDjangoer

I am installing pysqlite 2.4.0. I have python 2.3.5 installed and
sqlite 3.1.3. When I run the python setup.py build I get this :

skcompxp:~/Desktop/pysqlite-2.4.0 sptxk$ python setup.py build
running build
running build_py
running build_ext
building 'pysqlite2._sqlite' extension
gcc -fno-strict-aliasing -Wno-long-double -no-cpp-precomp -mno-fused-
madd -fno-common -dynamic -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -
DMODULE_NAME="pysqlite2.dbapi2" -I/usr/include -I/System/Library/
Frameworks/Python.framework/Versions/2.3/include/python2.3 -c src/
row.c -o build/temp.darwin-8.11.1-i386-2.3/src/row.o
unable to execute gcc: No such file or directory
error: command 'gcc' failed with exit status 1
skcompxp:~/Desktop/pysqlite-2.4.0 sptxk$


can anyone help
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Database filters

2007-12-20 Thread kbochert

I have an app, and I have added 3 Users in 2 Groups.
How do I get the users that belong to a specific Group??

Using the shell on the built in Django models I get:
>>> G = Groups.objects
>>> U = Users.objects
>>> U.all()
[, ]
>>> G.all()
[, ]

Ok so far?  ( the double User: in U.all() concerns me a bit)

>>>U.all().filter(groups__id = 1)
[]
>>>U.all().filter(groups__id = 2)
[]

Makes sense- I've used the admin to put one user in each group.


>>>U.all().filter(groups__name = 'Admin')
[, ]

??? Why both users???
Shouldn't this give me a list of the Users in the 'Admin' group?

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Any SELECT returns no results via Django

2007-12-20 Thread Gloria W

More info on this: I am connecting to the db via an ssh tunnel. In the
settings-*.py files, I use
DATABASE_HOST = '127.0.0.1'
Works like a charm, except with the connection module. It is probably
not connecting.
Help!
Gloria

On Dec 19, 7:41 pm, Gloria W <[EMAIL PROTECTED]> wrote:
> I am boggled. A SELECT from the MySql command line works just fine.
> But within Django, it returns nothing. It doesn't matter what SQL
> statement I issue.
>
> Here is my syntax:
>
>  from django.db import connection
>   cursor = connection.cursor()
>   cursor.execute("use editorial_production_2007_12_14; SELECT
> category_id,message_id FROM categories_messages")
>
>  rows = cursor.fetchall()
>
> I'm stuck using Django 0.95 and Python 2.4 on an X86-64 Linux box.
>
> Has anyone else experienced this?
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: How to make fields with editable=False visible in the Admin interface

2007-12-20 Thread James Bennett

On Dec 20, 2007 9:03 AM, GodOfGeeks <[EMAIL PROTECTED]> wrote:
> The problem is that when I set the fields to editable=False then they
> won't be visible in the adminModel

The admin interface is deliberately designed not to have
"display-only" data -- the thinking has been that things which can't
be edited aren't really being "administered".

So your best bet is probably to write a custom template to override
the admin template for that specific model and, rather than trying to
force the admin to display the fields without making them editable,
simply insert some template code which displays the values (IIRC the
object being edited is represented in the template by the variable
"original").


-- 
"Bureaucrat Conrad, you are technically correct -- the best kind of correct."

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Problem with ForeignKeys that references a huge table

2007-12-20 Thread GodOfGeeks

Hello,

I will start with the code directly which will make it much easier to
explain:)

class ProceedingsEditor( models.Model ):

  contact   = models.ForeignKey( Contact )

The point here is that the contact table is a 10,000 or so field so a
drop down list is none sense

Now in the admin model

class  ProceedingsEditorOptions( admin.ModelAdmin ):

raw_id_fields = ( 'contact', )

Now Django will just display a normal text field with a Magnifying
glass icon beside it. All is good till now

The problem is that Django displays the contact id which is not useful
at all. Is there a way to reference for

example the contact__unicode() or something with a more meaningful
name??

Thanks in advance

Cheers
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



How to make fields with editable=False visible in the Admin interface

2007-12-20 Thread GodOfGeeks

Hello all,

I have a problem and I have been googling around for many days for the
solution without any hope. It will be great if someone can help me out
with it.

I have a model Called 'Country' with the following fields

male_count = models.SmallIntegerField( null=True, blank=True,
editable=False )
""" Nubmer of male members in country (computed field). """

female_count = models.SmallIntegerField( null=True, blank=True,
editable=False )
""" Nubmer of female members in country (computed field). """

total_members = models.IntegerField( null=True, blank=True,
editable=False )

And my admin model

class CountryOptions( admin.ModelAdmin ):

 fieldsets = ( ...etc

What I want is to have the male_count, female_count and the
total_member fields visible when editing or adding a new country.

The problem is that when I set the fields to editable=False then they
won't be visible in the adminModel

any ideas?. Thanks in advance I really appreciate it


Cheers


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Generic Relation: Alter Table

2007-12-20 Thread Rajesh Dhawan

On second thoughts, "sqlall" might be better since it prints out
indexes, initial_data, etc:

python manage.py sqlall 


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: How to make sure that table has only one row?

2007-12-20 Thread Marty Alchin

I'm not sure what your end goal is here, but since you seem to be
storing settings in a database, you might consider my dbsettings
app[1], designed for exactly that purpose. I can't guarantee it does
what you need, but it's probably worth looking into.

To answer your question specifically though, you would also need to
check to see whether the save() would produce an update or insert
statement, by looking at the id value. Try something like this:

def save(self):
"""There should not be more than one Blog object"""
if Blog.objects.count() and not self.id:
raise "Only one blog object allowed."
super(Blog, self).save() # Call the "real" save() method.

But if you really are storing settings, I think you'll find that
dbsettings can save you quite a bit of work.

-Gul

[1] http://code.google.com/p/django-values/

On Dec 20, 2007 9:32 AM, shabda <[EMAIL PROTECTED]> wrote:
>
> I have  tabble where I am storing sitewide settings. So I want only
> one row to be created in this table. I am trying to enforce this by
> over riding the save method.
>
> If I do something like
>  def save (self):
> """There should not be more than one Blog object"""
> if Blog.objects.count() > 1:
>raise "Only one blog object allowed."
> super(Blog, self).save() # Call the "real" save() method.
>
> I can get two rows, as when the second time save gets called, count is
> only one.
>
> If I do something like
>  def save (self):
> """There should not be more than one Blog object"""
> if Blog.objects.count() >= 1:
>raise "Only one blog object allowed."
> super(Blog, self).save() # Call the "real" save() method.
> Only one object is allowed, but updates wil fail. How can I enforce
> single rows only?
> >
>

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: should I uninstall/reinstall? how? ubuntu specific quetion

2007-12-20 Thread pug2694328

Excellent!  Thanks.  I think that's what I needed.
--pug

On Dec 19, 11:03 pm, "Eduardo - IdNotFound" <[EMAIL PROTECTED]>
wrote:
> On Dec 20, 2007 1:06 AM, pug2694328 <[EMAIL PROTECTED]> wrote:
>
>
>
> > However, when delving into tutorials they keep referring to the
> > subversion version of Django.
>
> As someone already pointed out, docs for 0.96 are avaiable on the website.
>
> > How do I uninstall all versions of Django on my Ubuntu Linux box?
> > How do I then install the subversion version and keep it updated?
>
> Uninstalling a package in Ubuntu can be made with the following
> command on a terminal:
> sudo apt-get remove package_name
>
> I believe instructions for the subversion installation are avaiable on
> the Django website. You might need to install the "subversion" package
> in Ubuntu, and it should be enough. If you still have problems, write
> back.
>
> FWIW, I am running the development server from Django SVN on Ubuntu
> Feisty (7.04). Everything works fine and I only had to install by hand
> Django itself. Other dependencies (such as Python, MySQL and MySQLdb)
> I got from Ubuntu's repositories. I use MySQL, so I haven't checked
> the versions for PostgreSQL, but they should be fine too.
>
> Hope it helps,
> Eduardo "IdNotFound"
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Generic Relation: Alter Table

2007-12-20 Thread madhav

as a part of  using generic relations, i got struck up at one point,
where i need to run the sql to have a field:
summary = generic.GenericRelation(Summary)

where Summary is a class defined as:
class Summary(models.Model):
id = models.AutoField(primary_key=True)
content_type = models.ForeignKey(ContentType)
content_object = generic.GenericForeignKey()
created_on = models.DateTimeField(auto_now_add= True)
modified_on = models.DateTimeField(auto_now= True)

And I am using a class called Book which will be having the summary
field mentioned above. So to alter the Book model at the database
level, i need to run the alter table for Book. I dont know the
equivalent sql to create a generic relation column in the table.
Please help me.
Thanks in advance.
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: i18n/setlang no longer support GET

2007-12-20 Thread yml

Hello,

I wrote an my blog about the solution I have chosen perform what is
describes. To put it in a nutshell I am using a middleware to direct
the user to the language requested in the URL. I am not sure this
follow any "Best Practice":
http://yml-blog.blogspot.com/2007/12/django-internationalisation.html

May be this could help you.
--yml

On 20 déc, 00:32, "James Bennett" <[EMAIL PROTECTED]> wrote:
> On Dec 19, 2007 12:59 PM, Poromenos <[EMAIL PROTECTED]> wrote:
>
> > My application's UI depends on the set_language view being a link, and
> > I don't think it should be up to the framework to force this on the
> > developer. It would be better if the view supported both ways and the
> > developer could choose whether they wanted functionality or spec
> > compliance. This isn't a simple change, and it shouldn't be decided
> > just like that...
>
> So write your own view which uses GET. Django encourages best
> practices, and that includes following the recommendations of the HTTP
> specification. You are free to throw down and trample the spec as much
> as you like in your own code, but don't expect Django to help you with
> it.
>
> --
> "Bureaucrat Conrad, you are technically correct -- the best kind of correct."
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: problem with auditTrail

2007-12-20 Thread Marty Alchin

My guess is that you're using 0.96, or if you're using SVN, you're
using a revision before r6269. I've just updated the wiki article to
reflect this requirement.

-Gul

On 12/20/07, worker <[EMAIL PROTECTED]> wrote:
>
> Hi to everybody,
> I need help  from those who have already used AuditTrail:
> http://code.djangoproject.com/wiki/AuditTrail
> I'm having this problem: : _audit() takes
> exactly 3 non-keyword arguments (2 given),
>
> Thanks in advance
> >
>

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Form result notices

2007-12-20 Thread Julien

Hello there,

I couldn't find any help on the web or on this forum yet, so here I
am  :)

I'd like to hear your advice on the best way to go with displaying
form result notices.

For example, after editing an object via a newform, the following page
displays a notice that says "Object successfully updated".

Thanks a lot!

Julien
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Add "georss" tag to feeds

2007-12-20 Thread Daniel de la Cuesta

Hi all,

I want to add the geo tag (with latitude and longitude) to each item
of my feeds:

45.256 -71.92
I am using the feeds framework:

class LatestEvents(Feed):
   title = "Latest Events"
   link = "/events/"
   def items(self):
   return Event.objects.order_by('-start_date')[:5]

Is there any way to add the new node to each item returned by
"items()"
Thank you.

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Add my link

2007-12-20 Thread Rahul Dewan
Hello,

I am not sure what you have to do with this list? I could not find anything
to do with Django on your website.
Please do not spam this developer list.

Thanks,
Rahul

-- 
Srijan Technologies Pvt. Ltd. INDIA
www.srijan.in | [EMAIL PROTECTED]
91-11-2622 5926 / 2622 5931  |  Fax: 91-11-4160 8543
Blog: http://blogs.srijan.in
CSR: http://srijanfoundation.wordpress.com/


On 12/20/07, Tandon <[EMAIL PROTECTED]> wrote:
>
>
> Title:
> Custom Software Solutions Provider
>
> URL:
> http://www.tandoninfo.com
>
> Description:
> Tandoninfo: Custom Software Solutions Provider - We provide Custom
> software development services like application development, web
> development, Project management, quality testing. We also provide SAP
> Business one implementation, Support, add-on product development
> services.
> >
>

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



problem with auditTrail

2007-12-20 Thread worker

Hi to everybody,
I need help  from those who have already used AuditTrail:
http://code.djangoproject.com/wiki/AuditTrail
I'm having this problem: : _audit() takes
exactly 3 non-keyword arguments (2 given),

Thanks in advance
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Add my link

2007-12-20 Thread Tandon

Title:
Custom Software Solutions Provider

URL:
http://www.tandoninfo.com

Description:
Tandoninfo: Custom Software Solutions Provider - We provide Custom
software development services like application development, web
development, Project management, quality testing. We also provide SAP
Business one implementation, Support, add-on product development
services.
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Admin-editable configuration for Django?

2007-12-20 Thread Jarek Zgoda

James Bennett napisał(a):

>> While this might work for the options I defined by myself, the standard
>> settings options "should not be changed in runtime" (according to docs).
>> Did anybody manage to solve this issue?
> 
> Have you looked at Marty's dbsettings project?
> 
> http://code.google.com/p/django-values/

Yes. Unfortunately I am still on 0.96.

-- 
Jarek Zgoda
Skype: jzgoda | GTalk: [EMAIL PROTECTED] | voice: +48228430101

"We read Knuth so you don't have to." (Tim Peters)

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Django icons

2007-12-20 Thread konryd

Someone created these cool leopard icons for lighttpd and rails. I
guess it should be quite easy for someone with skills to create green
django icons. Anyone?

And here's the link
http://www.wishingline.com/notebook/2007/12/railslighttpdiconsforleopard/


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Admin-editable configuration for Django?

2007-12-20 Thread James Bennett

On Dec 20, 2007 4:55 AM, Jarek Zgoda <[EMAIL PROTECTED]> wrote:
> While this might work for the options I defined by myself, the standard
> settings options "should not be changed in runtime" (according to docs).
> Did anybody manage to solve this issue?

Have you looked at Marty's dbsettings project?

http://code.google.com/p/django-values/


-- 
"Bureaucrat Conrad, you are technically correct -- the best kind of correct."

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Admin-editable configuration for Django?

2007-12-20 Thread Jarek Zgoda

Recently I got a request from Django site operator to be able to modify
some options we had put into settings.py file. Now changes to some
business-related options require server restart (i.e. change to
DEFAULT_FROM_EMAIL, which isn't that exotic). I'd like to give site
admin an option to modify a subset of settings options without the need
to restart Django process. My initial idea was to use general config
file (in a format ConfigParser is using) and define these options there.
While this might work for the options I defined by myself, the standard
settings options "should not be changed in runtime" (according to docs).
Did anybody manage to solve this issue?

-- 
Jarek Zgoda
Skype: jzgoda | GTalk: [EMAIL PROTECTED] | voice: +48228430101

"We read Knuth so you don't have to." (Tim Peters)

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Store a class in django session object

2007-12-20 Thread can xiang

You can't do this because a model instance isn't pickleable. You can
save the product id instead.

This is documented under:
http://www.djangoproject.com/documentation/sessions/#technical-details


On Dec 20, 2007 4:03 PM, Daniel Austria <[EMAIL PROTECTED]> wrote:
>
> Hi all,
>
> is there something to bear in mind, if i store a instance of a class
> in a django session? e.g. there is a class product and i want to 
> request.session['CURRENT_PRODUCT'] = myproduct
>
> As far as i know, this should be allowed. Isn't it?
>
> Greets,
> Dan
> >
>

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Store a class in django session object

2007-12-20 Thread Daniel Austria

Hi all,

is there something to bear in mind, if i store a instance of a class
in a django session? e.g. there is a class product and i want to 
request.session['CURRENT_PRODUCT'] = myproduct

As far as i know, this should be allowed. Isn't it?

Greets,
Dan
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---