MR Branch diff than MR trunk?

2006-04-30 Thread Sandro

Is the currently available magic removal branch going to be any
different than the magic removal trunk that is soon going to be merged?

If I start coding MR branch will an update to MR trunk be trivial if
needed at all?

Thanks for reading.


--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: How can users only edit their own files?

2006-04-30 Thread James Bennett

On 4/30/06, layik <[EMAIL PROTECTED]> wrote:
> How am I going to avoid this? I sign out from Django but I still can
> see this:

As Max said, your browser is probably caching that page; try clearing
the cache (especially if you're using Opera, which has all kinds of
problems with caching).

Or, to put your mind at ease, try saving a change after you've logged
out; Django should redirect you to a login page.

--
"May the forces of evil become confused on the way to your house."
  -- George Carlin

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: How can users only edit their own files?

2006-04-30 Thread Max Battcher

layik wrote:
> I am scared now Luke
> 
> How am I going to avoid this? I sign out from Django but I still can
> see this:
> http://localhost:8000/admin/auth/users/4/

It was probably just a cached version of the page provided by your 
browser.  Did you: Shift/Ctrl-Refresh (depends on browser/OS) the page?

-- 
--Max Battcher--
http://www.worldmaker.net/
"I'm gonna win, trust in me / I have come to save this world / and in 
the end I'll get the grrrl!" --Machinae Supremacy, Hero (Promo Track)

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: [M-R] lookup like Article.objects.filter(id__in = []) will fail

2006-04-30 Thread Adrian Holovaty

On 4/30/06, Cheng Zhang <[EMAIL PROTECTED]> wrote:
> I tried lookup like Article.objects.filter(id__in = []), which will
> have SQL statement whose where clause is something like 'WHERE
> ("poll_article"."id" IN ())'. Such SQL statement is ok with SQLite
> but invalid for PostgreSQL.
>
> I work around this problem with code like:
> if len(id_list) > 0:
>Article.objects.filter(id__in = id_list)
> else:
>Article.objects.filter(id__isnull = True)
>
> Should this problem be deal with on the Django framework level,
> instead of application level?

I think this should be handled at the application level, because "id
IN ()" could mean different things to different people. When I first
saw your e-mail, I interpreted "id IN ()" as the empty set, but, now
that I think about it, I could argue "id IN ()" is utterly
meaningless, because a lookup of an ID in an empty list would still
return all records.

In short, it's up to the developer to be more explicit about what he/she wants.

Adrian

--
Adrian Holovaty
holovaty.com | djangoproject.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
-~--~~~~--~~--~--~---



Re: MR and users magic

2006-04-30 Thread akaihola

See http://code.djangoproject.com/ticket/61 for discussion and
http://code.djangoproject.com/wiki/CookBookPasswordGreasemonkeyUserScript
for a client-side solution while waiting for Django to be fixed.


--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: superuser permission by non-superuser!

2006-04-30 Thread layik

Thanks Adrian,

this helps me document my work better as well.


--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: [M-R] lookup like Article.objects.filter(id__in = []) will fail

2006-04-30 Thread Cheng Zhang


On Apr 30, 2006, at 1:31 PM, Ivan Sagalaev wrote:

>
> Cheng Zhang wrote:
>
>> I tried lookup like Article.objects.filter(id__in = []), which will
>> have SQL statement whose where clause is something like 'WHERE
>> ("poll_article"."id" IN ())'. Such SQL statement is ok with SQLite
>> but invalid for PostgreSQL.
>>
>> I work around this problem with code like:
>> if len(id_list) > 0:
>>   Article.objects.filter(id__in = id_list)
>> else:
>>   Article.objects.filter(id__isnull = True)
>>
>> Should this problem be deal with on the Django framework level,
>> instead of application level?
>>
>>
> It shouldn't. Because in defferent situations people need different
> things when the list in the condition is empty. Empty list can mean
> "don't filter, get everything" or "equals to nothing so get empty  
> list".
> And with your workaround user can get some arbitrary set of records
> where the field value happens to be NULL.
>
> So this really should be handled manually.

To elaborate on the question, it should be asked as:
In terms of Django's db-api, what will be in the QuerySet of filter 
(id__in=[])?

I still think it should mean an empty QuerySet. If one want to  
express the meaning of an everything QuerySet, one should use all()  
instead of filter().

- Cheng


--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: superuser permission by non-superuser!

2006-04-30 Thread Adrian Holovaty

On 4/30/06, layik <[EMAIL PROTECTED]> wrote:
> Am I missing something or Django 0.91 that I have has got a little bug
> in the persmissions?!
>
> I have some users, one of them is a service admin but I have given
> permissions to him to be able to add, change and delete users from
> Django's standard user model.
>
> when I sign in using that service admin account, I can make myself a
> super-user and in deed sign up as my as I want as super-users!!

If a user has permission to edit users, that user can change
him/herself to be a superuser. I wouldn't consider this a bug, but
perhaps we should document it more clearly.

Adrian

--
Adrian Holovaty
holovaty.com | djangoproject.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
-~--~~~~--~~--~--~---



Re: How can users only edit their own files?

2006-04-30 Thread layik

I am scared now Luke

How am I going to avoid this? I sign out from Django but I still can
see this:
http://localhost:8000/admin/auth/users/4/

That is going to KILL my project!

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
-~--~~~~--~~--~--~---



superuser permission by non-superuser!

2006-04-30 Thread layik

Am I missing something or Django 0.91 that I have has got a little bug
in the persmissions?!

I have some users, one of them is a service admin but I have given
permissions to him to be able to add, change and delete users from
Django's standard user model.

when I sign in using that service admin account, I can make myself a
super-user and in deed sign up as my as I want as super-users!!

anyone agrees?


--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: Django-based wiki engine

2006-04-30 Thread Daniel Poelzleithner

iGL wrote:

> Hi,
> Has anybody been working on a django-based wiki engine on the lines of
> django.contrib?
> I'd much appreciate hints on such projects...

I'm working on a django wiki, whoever it will need some weeks for a more
or less useable state.

It's part of a django suite for public mash networks:
http://ff-firmware.quamquam.org/trac/browser/ffsomething/trunk

kindly regards
  daniel

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: simon's AbstractSearching still working with m-r branch?

2006-04-30 Thread FX

it shell work with this patch attached:
Patch:

Index: stuff/branches/magic-removal/json.py
===
--- stuff/branches/magic-removal/json.py(revision 1002)
+++ stuff/branches/magic-removal/json.py(working copy)
@@ -2,7 +2,7 @@
 import types
 import re

-from django.conf.settings import DEFAULT_CHARSET
+from django.conf import settings

 ##json.py implements a JSON (http://json.org) reader and writer.
 ##Copyright (C) 2005  Patrick D. Logan
@@ -301,7 +301,7 @@
 obj = obj.replace('\r', r'\r')
 obj = obj.replace('\t', r'\t')
 if ty is types.StringType:
-obj = obj.decode(DEFAULT_CHARSET)
+obj = obj.decode(settings.DEFAULT_CHARSET)
 obj = str(ustring_quote(obj))
 self._append(obj)
 self._append('"')
Index: stuff/branches/magic-removal/search/utils.py
===
--- stuff/branches/magic-removal/search/utils.py(revision 1002)
+++ stuff/branches/magic-removal/search/utils.py(working copy)
@@ -3,12 +3,13 @@
 deconstructing search queries and mapping them to models.
 """
 try:
-from django.conf.settings import SEARCH_DEFINITIONS
+from django.conf import settings
 except ImportError:
 SEARCH_DEFINITIONS = ()

-from django.models import get_module
-from django.core.meta import Q
+#from django.models import get_module
+from django.db.models.loading import get_model
+from django.db.models import Q

 from helpers import SearchDefinitionMeta, SearchDefinition

@@ -30,7 +31,7 @@
 def __init__(self, search_definition):
 self.search_definition = search_definition
 (app_label, module_name) =
search_definition.model_module.split('.')
-self.model_module = get_module(app_label, module_name)
+self.model_module = get_model(app_label, module_name)
 self.search_fields = search_definition.search_fields
 self.lookup_filters = {}
 self.result_filters = {}
@@ -117,7 +118,7 @@

 if not objectids: return []

-res = self.model_module.get_in_bulk(objectids.keys(),
select_related=True).values()
+res =
self.model_module.objects.select_related().in_bulk(objectids.keys()).values()
 f = self.search_definition.time_order_by
 res.sort(lambda a,b: -1*cmp(getattr(a, f),getattr(b, f)))

@@ -141,7 +142,7 @@
 """

 if module_list is None:
-module_list = SEARCH_DEFINITIONS
+module_list = settings.SEARCH_DEFINITIONS

 classes = []
Index: stuff/branches/magic-removal/utils.py
===
--- stuff/branches/magic-removal/utils.py   (revision 1002)
+++ stuff/branches/magic-removal/utils.py   (working copy)
@@ -2,7 +2,7 @@
 Simple and handy utility functions.
 """

-from django.models.core import sites
+from django.contrib.sites.models import Site
 from django.core.template.defaultfilters import slugify

 from stuff.latin1 import latin1_to_ascii
@@ -53,6 +53,6 @@
 global current_site
 if current_site is not None:
 return current_site
-current_site = sites.get_current()
+current_site = Site.objects.get_current()
 return current_site


--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---