> 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?
>
from django.contrib.auth.models import Group
group = Group.objects.
> 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?
>
from django.contrib.auth.models import Group
group = Group.objects.
Thanks Jonas, the statements you had provided would give me a list of users
who belong that group, but how can I retrieve the photos of those users?
Actually I was looking for a single statement which would join all these
tables and returns the data based on the Group ID.
Thanks and Regards,
Swaro
*You can add a Foreign Key in the model to django.contrib.auth.models.User,
and then in the views or wherever you can filter based on the request.user
object.*
*something like -> SampleModel.objects.filter(user = request.user)
*
On Sat, Jan 7, 2012 at 9:46 PM, mirco fini wrote:
> hi!
>
> I would
> Thanks Jonas, the statements you had provided would give me a list of users
> who belong that group, but how can I retrieve the photos of those users?
> Actually I was looking for a single statement which would join all these
> tables and returns the data based on the Group ID.
I would reco
Swaroop I think this is what you're asking for:
photos = Photos.objects.filter(user__groups__name='admin')
--
Anler
Sent with Sparrow (http://www.sparrowmailapp.com/?sig)
On Sunday, January 8, 2012 at 11:42 AM, Jonas Geiregat wrote:
>
>
> > Thanks Jonas, the statements you had provided wo
Oh sorry, it should be this:
photos = Photos.objects.filter(user__groups__id=the_group_id)
--
Anler
Sent with Sparrow (http://www.sparrowmailapp.com/?sig)
On Sunday, January 8, 2012 at 12:04 PM, Anler wrote:
> Swaroop I think this is what you're asking for:
>
> photos = Photos.objects.fil
Hi,
I did not read the details of your question, but I can tell you that Django
will be timezone aware in 1.4.
https://docs.djangoproject.com/en/dev/releases/1.4-alpha-1/#support-for-time-zones
cheers
Ivo
On Jan 8, 2012, at 0:40 , Matěj Cepl wrote:
> I have in my first Django app this model (
Hi,
does anyone know of a Django app that handles the bookings and renting of a
house that can be rented.
I imagine something like this:
- forms for booking
- in the admin:
- status management of the booking inquiries
- sending out payment confirmations
- maintaining a c
Thanks a lot Anler, that's exactly what I want. I never knew that it was so
simple.
Thanks and Regards,
Swaroop Shankar V
On Sun, Jan 8, 2012 at 4:36 PM, Anler wrote:
> Oh sorry, it should be this:
>
> photos = Photos.objects.filter(user__groups__id=the_group_id)
>
> --
> Anler
> Sent with S
*Please check If your media files are served properly, Check either 404
messages in the console, or take View Source option in browser and click on
the media links directly which should bring the js or css or whatever
otherwise it is not serving media files I guess.*
*
*
On Sat, Jan 7, 2012 at 6:5
On Sun, Jan 8, 2012 at 9:49 AM, Chen Xu wrote:
>
> Since Django has its own database schema, can we still use sqlalchemy
> instead?
>
Just to correct the nomeclature : Django has an ORM, and *NOT* a database
schema. An application has its own schema.
And to answer the 'modified' Q : django's orm
On Jan 8, 8:43 am, Venkatraman S wrote:
> On Sun, Jan 8, 2012 at 9:49 AM, Chen Xu wrote:
>
> > Since Django has its own database schema, can we still use sqlalchemy
> > instead?
>
> Just to correct the nomeclature : Django has an ORM, and *NOT* a database
> schema. An application has its own sc
Hi, we have current project, DB is oracle, and model is in elixir. we
want to add a web interface to the current model. it seems that
using the Django build-in ORM is a break of the DRY principle,
using Django with elixir seems complicated (we could not found any
example) and loosing django abilit
I want to log in to my Django app using something like curl. I know
that I could send a GET to get the login form and the CSRF token and
then submit a POST with the username, password and CSRF token. But
this seems awfully convoluted. Is this the only to login to a Django
site that uses CSRF protec
Actually the guy in that blog post forgets to mention quite a lot of
stuff. By giving-up Django ORM, not only you loose all the management
commands based on Django-orm (loaddata, dumpdata, syncdb, ...), but
also you loose admin, you loose auth, you loose the generic views, you
loose the model forms
On Sun, Jan 8, 2012 at 9:35 AM, Stodge wrote:
> I want to log in to my Django app using something like curl. I know
> that I could send a GET to get the login form and the CSRF token and
> then submit a POST with the username, password and CSRF token. But
> this seems awfully convoluted. Is this t
Dear ALL,
i have a form in a page so i added this to views.py :
from django.template import RequestContext
from django.shortcuts import render_to_response, get_object_or_404
from globalc.models import newsletter
from django import forms
class newform(forms.Form):
email = forms.CharField(ma
Hello Stodge,
It seems a bit convoluted on the command line but in reallity not much more
convoluted if you consider all that a browser does for us in this regard.
:-)
I've used a similar technique to the one you describe on my Crowdsourcing
Nutrition Facts website. Here is an extract from th
This link is giving me a Page Not Found.
On Jan 7, 1:10 pm, Michael Elkins wrote:
> 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 q
https://docs.djangoproject.com/en/1.3/topics/auth/#authentication-in-web-requests
On Sun, Jan 8, 2012 at 12:20 PM, Stodge wrote:
> This link is giving me a Page Not Found.
>
> On Jan 7, 1:10 pm, Michael Elkins wrote:
> > On Sat, Jan 07, 2012 at 11:52:26AM -0500, Kevin Anthony wrote:
> > >I have
Thanks, appreciate it.
On Jan 8, 12:16 pm, creecode wrote:
> Hello Stodge,
>
> It seems a bit convoluted on the command line but in reallity not much more
> convoluted if you consider all that a browser does for us in this regard.
> :-)
>
> I've used a similar technique to the one you describe
Hello,
I have recently migrated my Django application from a development server to
a production server. Everything works pretty well with the exception of a
PDF generating view that uses Python-PYx. The PyX package uses Tex/LaTex,
and when I try to generate a PDF, I get the following error:
IO
using the terminal window execute the following command for each and
every version of python that you might want to use.
cd into the folder that contains the setup.py file in django and run
the following command >>/usr/local/bin/pythonw setup.py install
and all of the components will be moved i
On Sat, Jan 7, 2012 at 16:10, Alec Taylor wrote:
> What you are talking about is a form.
>
> Form: https://docs.djangoproject.com/en/dev/topics/forms/
> Autocomplete: https://code.djangoproject.com/wiki/AutoCompleteSolutions
> Unique fields: https://docs.djangoproject.com/en/1.3/ref/forms/validati
On Jan 7, 7:13 pm, "larry.mart...@gmail.com"
wrote:
> 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 th
I'm having a problem with authentication from libcurl in C. This works
fine from my android/iPhone apps, and from the browser, but libcurl can't
authenticate.
here's how i'm doing it
in django:
authentication function:
user = authenticate(username=username, password=password)
request.session['memb
Hi, everyone:
Could someone who has experience on both Django and Bottle please tell me
what are the some differences between those two?
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
I think its because the actual folder is named django-trunk but your
application's import statement is using django to referrence it. The
symbolic link resolved the issue for you.
Martin.
On 1/9/12, larry.mart...@gmail.com wrote:
> On Jan 7, 7:13 pm, "larry.mart...@gmail.com"
> wrote:
>> On Jan
hi,
I have a project where I'm using Bootstrap
(www.github.com/twitter/bootstrap) with Django.
I need to add a CSS class ("active") to highlight the active navigation
link.
Anyhow, I did some Googling:
http://www.turnkeylinux.org/blog/django-navbar
http://ilostmynotes.blogspot.com/2010/03/dja
30 matches
Mail list logo