Joining Tables

2012-01-07 Thread Swaroop Shankar V
Hi,
I got a models which is as follows:

class Photos(models.Model):
"""
This model will enable the users to upload photos
"""
user = models.ForeignKey(User)
title = models.CharField(_('Title'), max_length=250, null = True, blank
= True)
description = models.TextField(_('Description'), null = True, blank =
True)
image = models.ImageField(_('Image'), upload_to=get_image_path)
created_on = models.DateTimeField(auto_now_add = True)
updated_on = models.DateTimeField(auto_now = True)

The user field is a foreign key to django auth User model. Each user is
assigned to a group (django Auth Group model). I want to retrieve all the
photos which belongs to users of a specific group. How can it be done?

Thanks and Regards,

Swaroop Shankar V

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



Socialregistration help

2012-01-07 Thread coded kid
 I'm trying to make socialregistration package work. But
  I'm getting ImportError: socialregistration/template/facebook_tags.
 Can't import _https. Please help me out.

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



Since Django has its own database schema, can we still use sqlalchemy instead?

2012-01-07 Thread Chen Xu
Hi, everyone:

Since Django has its own database schema, can we still use sqlalchemy
instead?


Thanks very much
Best regards




-- 
⚡ Chen Xu ⚡

-- 
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: Problem getting django on mac (10.5/Leopard) working

2012-01-07 Thread larry.mart...@gmail.com
On Jan 7, 7:03 pm, David Markey  wrote:
> Is there a reason you didnt do easy_install django?

Cause I didn't know about it. I just followed the directions I found
at:

https://docs.djangoproject.com/en/dev/topics/install/

Is there some reason that wouldn't work?


>
> On 8 January 2012 01:50, larry.mart...@gmail.com 
> wrote:
>
>
>
>
>
>
>
> > I am trying to get django working on my mac. I downloaded it from SVN
> > to /usr/local/django-trunk and it's there:
>
> > $ ls /usr/local/django-trunk/
> > __init__.py     core            http            templatetags bin
> >      db              middleware      test
> > conf                    dispatch        shortcuts       utils
> >   contrib     forms
> > template                views
>
> > I updated my site-packages with a django.pth file:
>
> > $ cat /Library/Python/2.5/site-packages/django.pth
> > /usr/local/django-trunk
>
> > python does have this dir in its path:
>
> > $ python -c "import sys; print sys.path"
> > ['', '/Library/Python/2.5/site-packages/cx_Oracle-5.0.2-py2.5-
> > macosx-10.5-i386.egg', '/System/Library/Frameworks/Python.framework/
> > Versions/2.5/lib/python25.zip', '/System/Library/Frameworks/
> > Python.framework/Versions/2.5/lib/python2.5', '/System/Library/
> > Frameworks/Python.framework/Versions/2.5/lib/python2.5/plat-darwin', '/
> > System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/
> > plat-mac', '/System/Library/Frameworks/Python.framework/Versions/2.5/
> > lib/python2.5/plat-mac/lib-scriptpackages', '/System/Library/
> > Frameworks/Python.framework/Versions/2.5/Extras/lib/python', '/System/
> > Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/lib-
> > tk', '/System/Library/Frameworks/Python.framework/Versions/2.5/lib/
> > python2.5/lib-dynload', '/Library/Python/2.5/site-packages', '/usr/
> > local/django-trunk', '/System/Library/Frameworks/Python.framework/
> > Versions/2.5/Extras/lib/python/PyObjC']
>
> > But I still can't import it:
>
> > $ python
> > Python 2.5.1 (r251:54863, May  5 2011, 18:37:34)
> > [GCC 4.0.1 (Apple Inc. build 5465)] on darwin
> > Type "help", "copyright", "credits" or "license" for more information.
> > >>> import django
> > Traceback (most recent call last):
> >  File "", line 1, in 
> > ImportError: No module named django
>
> > What am I missing or doing wrong?
>
> > TIA!
> > -larry
>
> > --
> > 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.

-- 
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: Problem getting django on mac (10.5/Leopard) working

2012-01-07 Thread David Markey
Is there a reason you didnt do easy_install django?

On 8 January 2012 01:50, larry.mart...@gmail.com wrote:

> I am trying to get django working on my mac. I downloaded it from SVN
> to /usr/local/django-trunk and it's there:
>
> $ ls /usr/local/django-trunk/
> __init__.py corehttptemplatetags bin
>  db  middleware  test
> confdispatchshortcuts   utils
>   contrib forms
> templateviews
>
> I updated my site-packages with a django.pth file:
>
> $ cat /Library/Python/2.5/site-packages/django.pth
> /usr/local/django-trunk
>
> python does have this dir in its path:
>
> $ python -c "import sys; print sys.path"
> ['', '/Library/Python/2.5/site-packages/cx_Oracle-5.0.2-py2.5-
> macosx-10.5-i386.egg', '/System/Library/Frameworks/Python.framework/
> Versions/2.5/lib/python25.zip', '/System/Library/Frameworks/
> Python.framework/Versions/2.5/lib/python2.5', '/System/Library/
> Frameworks/Python.framework/Versions/2.5/lib/python2.5/plat-darwin', '/
> System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/
> plat-mac', '/System/Library/Frameworks/Python.framework/Versions/2.5/
> lib/python2.5/plat-mac/lib-scriptpackages', '/System/Library/
> Frameworks/Python.framework/Versions/2.5/Extras/lib/python', '/System/
> Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/lib-
> tk', '/System/Library/Frameworks/Python.framework/Versions/2.5/lib/
> python2.5/lib-dynload', '/Library/Python/2.5/site-packages', '/usr/
> local/django-trunk', '/System/Library/Frameworks/Python.framework/
> Versions/2.5/Extras/lib/python/PyObjC']
>
> But I still can't import it:
>
> $ python
> Python 2.5.1 (r251:54863, May  5 2011, 18:37:34)
> [GCC 4.0.1 (Apple Inc. build 5465)] on darwin
> Type "help", "copyright", "credits" or "license" for more information.
> >>> import django
> Traceback (most recent call last):
>  File "", line 1, in 
> ImportError: No module named django
>
>
> What am I missing or doing wrong?
>
> TIA!
> -larry
>
> --
> 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.
>
>

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



Problem getting django on mac (10.5/Leopard) working

2012-01-07 Thread larry.mart...@gmail.com
I am trying to get django working on my mac. I downloaded it from SVN
to /usr/local/django-trunk and it's there:

$ ls /usr/local/django-trunk/
__init__.py corehttptemplatetags bin
db  middleware  test
confdispatchshortcuts   utils   
contrib forms
templateviews

I updated my site-packages with a django.pth file:

$ cat /Library/Python/2.5/site-packages/django.pth
/usr/local/django-trunk

python does have this dir in its path:

$ python -c "import sys; print sys.path"
['', '/Library/Python/2.5/site-packages/cx_Oracle-5.0.2-py2.5-
macosx-10.5-i386.egg', '/System/Library/Frameworks/Python.framework/
Versions/2.5/lib/python25.zip', '/System/Library/Frameworks/
Python.framework/Versions/2.5/lib/python2.5', '/System/Library/
Frameworks/Python.framework/Versions/2.5/lib/python2.5/plat-darwin', '/
System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/
plat-mac', '/System/Library/Frameworks/Python.framework/Versions/2.5/
lib/python2.5/plat-mac/lib-scriptpackages', '/System/Library/
Frameworks/Python.framework/Versions/2.5/Extras/lib/python', '/System/
Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/lib-
tk', '/System/Library/Frameworks/Python.framework/Versions/2.5/lib/
python2.5/lib-dynload', '/Library/Python/2.5/site-packages', '/usr/
local/django-trunk', '/System/Library/Frameworks/Python.framework/
Versions/2.5/Extras/lib/python/PyObjC']

But I still can't import it:

$ python
Python 2.5.1 (r251:54863, May  5 2011, 18:37:34)
[GCC 4.0.1 (Apple Inc. build 5465)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import django
Traceback (most recent call last):
  File "", line 1, in 
ImportError: No module named django


What am I missing or doing wrong?

TIA!
-larry

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



Jade Templating Engine

2012-01-07 Thread bluesolver
Has anyone tried using the Jade templating engine with Django?

They have written a library called PyJade on Github, and they seem to
have worked in some Django integration.  I was just curious if anyone
had taken the plunge and actually used it.


Cheer,

Brad

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



Is models.DateTime timezone aware ?

2012-01-07 Thread Matěj Cepl

I have in my first Django app this model (selection):

class Post(models.Model):
# ...
updated = models.DateTimeField(default=datetime.datetime.now())
published = models.DateTimeField(blank=True)

When looking at the database dump of the generated database I see that 
the date is saved as timezone aware:


'2008-07-10 10:00:00+02:00','2008-07-10 10:00:00+02:00'

However, when in the test I try

self.assertEqual(test_entry.updated,
dateutil.parser.parse(u"2008-07-10T10:00:00+02:00"))

test fails, and I can use only

self.assertEqual(test_entry.updated,
dateutil.parser.parse(u"2008-07-10T10:00:00"))

What am I missing? Any thoughts, please?

Thank you,

Matěj

--
http://www.ceplovi.cz/matej/, Jabber: mceplceplovi.cz
GPG Finger: 89EF 4BC6 288A BF43 1BAB  25C3 E09F EF25 D964 84AC

Of all tyrannies, a tyranny exercised for the good of its
victims may be the most oppressive. It may be better to live
under robber barons than under omnipotent moral busybodies. The
robber baron's cruelty may sometimes sleep, his cupidity may at
some point be satiated; but those who torment us for our own
good will torment us without end, for they do so with the
approval of their consciences.
-- C. S. Lewis

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



csrf middleware uses only request.POST query dict during csrf check, and not request.raw_post_data

2012-01-07 Thread Bhaskar
I have two django apps in my django website:

app1:
set of views (REST apis):
 - sends empty response with csrf cookie set for GET requests
 - accept JSON string as input for POST requests and do some business
operations

app2:
set of views (django UI client which consumes apis from app1):
 - accept data from django forms/ajax posts in JSON format
 - performs some operations with the data
 - invokes the REST apis from app1 and sends the JSON data (using
urllib2 package)

In this scenario, I wish to use the built-in django csrf protection
I encountered '403 FORBIDDEN' http errors and finally tried the
following code which theoretically should work as per my knowledge:

Sample view of my app2:
def addSomething(request):
if request.method == 'POST':
userData = json.loads(request.raw_post_data)
# I make sure csrf cookie and csrfmiddlewaretoken are set in
my request:
#   - I first make a 'GET' request, get the csrf token
#   - Set the csrf cookie, and update csrfmiddlewaretoken
in my POST data
#   - convert my POST data to JSON , use urllib2 to invoke
the POST request
cookieHandler = urllib2.HTTPCookieProcessor()
opener = urllib2.build_opener(urllib2.HTTPHandler(),
cookieHandler)
urllib2.install_opener(opener)
url = 'http://www.mysite.com/add/'
urllib2.urlopen(url)
csrf_cookie = None
for cookie in cookieHandler.cookiejar:
if cookie.name == 'csrftoken':
csrf_cookie = cookie
break
if csrf_cookie:
userData['csrfmiddlewaretoken']=csrf_cookie.value
req = urllib2.Request(url, json.dumps(userData))
response = urllib2.urlopen(req)
return HttpResponse(response)

Now, as per django csrf middleware, I am sending the same, valid csrf
token in both cookie and in POST data
But still the above code will give me '403 forbidden'
after browsing csrf.py code, I could see that, while processing the
view, the csrf token is taken from request.POST only during the csrf
check

But my POST data is a json string, and not a django POST query dict
The middleware thinks that my csrf cookie and csrfmiddlewaretoken
values are not matching and raises 403 http error

Now my above code will work only if I do csrf_exempt(which is not good
for me)
or
Change my REST api to accept urlencoded parameters instead of JSON
string and make my app2 to invoke api with querydict instead of JSON
string (which is also not good for me)

My question is - can the csrf.py be changed so that it uses either
request.POST query dict or request.raw_post_data during csrf
comparison?

NOTE:
my environment details:
os: windows 7
python 2.7
django 1.3.1
code reference in csrf.py where request.POST is accessed to get the
csrfmiddleware token:
django\middleware\csrf.py
Line no 199: # check incoming token
Line no 200: request_csrf_token =
request.POST.get('csrfmiddlewaretoken', '')

I have modified the csrf.py so that it refers to request.raw_post_data
as well in my environment. it works for me
I am new to REST api implementation and stuff, so please correct me if
I am missing something here
looking forward for help
Thanks

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



Directory layout for a large Django application (not project)

2012-01-07 Thread IgorS
Can someone recommend “the optimal” directory layout INSIDE the
application’s root directory for a large application. The question is
about one application only, not the whole project.

I am looking for a layout where all the code, settings, static stuff
(images, css, js), etc. relating to this particular application stay
inside the application’s root directory. It is probably ok to set a
couple of values in the project's settings.py, but everything else
should be inside the application’ directory. Something completely plug
and play (even in a production environment)…

If something “must” or should go outside of the application’s root
(for speed optimization, etc.), that is great to know too.

If, apart from the recommendations, someone could point at an existing
large well-structured application, that would be awesome.

Below is my current structure. I am new to Django and probably missing
something... Restructuring an application somewhere in the middle of
the development cycle is more expensive than just having the "right"
layout from the start. Especially if this is possible. I consider a
small overhead at the start being better than a great rework in the
middle (yes, i am aware of the minimal viable product concept :-)

app
+--models
---abstract_base.py
---core.py
---...
+--probe
+--static
---css
---js
---images
+--templates
---base.html
---...
+--tests
---test_users.py
---...
+--utils
+--views
---__init__.py
---app_settings.py
---context_processors.py
---middleware.py
---urls.py

Thank you,
-igor

-- 
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: Automatic Client side validation for django forms

2012-01-07 Thread yati sagade
Why not use plain JS to validate at client side. And while dealing with
things like registration names(which may require the db) go for Dajax -
http://www.dajaxproject.com/

On Sat, Jan 7, 2012 at 11:48 PM, Karthik Abinav wrote:

> Hi,
>
>I was wondering if there exists some in-built AJAX validation on the
> form fields at the client side in django libraries. The form contains
> commonly used fields which are mostly alpha-numeric.
>
>
>
> Thanks,
>
> Karthik Abinav,
>
> 2nd year B.Tech
> Dept. of Computer Science and Engineering
> Indian Institute of Technology, Madras
>
>  --
> 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.
>

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



particular permission

2012-01-07 Thread mirco fini
hi!

I would like to create a site where the user can read just database
records written by him or by his group.
Anybody knows how can I obtain that?

thanks a lot

Mirco

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



Automatic Client side validation for django forms

2012-01-07 Thread Karthik Abinav
Hi,

   I was wondering if there exists some in-built AJAX validation on the
form fields at the client side in django libraries. The form contains
commonly used fields which are mostly alpha-numeric.



Thanks,

Karthik Abinav,

2nd year B.Tech
Dept. of Computer Science and Engineering
Indian Institute of Technology, Madras

-- 
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: Correct folder layout for a big Django application

2012-01-07 Thread IgorS
Thank you, yati. Thank you Waldek. Your responses are much
appreciated.

It seems that my question was not clear. This is all my fault. I was
searching for some sort of "the most recommended" or "optimal" folder
layout INSIDE the application folder. In other words, a layout where
all the code, settings, static stuff, etc. relating to this particular
application stay inside the application folder. It is probably ok to
set a couple of values in the project's settings.py, but everything
else should be inside the application folder.

Since the question was not clear, i am going to start a new one and
show my current layout there.

Best wishes,
-igor

-- 
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: Url rewrite for search engines

2012-01-07 Thread francescortiz
For example, in urls.py:

('^entry/?P(.*)/', 'entry'),

and in your models you have an slug field

On Jan 7, 1:13 am, Lie Ryan  wrote:
> On 01/07/2012 11:04 AM, Barış Bilgiç wrote:
>
> > Hi,
>
> > I am looking for how to implement URL rewrite in Django which is
> > explained inhttp://en.wikipedia.org/wiki/Rewrite_engine.
>
> > For example,I would like to convert
>
> > |http://127.0.0.1:8000/employer/details/20/|to|http://127.0.0.1:8000/employername-20.htm|
>
> > How can I implement this in Django? could suggest me a document or give
> > an example ?
>
> you write your url to view mapping in urls.py, note that in django, you
> don't need to do a crude hack like "rewriting url" instead you specify
> that an url is to be specified by certain views.

-- 
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: Authentication over JSON

2012-01-07 Thread Michael Elkins

On Sat, Jan 07, 2012 at 11:52:26AM -0500, Kevin Anthony wrote:

I have a small exposed json API, currently it doesn't require
authentication, but i'd like to integrate it with django's authentication.
A quick google search came up empty, and i was wondering if anyone had
any recommendations on how to do this?


I've done this before using forms and POST, but you could easily 
put the user credentials in your json object and use 
django.contrib.auth as described here:


https://docs.djangoproject.com/en/1.3/topics/Aauth/#authentication-in-web-requests

--
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: input of one select box into another

2012-01-07 Thread Bjorn Meyer
Take a look at the dajaxproject. http://www.dajaxproject.com/ 
That may be what you are looking for.

On January 7, 2012 05:40:24 Weldan wrote:
> I am looking for same answer.
> 
> Currently this is what i was doing:
> 
> 1. load javascript into form page
> 2. for each select box, call ajax to return next select box value
> example:
> 
> 1. form loaded, select box 1 has values
> 2. user choose values from select box 1, get select box 2 values with
> select box 1 chosen value, same on select box 3
> 
> has anyone did the same? or is there an easy/correct way to do this?
> 
> On 7 January 2012 07:02, inzaghi  wrote:
> > I have a form with two select boxes. the input of one will be used to
> > determine what gets loaded in the other.
> > In essence the second select box could have data populated into it
> > from
> > different models.
> > 
> > 1 how would I do this ? and
> > 2.How would I accomplish this without reloading the page ?
> > 
> > --
> > 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.

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



Authentication over JSON

2012-01-07 Thread Kevin Anthony
I have a small exposed json API, currently it doesn't require
authentication, but i'd like to integrate it with django's authentication.
 A quick google search came up empty, and i was wondering if anyone had
any recommendations on how to do this?

-- 
Thanks
Kevin Anthony
www.NoSideRacing.com

Do you use Banshee?
Download the Community Extensions:
http://banshee.fm/download/extensions/

-- 
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: Is the django coummity converging on a preferred REST API package?

2012-01-07 Thread JohnA
Thanks for the comments.  The developer-friendly features of Django
REST framework sound very interesting.  I will definitely check it
out.

On Jan 7, 10:29 am, sbrandt  wrote:
> Thumbs up for Django REST framework. While being younger than tastypie
> and piston, it has some more cool features besides the mentioned
> creation of doc above.
>
> It also creates a HTML debug interface for every resource and follows
> the  class based views and form validation paradigms of django making
> it powerful and esay to learn. It's under active development - the
> other two were not the last time I looked.
>
> On 6 Jan., 22:25, JohnA  wrote:
>
>
>
> > I’ve looked on this group, stackoverflow and the web at large for
> > indication that the django community is converging on a single REST
> > API package that is “preferred” and a potential candidate for
> > inclusion in a future django distribution.  So far all I’ve seen is
> > people saying positive or negative things about various packages or
> > the alternatives of writing yet another package or just winging it
> > with urlconfs and views.
>
> > It doesn’t seem to be a matter of "it depends what you want to
> > do" (though maybe required use or not of HTTP PUT and DELETE methods
> > could be a deciding factor).  I’m not an expert in REST, but the basic
> > requirements seem pretty clear to me – clean urls, multiple output
> > formats (xml, json etc.) and reliable and reasonably nonintrusive
> > authentication procedures – plus of course ease of implementation
> > including achieving wide coverage of base functionality with minimal
> > incremental code.
>
> > I guess what I'm asking is, what if any REST API package is emerging
> > as the leading solution, and if none, why not?   Thanks.- Hide quoted text -
>
> - Show quoted text -

-- 
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: Testing Error Pages

2012-01-07 Thread Karen Tracey
On Wed, Jan 4, 2012 at 11:40 AM, Colin  wrote:

> What's the best way to go about testing them please?
>

https://docs.djangoproject.com/en/1.3/ref/contrib/staticfiles/#django-admin-option---insecure

Karen
-- 
http://tracey.org/kmt/

-- 
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: Is the django coummity converging on a preferred REST API package?

2012-01-07 Thread sbrandt
Thumbs up for Django REST framework. While being younger than tastypie
and piston, it has some more cool features besides the mentioned
creation of doc above.

It also creates a HTML debug interface for every resource and follows
the  class based views and form validation paradigms of django making
it powerful and esay to learn. It's under active development - the
other two were not the last time I looked.

On 6 Jan., 22:25, JohnA  wrote:
> I’ve looked on this group, stackoverflow and the web at large for
> indication that the django community is converging on a single REST
> API package that is “preferred” and a potential candidate for
> inclusion in a future django distribution.  So far all I’ve seen is
> people saying positive or negative things about various packages or
> the alternatives of writing yet another package or just winging it
> with urlconfs and views.
>
> It doesn’t seem to be a matter of "it depends what you want to
> do" (though maybe required use or not of HTTP PUT and DELETE methods
> could be a deciding factor).  I’m not an expert in REST, but the basic
> requirements seem pretty clear to me – clean urls, multiple output
> formats (xml, json etc.) and reliable and reasonably nonintrusive
> authentication procedures – plus of course ease of implementation
> including achieving wide coverage of base functionality with minimal
> incremental code.
>
> I guess what I'm asking is, what if any REST API package is emerging
> as the leading solution, and if none, why not?   Thanks.

-- 
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: Help

2012-01-07 Thread coded kid

Thanks for the reply. I'm testing socialregistration package now. But
I'm getting ImportError: socialregistration/template/facebook_tags.
Can't import _https. Please help me out.

On Jan 7, 12:47 pm, Praveen Krishna R 
wrote:
> *I have not tried any of these social auth apps myself. Yet if you want
> help with any of those packages which you tried, then you can can dump the
> detail error log or whatever here and get some help. It could be some
> version compatibility issues or similiar, for which there may exist some
> fixes.*
> *
> *
>
>
>
>
>
> On Sat, Jan 7, 2012 at 3:22 PM, coded kid  wrote:
> > Hi guys, please I need your help. I've been trying all my best for the
> > past 4days in order to get django-socialauth working but still no
> > success. No django social packages I haven't tried. I've downloaded up
> > to 10 different social packages but none is working. Though out of
> > those 10 some fail to install. I do get AttributeError: No object
> > named 'clone' I using windows 7. I'm fed up with all this!! Can anyone
> > share with me tips or links to a good package that will work fine?
> > Thanks.
>
> > --
> > 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.
>
> --
> Thanks and Regards,
> *Praveen Krishna R*

-- 
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: input of one select box into another

2012-01-07 Thread Weldan
I am looking for same answer.

Currently this is what i was doing:

1. load javascript into form page
2. for each select box, call ajax to return next select box value
example:

1. form loaded, select box 1 has values
2. user choose values from select box 1, get select box 2 values with
select box 1 chosen value, same on select box 3

has anyone did the same? or is there an easy/correct way to do this?


On 7 January 2012 07:02, inzaghi  wrote:

> I have a form with two select boxes. the input of one will be used to
> determine what gets loaded in the other.
> In essence the second select box could have data populated into it
> from
> different models.
>
> 1 how would I do this ? and
> 2.How would I accomplish this without reloading the page ?
>
> --
> 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.
>
>

-- 
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: Is the django coummity converging on a preferred REST API package?

2012-01-07 Thread David Harks
While I can't really comment on the thoughts of the Django team itself 
(for inclusion in Django proper), I will suggest that aside from 
Tastypie the other 'best-of-breed' REST framework is the simply-named 
Django REST Framework: http://django-rest-framework.org/.


As opposed to Tastypie, it has one truly killer feature, IMHO: their 
Resource/ModelResource classes provide an automatically-generated HTML 
documentation for the exposed API. Browse the API's endpoints and it'll 
tell you how to interact with it using JSON or XML.


On 1/6/2012 6:31 PM, Brett Epps wrote:

I used Tastypie for a project recently and was pretty happy with it.  I
think Piston was the preferred package before Tastypie came about, but
Piston hasn't seen as much development recently.  Then again, Piston seems
to be good enough for Bitbucket, so it's probably good enough for many
projects.

Sorry I can't offer much technical advice on this topic, as I'm no expert
on either package.  To answer your question, though: to me, Tastypie
"feels" like the preferred package currently.

Brett


On 1/6/12 3:25 PM, "JohnA"  wrote:


Iąve looked on this group, stackoverflow and the web at large for
indication that the django community is converging on a single REST
API package that is łpreferred˛ and a potential candidate for
inclusion in a future django distribution.  So far all Iąve seen is
people saying positive or negative things about various packages or
the alternatives of writing yet another package or just winging it
with urlconfs and views.

It doesnąt seem to be a matter of "it depends what you want to
do" (though maybe required use or not of HTTP PUT and DELETE methods
could be a deciding factor).  Iąm not an expert in REST, but the basic
requirements seem pretty clear to me ­ clean urls, multiple output
formats (xml, json etc.) and reliable and reasonably nonintrusive
authentication procedures ­ plus of course ease of implementation
including achieving wide coverage of base functionality with minimal
incremental code.

I guess what I'm asking is, what if any REST API package is emerging
as the leading solution, and if none, why not?   Thanks.

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




--
David W. Harks

--
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: Facebook like activity feed commenting using django comments framework

2012-01-07 Thread Swaroop Shankar V
Thanks Anoop for those links, but it is not exactly what I require and also
the overhead of xmpp server is also there. Well all i require is to know is
how i can create an entry in the tables created by the commenting framework
through an API if available.

Thanks and Regards,
Swaroop Shankar V



On Sat, Jan 7, 2012 at 7:38 PM, Anoop Thomas Mathew wrote:

> Hi,
> Try this https://github.com/agiliq/django-pubsub/
> You can get a live demo here http://chat.agiliq.com/pubsub/.
> See if this suits your purpose.
> Thanks,
> Anoop Thomas Mathew
>
> atm
> ___
> Life is short, Live it hard.
>
>
>
>
> On 7 January 2012 19:34, Swaroop Shankar V  wrote:
>
>> hello All,
>> Am trying to build somewhat like an activity stream for my web
>> application. Since its not exactly similar to the normal activity streams
>> found in facebook I am not able to use any of the existing django activity
>> stream projects like django-activity-stream in my application. So I am
>> building it from scratch. I would like to make use of the django commenting
>> system for commenting on each post that show's up on the activity steam.
>> Since i would like to use ajax to post comments, I will require an API,
>> using which I can save the comment posted to the commenting system
>> framework table. I looked through the documentation but could not figure
>> out how i can do it. If someone have any experience in doing the same
>> please let me know the procedures.
>>
>> Thanks and Regards,
>> Swaroop Shankar V
>>
>>  --
>> 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.
>>
>
>  --
> 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.
>

-- 
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: Facebook like activity feed commenting using django comments framework

2012-01-07 Thread Anoop Thomas Mathew
Hi,
Try this https://github.com/agiliq/django-pubsub/
You can get a live demo here http://chat.agiliq.com/pubsub/.
See if this suits your purpose.
Thanks,
Anoop Thomas Mathew

atm
___
Life is short, Live it hard.




On 7 January 2012 19:34, Swaroop Shankar V  wrote:

> hello All,
> Am trying to build somewhat like an activity stream for my web
> application. Since its not exactly similar to the normal activity streams
> found in facebook I am not able to use any of the existing django activity
> stream projects like django-activity-stream in my application. So I am
> building it from scratch. I would like to make use of the django commenting
> system for commenting on each post that show's up on the activity steam.
> Since i would like to use ajax to post comments, I will require an API,
> using which I can save the comment posted to the commenting system
> framework table. I looked through the documentation but could not figure
> out how i can do it. If someone have any experience in doing the same
> please let me know the procedures.
>
> Thanks and Regards,
> Swaroop Shankar V
>
>  --
> 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.
>

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



Facebook like activity feed commenting using django comments framework

2012-01-07 Thread Swaroop Shankar V
hello All,
Am trying to build somewhat like an activity stream for my web application.
Since its not exactly similar to the normal activity streams found in
facebook I am not able to use any of the existing django activity stream
projects like django-activity-stream in my application. So I am building it
from scratch. I would like to make use of the django commenting system for
commenting on each post that show's up on the activity steam. Since i would
like to use ajax to post comments, I will require an API, using which I can
save the comment posted to the commenting system framework table. I looked
through the documentation but could not figure out how i can do it. If
someone have any experience in doing the same please let me know the
procedures.

Thanks and Regards,
Swaroop Shankar V

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



Copying and Writing EXIF information from one file to another

2012-01-07 Thread Swaroop Shankar V
Hi,
Am trying to copy the exif information to the resized image of the same
image using pyexiv2. Searching for a solution i stumbled upon a post in Stack
Overflow.
It looks like the api's used in the function is outdated and is not
available in the latest version. Based on the latest document i created a
function like this

def write_exif(originFile, destinationFile, **kwargs):
exifInformation = get_exif(originFile)
metadata = pyexiv2.ImageMetadata(str(destinationFile))
for key, value in exifInformation.iteritems():
metadata[key] = value

metadata.write()

def get_exif(file):
"""
Retrieves EXIF information from a image
"""
ret = {}
metadata = pyexiv2.ImageMetadata(str(file))
metadata.read()
info = metadata.exif_keys
for key in info:
data = metadata[key]
ret[key] = data.raw_value
return ret

But this ends up in an error


Python argument types in
_ExifTag._setParentImage(_ExifTag, NoneType)
did not match C++ signature:
_setParentImage(exiv2wrapper::ExifTag {lvalue},
exiv2wrapper::Image {lvalue})


I am now clueless on what went wrong. Could someone please help me out?
Thanks

Swaroop Shankar V

-- 
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: Help

2012-01-07 Thread Praveen Krishna R
*I have not tried any of these social auth apps myself. Yet if you want
help with any of those packages which you tried, then you can can dump the
detail error log or whatever here and get some help. It could be some
version compatibility issues or similiar, for which there may exist some
fixes.*
*
*
On Sat, Jan 7, 2012 at 3:22 PM, coded kid  wrote:

> Hi guys, please I need your help. I've been trying all my best for the
> past 4days in order to get django-socialauth working but still no
> success. No django social packages I haven't tried. I've downloaded up
> to 10 different social packages but none is working. Though out of
> those 10 some fail to install. I do get AttributeError: No object
> named 'clone' I using windows 7. I'm fed up with all this!! Can anyone
> share with me tips or links to a good package that will work fine?
> Thanks.
>
> --
> 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.
>
>


-- 
Thanks and Regards,
*Praveen Krishna R*

-- 
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: many-to-many queryset question

2012-01-07 Thread Carsten Fuchs

Hi Peter,

Am 2012-01-07 03:40, schrieb Peter of the Norse:

One possibility is to try two excludes.

bad_authors = Authors.objects.exclude(pk__in=SetOfAuthors)
qs = Entry.objects.exclude(authors__in=bad_authors)

This will return all entries that don't have authors in SetOfAuthors. It might 
even be
easier, if you can skip creating SetOfAuthors in the first place.



That works very well!  :-)
Thank you very much for your help!

Best regards,
Carsten



--
   Cafu - the open-source Game and Graphics Engine
for multiplayer, cross-platform, real-time 3D Action
  Learn more at http://www.cafu.de

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



Help

2012-01-07 Thread coded kid
Hi guys, please I need your help. I've been trying all my best for the
past 4days in order to get django-socialauth working but still no
success. No django social packages I haven't tried. I've downloaded up
to 10 different social packages but none is working. Though out of
those 10 some fail to install. I do get AttributeError: No object
named 'clone' I using windows 7. I'm fed up with all this!! Can anyone
share with me tips or links to a good package that will work fine?
Thanks.

-- 
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: Cheap Django hosting?

2012-01-07 Thread profDjango
Hi

you can check http://freedjangohosting.com


for free and paid django hosting

Thanks

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/ZUlNyH_Ya0IJ.
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.



Django admin date and time picker not working

2012-01-07 Thread Santiago Ingold
I'm following the 4 part tutorial at djangoproject.com.

In the 2nd part of it (https://docs.djangoproject.com/en/1.3/intro/
tutorial02/) im configuring the admin interface, it works fine, except
for the fact that date and time javascript pickers does not appear.

I've been following the tutorial step by step, so I can't imagine what
i'm doing wrong.

Also, the widget does not appear in admin/auth/user/1/ neither

Any ideas? Thanks

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



input of one select box into another

2012-01-07 Thread inzaghi
I have a form with two select boxes. the input of one will be used to
determine what gets loaded in the other.
In essence the second select box could have data populated into it
from
different models.

1 how would I do this ? and
2.How would I accomplish this without reloading the page ?

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