Django admin pagination zero based?

2017-11-28 Thread Daniel Jewett
I just noticed that the URL get string in my admin app is off by one from 
the auto generated pagination links. It appears that the pagination URLs 
are zero based.

For example if I'm on page 4 of results according to the pagination links, 
the URL looks like '?p=3'

Is this typical? Any suggestions on how to get them matched up?

Thanks!

-Dan J.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/a4d14e7f-20d0-49c7-a42d-5535e697c33b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Django admin filters and tagging

2010-11-17 Thread Daniel Jewett
Hello,
I have a model that looks like this:

class Item(models.Model):
...other fields...
tags = TagField()

I have not defined any additional methods for tagging on the model.

In admin.py:

class ItemAdmin(admin.ModelAdmin):
list_filter = ('featured', 'available', 'tags',)

In admin, the tagging app is working as it should, updates and
additions work properly. However the list of tags that shows up in the
right side tag filters list does not appear to update properly or is
displaying tags erroneously.
For example, an item tagged 'bagues crystal sconces appliques' (no
quotes) appears in the tagging app list as four different tags as it
should. In the filter list for 'items,' all four tags show up as one
link and do not show as individual tags.

Is there something else I need to do?

Thanks,
Dan J.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Alternate authentication

2009-06-18 Thread Daniel Jewett

Thanks Ben, I'll see if I can figure out how to put the class
together.

On Jun 17, 5:20 pm, Ben Davis  wrote:
> I believe what you are looking for is a custom authentication backend.  I
> had to do this for one of my sites that used an XMLRPC api to authenticate
> against a remote server.  You'll want to create a class that extends
> django.contrib.auth.backends.ModelBackend ,  and add it to the
> AUTHENTICATION_BACKENDS setting.
>
> One thing to be wary of though -- if your authentication code at any point
> throws a TypeError,  you might have a hard time debugging it -- see this bug
> for more info:http://code.djangoproject.com/ticket/10378
>
>
>
> On Tue, Jun 16, 2009 at 4:20 PM, Daniel Jewett  wrote:
>
> > I have a circumstance that requires me to use an alternative
> > authentication scenario. The authentication to our school's web site/
> > services is handled by the the hosting service. (There is some sort of
> > syncing that occurs with our local Active Directory database.)
>
> > I'm installing some Django apps on the school's local webserver which
> > needs to authenticate against the remote database.
>
> > The hosting service sent me this decrypt function in ASP.
>
> > Function DeCrypt(strEncrypted, strKey)
> >   Dim strChar, iKeyChar, iStringChar
> >   For i = 1 To Len(strEncrypted)
> >      iKeyChar = (Asc(Mid(strKey, i, 1)))
> >      iStringChar = Asc(Mid(strEncrypted, i, 1))
> >      iDeCryptChar = iKeyChar Xor iStringChar
> >      strDecrypted = strDecrypted & Chr(iDeCryptChar)
> >   Next
> >   DeCrypt = strDecrypted
> > End Function
>
> > UserName = Decrypt(request.Cookies("sample")("u"), "Encrypt Key")
>
> > I'm assuming this Xor decrypt function can be rewritten in Python but
> > I could use some help getting started on how to put this all together.
--~--~-~--~~~---~--~~
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 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Alternate authentication

2009-06-16 Thread Daniel Jewett

I have a circumstance that requires me to use an alternative
authentication scenario. The authentication to our school's web site/
services is handled by the the hosting service. (There is some sort of
syncing that occurs with our local Active Directory database.)

I'm installing some Django apps on the school's local webserver which
needs to authenticate against the remote database.

The hosting service sent me this decrypt function in ASP.

Function DeCrypt(strEncrypted, strKey)
   Dim strChar, iKeyChar, iStringChar
   For i = 1 To Len(strEncrypted)
  iKeyChar = (Asc(Mid(strKey, i, 1)))
  iStringChar = Asc(Mid(strEncrypted, i, 1))
  iDeCryptChar = iKeyChar Xor iStringChar
  strDecrypted = strDecrypted & Chr(iDeCryptChar)
   Next
   DeCrypt = strDecrypted
End Function

UserName = Decrypt(request.Cookies("sample")("u"), "Encrypt Key")

I'm assuming this Xor decrypt function can be rewritten in Python but
I could use some help getting started on how to put this all together.

--~--~-~--~~~---~--~~
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 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Looser date entry in admin...

2006-12-15 Thread Daniel Jewett


On Dec 15, 2006, at 12:17 PM, Adrian Holovaty wrote:

> I'd suggest using a CharField instead. The downside to this is that
> you can't take advantage of date-specific queries, such as retrieving
> all the records where the date is in a certain month, but whether
> that's a problem depends on your application.

Thanks Adrian,
I guess if Postgres were to accept an out of range date like  
1972-00-00 it would sort of defeat the date manipulation mechanism. :-)

I think what I'll do in my case, since I'd eventually like to use the  
date info for building timelines, is to consider a null day value the  
first of the month. That way I can be accurate to the month. If I  
don't know the month, I don't know the date. That should work for  
most of the recordings I'm dealing with.

To be moral about it, I guess I could also put a column in the db to  
flag the approximation.

Thanks again for your hard work. I'm an 'upgrader' from Cakephp and I  
couldn't be more impressed. I'm also a Jayhawk! Lived in Lawrence for  
20+ years, now in New York.

Regards
Dan J.

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



MTM intermediate table data in admin interface...

2006-12-13 Thread Daniel Jewett

Hello all,

I have this setup (stripped):

class Album(models.Model):
title = models.CharField(maxlength=255)
...
class Person(models.Model):
first_name = models.CharField(maxlength=50, blank=True)
last_name = models.CharField(maxlength=100)
...

class Performance(models.Model):
album = models.ForeignKey(Album)
person = models.ForeignKey(Person)
role = models.CharField(maxlength=25)

def __str__(self):
return "%s %s" % (self.person, self.role)

A performance is the appearance of a person on an album. A role would  
be something like Leader, Drums, Vocals, Producer, etc.

It would be helpful to display the name of the person with the role  
of leader in the admin list of Albums.
ie. list_display = ('id', 'title', 'person_with_role_of_leader',  
created', 'modified')

Would someone be willing to get me started on how to accomplish this?

Thanks,
Dan J.

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