Re: Hidden rows elements also visible on list filters

2011-05-25 Thread rahul jain
Yes I am referring to django admin list filter, one on the side.


class Admin(model.Admin):

list_filter = (column1, column2)


so for instance column1 has 6 values (a, b,b,b,c,e). Then list filter shows
a,b, c,e.

like this

By column1

show all
a
b
c
e

Now if i hide some rows based on the logged in user and reduce the number of
queries to  4 values (a,c).
But instead what i see is this same as with no hidden rows ie.

By column1

show all
a
b
c
e

The expected result which I would like to see is this

By column1

show all
a
c

Please let me know how to solve this problem.

Thanks.

RJ








On Wed, May 4, 2011 at 10:06 PM, Andy McKay  wrote:

> > problem is that few rows i have disabled.
> > But list filter still displays those rows as well.
>
> Are you using the built in django admin, or something else?
> By "disabled" what do you mean, a change in the model or something else?
>
> Until you give us a bit more information, we are unlikely to be able to
> help. But here's a bet:
>
>
> http://docs.djangoproject.com/en/dev/ref/contrib/admin/#django.contrib.admin.ModelAdmin.list_filter
>
> The example for DecadeBornListFilter shows how you can define a custom
> queryset and perhaps this will allow you to filter out disabled rows.
> --
>  Andy McKay
>  a...@clearwind.ca
>  twitter: @andymckay
>
>
> --
> 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: running a django app, help please?

2011-05-25 Thread Amanjeev Sethi
I think the basic tutorial (
https://docs.djangoproject.com/en/dev/intro/tutorial01/) talks about apps:

Projects vs. apps

What's the difference between a project and an app? An app is a Web
application that does something -- e.g., a Weblog system, a database of
public records or a simple poll app. A project is a collection of
configuration and apps for a particular Web site. A project can contain
multiple apps. An app can be in multiple projects.

--AJ


On Thu, May 26, 2011 at 12:15 AM, raj  wrote:

> I'm sort of confused with the django app system.
> I own a free hosting, by alwaysdata.net (just to learn the django
> stuff), and it says that I can make an app using the following line:
> python mysite/manage.py startapp [appname]
>
> When reading the django book (at the djangobook.com), it never talks
> about app's really. What I want to know is what is the point of apps,
> and how do you use them? Thank you.
> -Raj
>
> --
> 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.
>
>


-- 
AJ

-- 
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: django database

2011-05-25 Thread Kenneth Gonsalves
On Thu, 2011-05-26 at 09:44 +0430, bahare hoseini wrote:
> do i have to install mysql to create a database in my website?

yes (or postgresql or sqlite)
-- 
regards
KG
http://lawgon.livejournal.com
Coimbatore LUG rox
http://ilugcbe.techstud.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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



django database

2011-05-25 Thread bahare hoseini
hi,
do i have to install mysql to create a database in my website?
tnx

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



How do I override default behaviour for foreign keys in an inline formset?

2011-05-25 Thread King
I want to do something like this...
http://groups.google.com/group/django-users/browse_thread/thread/db03fa90a14ecc6a
...but unfortunately there was no reply to this particular posting.
I've found other posts on the web of people looking for the same sort
of solution, and have not been able to find any helpful answers, so I
was hoping someone here could clear this up.

For example, let's say I had an app that kept a list of books for each
user like this:

class BookList(models.Model):
user = models.ForeignKey(User)
book = models.ForeignKey(Book)

class Book(models.Model):
author = models.ForeignKey(Author)
name = models.CharField(max_length=300)

class Author(models.Model):
name = models.CharField(max_length=300)

I had thought that to generate a bunch of forms for BookList (so that
the current user could for example, enter in all of the books that
they've read on a single page), I would use an inlineformset like so:

BookListFormSet = inlineformset_factory(User, BookList)
booklist_formset = BookListFormSet(instance=currentUser)

However, the resulting formset I get results in a dropdown menu for
each book field in the forms, but I don't want that. I want two
TextInput widgets in the form such that the user can type out:
   Alice in Wonderland
   Lewis Carroll
and if some other user has already added "Alice in Wonderland" to
their book list, then BookList.book will just point to that book.  BUT
if this is the first user to add "Alice in Wonderland" to their book
list, I want the form to create a brand new row in the Book table (and
a brand new row in Author if there is no "Lewis Carroll" books yet
either).

I'm new to Django, so maybe the solution is obvious to many.  But like
I said, I'm finding lots of people asking this question, but without
any good answers posted.

If someone could please provide a detailed solution I would very much
appreciate it, and I imagine others would as well.

Thanks in advance.  If any part of what I'm asking isn't clear, don't
hesitate to ask me about 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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



running a django app, help please?

2011-05-25 Thread raj
I'm sort of confused with the django app system.
I own a free hosting, by alwaysdata.net (just to learn the django
stuff), and it says that I can make an app using the following line:
python mysite/manage.py startapp [appname]

When reading the django book (at the djangobook.com), it never talks
about app's really. What I want to know is what is the point of apps,
and how do you use them? Thank you.
-Raj

-- 
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 there an HTML editor that's Django-aware

2011-05-25 Thread AJ
Thanks a lot Simon. This is probably OT:

That was helpful but I thought I could dive in again with Vim and failed (at
least for now).

You see, I am now used to some of the things in textmate:

* quick file switching. Textmate has Cmd+T and type the file name for quick
switching
* a project. I found the project plugin but still could not figure out the
usage.

I am playing with NERDTree right now. I think there should be a plugin for
quick file switching. I do need to know some more shortcuts for NERDTree to
quickly open files and bookmark them.

I just installed the project-plugin too
http://www.vim.org/scripts/script.php?script_id=69
but again, still have to deal with the learning curve.

Having complained enough, I still think that if I do not give up this time,
I will be better off with this editor as my primary.

Best,
AJ


On Tue, May 24, 2011 at 4:02 PM, Simon Connah wrote:

>
> On 24 May 2011, at 18:49, AJ wrote:
>
> > Simon,
> >
> > Can you please give details of plugins that you use for Python/Django in
> MacVim?
> >
> > Thanks,
> > AJ
>
> Sure.
>
> I use this plugin collection:
>
> https://github.com/carlhuda/janus
>
> as well as this extra plugin:
>
> http://www.vim.org/scripts/script.php?script_id=2441
>
> I'm positive there are more out there and I have tried various code folding
> plugins but they just slowed me down. If anyone else has any more tips I'd
> like to know what the consensus is with vim users for Python / Django
> development. My .vimrc file is as follows if you want that as well (it has
> some stuff for Haskell in it as well which you can remove):
>
> set nocompatible
> set columns=80
> if has("colorcolumn")
>set colorcolumn=80
> else
>au BufWinEnter * let w:m2=matchadd('ErrorMsg', '\%>80v.\+', -1)
> endif
> set guifont=Monaco:h14
> set guioptions=aAce
> set shiftwidth=4
> set tabstop=4
> set softtabstop=4
> set expandtab
> set undolevels=1000
> set history=1000
> set hlsearch
> set showmatch
> set title
> set visualbell
> set noerrorbells
> set wildignore=*.o,*.swp,*.pyc,*.pyo,*.hg,*.git,*.bak,*.class
> filetype on
> filetype plugin indent on
> " enable omni completion for python
> au FileType python set omnifunc=pythoncomplete#Complete
> " pyflakes is an intellisense checker for python
> let g:pyflakes_use_quickfix = 0
> syntax on
> au Bufenter *.hs compiler ghc
> set confirm
> set number
> set nowrap
> set nobackup
> set nowritebackup
> set noswapfile
> set pastetoggle=
> let g:haddock_browser = "open"
> let g:haddock_browser_callformat = "%s %s"
>
> --
> 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: Weird Error when following django book?

2011-05-25 Thread raj
Thank you, so I guess everything is working okay. :)

On May 25, 2:30 pm, Jacob Kaplan-Moss  wrote:
> On Wed, May 25, 2011 at 1:04 PM, Boštjan Mejak  
> wrote:
> > HTML source code can't be passed as a string. You morons.
>
> This isn't OK. Stop it at once.
>
> You've been warned about your tone once before. Please aim for a
> professional, polite tone here or find another group to hang out in.
> If you can't act nicely I will have to ban you, and I don't want to do
> that.
>
> Jacob

-- 
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: NoReverseMatch while rendering

2011-05-25 Thread Alexandra
Thanks Andy.  found my error- which was a syntax problem in my
render_to_response function in the views.py.

On May 25, 11:01 pm, Andy McKay  wrote:
> On 2011-05-25, at 7:58 PM, Alexandra wrote:
>
> > Has anyone seen this before? My urls.py seem to be configured properly
>
> Without knowing the relevant line in urls.py, its hard to guess, but one 
> would be that phone.adder.username is an empty string, as noted here:
>
> > Caught NoReverseMatch while rendering: Reverse for 'profile_detail'
> > with arguments '('',)' and keyword arguments '{}' not found.
>
> Hence it can't find the matching url.
> --
>   Andy McKay
>   a...@clearwind.ca
>   twitter: @andymckay

-- 
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: Synchronize method or model field access

2011-05-25 Thread Andy McKay

On 2011-05-25, at 3:22 PM, Pawel R wrote:

>> I would push the atomic updates to the database or use a queue with a single 
>> worker.  Thread level locking doesn't scale across processes or servers.
> 
> Could you tell me please how?

Celery provides a queue you could use:

http://ask.github.com/celery/getting-started/introduction.html
--
  Andy McKay
  a...@clearwind.ca
  twitter: @andymckay
 

-- 
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: NoReverseMatch while rendering

2011-05-25 Thread Andy McKay
On 2011-05-25, at 7:58 PM, Alexandra wrote:
> Has anyone seen this before? My urls.py seem to be configured properly

Without knowing the relevant line in urls.py, its hard to guess, but one would 
be that phone.adder.username is an empty string, as noted here: 

> Caught NoReverseMatch while rendering: Reverse for 'profile_detail'
> with arguments '('',)' and keyword arguments '{}' not found.

Hence it can't find the matching url.
--
  Andy McKay
  a...@clearwind.ca
  twitter: @andymckay
 

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



NoReverseMatch while rendering

2011-05-25 Thread Alexandra
I got the following TemplateSyntaxError:

Caught NoReverseMatch while rendering: Reverse for 'profile_detail'
with arguments '('',)' and keyword arguments '{}' not found.

The exact line causing the issue is the following in my
view_phone.html template file:

{% blocktrans %}added by{% endblocktrans %} {{ phone.adder }}
{% blocktrans %}on{% endblocktrans %} {{ phone.added|date }}

Has anyone seen this before? My urls.py seem to be configured properly
etc. Can't seem to figure this one 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.



Re: Annotate with a filtered Count

2011-05-25 Thread Sean McArthur
I would be very interested to know if there is a way to do this using 
Django's Aggregation API. For now, the only solution I can come up with is 
having to use a fat .extra() call.

-- 
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: Anyone got experience of using django-fiber cms?

2011-05-25 Thread Dave Sayer
On 18 May 2011 19:45, growlf  wrote:
> Actually, Django-CMS does have front-end editing, but it seems that
> the latest edition is a bit wonky atm with regards to the interface
> and the documentation on actually using it.  I think the developers
> are moving towards a more stable MPTT solution, and this motion seems
> to be the cause.
>
> I have used both, and have found that while the user interface of
> Django-Fiber is more eye-pleasing, it is lacking many of the features
> that Django-CMS offers.  It also does not have the sizable plug-in
> list for immediate additions of functionality of Django-CMS. Nor does
> it seem to be as easily extended to include an existing Django app.
> This last issue is a total deal breaker for me, at least.
>
> I would suggest using Django-CMS and adding your fixes, plug-ins and
> documentation to the project rather than home-rolling yet another
> CMS.  Unless, that is, you have a pretty good idea of what you want
> and it is definitely not something that can be added to an existing
> system.  This would give you far more options and maintainability.
> The Django-CMS guys are very active and responsive to outside input
> and help, too.
>
> Just my two-cents.
>

Growlf,

Thanks for your input on this. Really appreciate it and I am sorry for
my delayed response - I completely missed your reply until today.

> I would suggest using Django-CMS and adding your fixes, plug-ins and
> documentation to the project rather than home-rolling yet another
> CMS.
I agree with you on this. Seems a little foolish to attempt to
reinvent the wheel when there are plenty of options about.

I ended up ditching fiber pretty quickly due to lack of documentation
and ended up choosing FeinCMS, which has been great, although lacking
in some areas - either that or my knowledge/understanding of the docs
is lacking to the point where I am coming to a grinding halt with the
MPTT side of things.

Anyway, cheers again for your response.

Dave

-- 
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: Form Validation - Redisplay With Error

2011-05-25 Thread Robin
I'm very comfortable with SQL and more traditional programming.  Would
you recommend some specific HTTP primer, or anything  else for those
making the transition to web dev?

On May 25, 8:24 am, bruno desthuilliers
 wrote:
> On May 25, 3:54 pm, Robin  wrote:
>
> > Because that would be too easy? ;)
>
> Well... 
>
> >  Sincere thanks, Bruno.  A lot of
> > this is new to me...python, Django, web dev, and even open source.
> > Didn't even think of that!
>
> Surprisingly enough, it took me a couple weeks realizing I could as
> well just read the source code when I started working on / with oss.
>
> wrt/ web dev, I think the most important thing to learn is the HTTP
> protocol itself (and a couple others related specs like cookies etc).
> Once you get it, lot of things in Django (or any other decent web
> framework) starts to make sense, and it's easier to know what to look
> for in the doc.
>
> (ok, I assume you already have a decent knowledge of things like SQL,
> HTML, text processing, Python etc).

-- 
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: Synchronize method or model field access

2011-05-25 Thread Pawel R
> I would push the atomic updates to the database or use a queue with a single 
> worker.  Thread level locking doesn't scale across processes or servers.

Could you tell me please how?

-- 
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: Section 508 compliance for Django for grant application

2011-05-25 Thread Lisabeth
Thank you. That was a very satisfying link to forward internally as I
have been arguing exactly the same thing: that Django is transparent
to the end user and the burden of 508 compliance applies to the web
pages that are served.

So far, no one has been swayed by that argument.

I am still hoping that someone else has been forced to do this and is
willing to share advice on how they handled it. The fact that Django
is not the right piece of the puzzle to be inspecting for
accessibility compliance makes it more difficult to fill out the
form.

-L.

On May 25, 2:13 pm, Benjamin Welton 
wrote:
> https://code.djangoproject.com/ticket/5635#comment:1
>
> Unless there has been a recent change to this policy, your going to have
> to fill out the section 508 yourself.
>
> Ben
>
> On 05/25/2011 04:00 PM, Lisabeth wrote:
>
>
>
>
>
>
>
> > Hello,
>
> > I'm part of a bioinformatics team at a small, non-profit biomedical
> > research institute (Seattle BioMed). We are working on a grant
> > application that includes Django as we are excited about getting into
> > python and the BioPython module.
>
> > However, to include this technology in the grant, we must assert its
> > section 508 (accessibility) compliance. Specifically, our IT director
> > is looking for the "VPAT".  I have found references to people
> > asserting that it is compliant, but no real resources to assist in
> > completing the required documentation.
>
> > Has anybody got any relevant experience in completing section 508
> > compliance for Django?  Perhaps someone else has competed for a grant
> > (successfully or unsuccessfully) that required filling out this form
> > for Django?  There is the possibility of filling out the compliance
> > form and certifying it ourselves but I think there is a stigma about
> > that.
>
> > Any advice would be greatly appreciated.
>
> > -L.

-- 
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: Synchronize method or model field access

2011-05-25 Thread Eric Chamberlain

On May 25, 2011, at 11:19 AM, Pawel R wrote:

>> Synchronise what with what?
> 
> Synchronize with other threads. I need this method to be invoked by only one 
> thread at a time.
> 
>> "It doesn't work" is utterly useless. What does it do?
> 
> It lets more than 1 thread to invoke this method at a time.
> 
>> How does that differ from what you were expecting?
> 
> I want only one thread to access this method.

I would push the atomic updates to the database or use a queue with a single 
worker.  Thread level locking doesn't scale across processes or servers.

-- 
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: Section 508 compliance for Django for grant application

2011-05-25 Thread Benjamin Welton

https://code.djangoproject.com/ticket/5635#comment:1

Unless there has been a recent change to this policy, your going to have 
to fill out the section 508 yourself.


Ben

On 05/25/2011 04:00 PM, Lisabeth wrote:

Hello,

I'm part of a bioinformatics team at a small, non-profit biomedical
research institute (Seattle BioMed). We are working on a grant
application that includes Django as we are excited about getting into
python and the BioPython module.

However, to include this technology in the grant, we must assert its
section 508 (accessibility) compliance. Specifically, our IT director
is looking for the "VPAT".  I have found references to people
asserting that it is compliant, but no real resources to assist in
completing the required documentation.

Has anybody got any relevant experience in completing section 508
compliance for Django?  Perhaps someone else has competed for a grant
(successfully or unsuccessfully) that required filling out this form
for Django?  There is the possibility of filling out the compliance
form and certifying it ourselves but I think there is a stigma about
that.

Any advice would be greatly appreciated.

-L.




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



Section 508 compliance for Django for grant application

2011-05-25 Thread Lisabeth
Hello,

I'm part of a bioinformatics team at a small, non-profit biomedical
research institute (Seattle BioMed). We are working on a grant
application that includes Django as we are excited about getting into
python and the BioPython module.

However, to include this technology in the grant, we must assert its
section 508 (accessibility) compliance. Specifically, our IT director
is looking for the "VPAT".  I have found references to people
asserting that it is compliant, but no real resources to assist in
completing the required documentation.

Has anybody got any relevant experience in completing section 508
compliance for Django?  Perhaps someone else has competed for a grant
(successfully or unsuccessfully) that required filling out this form
for Django?  There is the possibility of filling out the compliance
form and certifying it ourselves but I think there is a stigma about
that.

Any advice would be greatly appreciated.

-L.


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



Looking for Class Base Views intro (not Generic Class Base Views!)

2011-05-25 Thread Mateusz Harasymczuk
I am looking for a Class Base Views introduction or tutorial.
I have googled the web, and all I was able to find was the Generic Class 
Base Views.

There were only a few examples of non generic views, however the code was to 
fuzzy.

Django generally has a superb documentation, but this part is not so good.

Q1. Or maybe I am wrong and there is no Class Based Views beside the Generic 
ones?

I want to move my function based views to the classes.
I would like to make them RESTful with login_required decorator for some of 
them:

I have this:

import re

from django.contrib.auth.decorators import login_required
from django.utils.decorators import method_decorator
from django.views.generic.base import TemplateView

nonalpha_re = re.compile('[^A-Z]')


class BaseView(TemplateView):
""" Subclass this and add GET / POST / etc methods. """
allowed_methods = ('GET', 'PUT', 'POST', 'DELETE', 'HEAD', 'OPTIONS')
context_object_name = "object"

def __call__(self, request, *args, **kwargs):
""" """
method = nonalpha_re.sub('', request.method.upper())

if not method in self.allowed_methods or not hasattr(self, method):
return self.http_method_not_allowed(request, *args, **kwargs)

return getattr(self, method)(request, *args, **kwargs)



class AuthenticatedView(BaseView):
""" Require login """

@method_decorator(login_required)
def dispatch(self, *args, **kwargs):
return super(BaseView, self).dispatch(*args, **kwargs)

 
and then in my views.py


class ContractView(AuthenticatedView):
template_name = "crm/contract/index.html"

def GET(request, id):
c = get_object_or_404(Contract, id=id)
return {"contract": c}

and so on...

Q2. Am I thinking right?
Q3. How to make prettier JSON dumps?

for example if I set ContractView.mimetype = 'application/json'
I would like to render returned value from GET method and send it to browser 
as a JSON string instead of directing it to the template.

Looking forward to hearing from you.
Sincerely

Matt Harasymczuk
http://www.matt.harasymczuk.pl

-- 
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: xsendfile + django problem

2011-05-25 Thread Renato Beserra
Never mind, I moved the XSendFile on up and the solution is working fine.
Thanks.

2011/5/25 Renato Beserra 

> Hey guys,
>
> I am really lost here, i followed this link
> http://groups.google.com/group/django-users/browse_thread/thread/b4ceae1956e003e5/2ed48bf40e0226e9?lnk=gst&q=mod_xsendfile#2ed48bf40e0226e9
>  but
> i can't get this to work. I set up apache and xsendfile properly i guess,
> but i always got a empty file.
>
> Here is my apache log entry for the file requisition: 192.168.0.199 - -
> [25/May/2011:14:49:16 -0500] "GET /test/sendfile HTTP/1.1" 200 307 "-"
> "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/534.24 (KHTML, like Gecko)
> Chrome/11.0.696.68 Safari/534.24"
>
> My httpdconf:
>
>  
>
>Order Deny,Allow
>Allow from all
>XSendFile on
>xSendFilePath /var/www/media/photos
>
> 
>
> Should i try other solution instead of xsenfile?
>
> Thanks in advance.
>
> --
> Renato Beserra Sousa
>



-- 
Renato Beserra Sousa

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



xsendfile + django problem

2011-05-25 Thread Renato Beserra
Hey guys,

I am really lost here, i followed this link
http://groups.google.com/group/django-users/browse_thread/thread/b4ceae1956e003e5/2ed48bf40e0226e9?lnk=gst&q=mod_xsendfile#2ed48bf40e0226e9
but
i can't get this to work. I set up apache and xsendfile properly i guess,
but i always got a empty file.

Here is my apache log entry for the file requisition: 192.168.0.199 - -
[25/May/2011:14:49:16 -0500] "GET /test/sendfile HTTP/1.1" 200 307 "-"
"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/534.24 (KHTML, like Gecko)
Chrome/11.0.696.68 Safari/534.24"

My httpdconf:

 

   Order Deny,Allow
   Allow from all
   XSendFile on
   xSendFilePath /var/www/media/photos



Should i try other solution instead of xsenfile?

Thanks in advance.

-- 
Renato Beserra Sousa

-- 
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: Weird Error when following django book?

2011-05-25 Thread Jacob Kaplan-Moss
On Wed, May 25, 2011 at 1:04 PM, Boštjan Mejak  wrote:
> HTML source code can't be passed as a string. You morons.

This isn't OK. Stop it at once.

You've been warned about your tone once before. Please aim for a
professional, polite tone here or find another group to hang out in.
If you can't act nicely I will have to ban you, and I don't want to do
that.

Jacob

-- 
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: How do you organize your deployment enviroment

2011-05-25 Thread DrBloodmoney
Yeah. That was the post I was thinking about. For some reason I
thought that it came from the core dev team. I still think that
migrations should be a part of a full-stack framework like django
(south is the first app I install in a new project). They might as
well pick the best-in-breed and throw it in.

-- 
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: Synchronize method or model field access

2011-05-25 Thread Pawel R
> Synchronise what with what?

Synchronize with other threads. I need this method to be invoked by only one 
thread at a time.

> "It doesn't work" is utterly useless. What does it do?

It lets more than 1 thread to invoke this method at a time.

> How does that differ from what you were expecting?

I want only one thread to access this method.

Thanks,
Etam.

-- 
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: Weird Error when following django book?

2011-05-25 Thread Boštjan Mejak
HTML source code can't be passed as a string. You morons.

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



Django DATETIME_FORMAT Localization

2011-05-25 Thread jrs_66
Hi,

Despite the high likelihood that I'll be chewed out as an ignoramus
who can't seem to read docs (I have... for about a day), I'm going to
try to ask a seemingly basic question (without even posting my model;)

I'm using the Django 1.2 enhanced localization feature to setup
formatting constants.  This works fine and my tree looks like this-

myapp->formats->en->formats.py

In this file, I have a constant  DATETIME_FORMAT = "n/j/Y"

I have a Japanese file

myapp->formats->en->formats.py

In this file, I have a constant  DATETIME_FORMAT = "Y/n/j"

This all works great for my templating puposes!  Problem is that I
need to know this mask in a view.  Trying to use
settings.DATETIME_FORMAT producing something completely wrong... "N j,
Y, P"... so that's not the answer.

How can I do something like strptime(request.POST["start-date"],
mycurrent_DATETIME_FORMAT)... There's got to be an undocumented way of
referencing the constant currently being used?

Any help would be appreciated.

-jim

-- 
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: How do you organize your deployment enviroment

2011-05-25 Thread Shawn Milochik

On 05/25/2011 01:22 PM, DrBloodmoney wrote:

On Wed, May 25, 2011 at 9:31 AM, DK  wrote:

100% south migration :)

This.
I know that they have said that they weren't going to be putting South
into django (contrib?), but I wish they would. Most django devs should
be using it.


This isn't entirely true.

http://www.aeracode.org/2010/6/2/django-and-migrations/


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



One dedicated db connection per user?

2011-05-25 Thread Gerv Markham
Hi everyone,

Top-level question: I want to have a database connection per
authenticated user, because each has their own username and password
at the database level. Django by default seems geared up either for 1
or a small, set number of databases (and therefore connections). What
is the best way to do this?

More details:

I'm actually using LDAP as my back-end, and the app is for viewing and
changing data in an LDAP directory. My security model says that the
directory does all the access control, and the Django app accesses it
only with the permissions of the current user. So I need to bind to
the directory as the current user, and then use that connection for
all operations.

I have discovered django-ldapdb , which reflects LDAP data as Django models
(very cool) by writing a database backend to interface with the
directory. But its way of doing things assumes you are logged into the
directory with a "super-user" style account, defined in the config,
all the time.

I've also discovered django-auth-ldap  which allows me to authenticate against the
directory and will give me a connection object (stored as
request.user.ldap_user.connection) which is correctly logged in - but
I can't see how to take that connection object and use it for all
subsequent interactions with the directory. Can I do this at the db
router level? How can my db router see the User object so it can
return the right answer?

Thanks for any pointers anyone can provide! :-)

Gerv

-- 
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: How do you organize your deployment enviroment

2011-05-25 Thread DrBloodmoney
On Wed, May 25, 2011 at 9:31 AM, DK  wrote:
> 100% south migration :)

This.
I know that they have said that they weren't going to be putting South
into django (contrib?), but I wish they would. Most django devs should
be using 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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: South migration for fixtures

2011-05-25 Thread DrBloodmoney
On Wed, May 25, 2011 at 12:54 PM, Amit Sethi  wrote:
> Hi all , I might be wrong with some of the concepts as I am new to
> south. I am using south to migrate some fixture data for a django app.
> Also something worth noting is I am bringing south new into the django
> app it was not part of installed apps till now . So the workflow I
> have followed till now is
>
> run syncdb to install south
> create a fake initial migration using convert_to_south command
> create the actual schema migration script for my app using --auto

migrate here then (using default values if you are adding columns)
> create a data migration script with a forward function for the added field

migrate again

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



South migration for fixtures

2011-05-25 Thread Amit Sethi
Hi all , I might be wrong with some of the concepts as I am new to
south. I am using south to migrate some fixture data for a django app.
Also something worth noting is I am bringing south new into the django
app it was not part of installed apps till now . So the workflow I
have followed till now is

run syncdb to install south
create a fake initial migration using convert_to_south command
create the actual schema migration script for my app using --auto
create a data migration script with a forward function for the added field

run python manage.py migrate myapp

Now obviously I get an error related to fixtures not getting installed
. Because I haven't actually changed the data on my fixtures how can I
do that(Also when should I do that) . My confusion also is that if I
dump data now to create new fixtures I will be creating trouble for my
collaborators since when they run syncdb to install south
in the end of syncdb when fixtures are installed they will
have problems because of the change in fixtures ??

-- 
A-M-I-T S|S

-- 
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: Weird Error when following django book?

2011-05-25 Thread Nan

The "u" before the opening quote is Python's way of telling you that
it's a Unicode string instead of an ASCII string.

On May 25, 11:54 am, raj  wrote:
> I'm up to the html template part of the djangobook, and I keep getting
> a weird output error whenever I do a t.render() call. It's a really
> small error but I want to make sure that my django module is correctly
> working. This is the output I got from the example in the django book:
>
> u"Dead John Smith, \n\nThanks for ordering Super Lawn Mower
> from Outdoor Equipment. It's scheduled\nto ship on April 2, 2009.\n
> \n\nYour warranty information will be included in the packing. 
> \n\n\nSincerely,  Outdoor Equipment "
>
> It may look correct, but if you notice, right in the start of the
> entire script, I get the letter "u", this happens when I render
> anything. I always get this "u" right in the beginning of the output!
> I don't know why this is happening. Please help?
> 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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Weird Error when following django book?

2011-05-25 Thread raj
I'm up to the html template part of the djangobook, and I keep getting
a weird output error whenever I do a t.render() call. It's a really
small error but I want to make sure that my django module is correctly
working. This is the output I got from the example in the django book:

u"Dead John Smith, \n\nThanks for ordering Super Lawn Mower
from Outdoor Equipment. It's scheduled\nto ship on April 2, 2009.\n
\n\nYour warranty information will be included in the packing. 
\n\n\nSincerely,  Outdoor Equipment "

It may look correct, but if you notice, right in the start of the
entire script, I get the letter "u", this happens when I render
anything. I always get this "u" right in the beginning of the output!
I don't know why this is happening. Please help?
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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: 500.html and STATIC_URL

2011-05-25 Thread Addy Yeow
http://docs.djangoproject.com/en/dev/topics/http/views/#the-500-server-error-view

On Wed, May 25, 2011 at 11:22 PM, bax...@gretschpages.com <
mail.bax...@gmail.com> wrote:

> Am I correct in understanding that when there is a 500 error and the
> user is routed to 500.html, it does not know settings.STATIC_URL or
> settings.MEDIA_URL, but 404.html does?
>
> --
> 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.
>
>


-- 
http://www.dazzlepod.com . http://twitter.com/dazzlepod
We write elegant and minimal apps that works. We develop web apps with
Django framework.

-- 
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 there an HTML editor that's Django-aware

2011-05-25 Thread Matteius
I am pycharmed by pycharm.  It is a very good way to edit Django
models, views and templates.

On May 24, 1:47 pm, shofty  wrote:
> why not use a python ide that is html aware?
> pycharm by jetbrains is good.
>
> On May 24, 6:49 pm, AJ  wrote:
>
>
>
> > Simon,
>
> > Can you please give details of plugins that you use for Python/Django in
> > MacVim?
>
> > Thanks,
> > AJ
>
> > On Tue, May 24, 2011 at 12:51 PM, Simon Connah 
> > wrote:
>
> > > On 20 May 2011, at 21:18, Kevin Monceaux wrote:
>
> > > > On Fri, May 20, 2011 at 07:51:06AM -0400, Brian Bouterse wrote:
>
> > > >> +1 for vim
>
> > > > I'll second that motion.  I've tried numerous other editors and keep
> > > > sticking with vim for almost everything.  I do use emacs for my e-mail
> > > > editor, with Mutt as my mail client.
>
> > > Yep, vim (and in particular MacVim) is awesome for Python / Django work.
> > > Especially when you install all the Python plugins and source code 
> > > checkers
> > > that are available that highlight any mistakes you make in your work.
>
> > > Couldn't live without it. I just wish it was as good for Objective-C, then
> > > I'd use it all the time.
>
> > > Simon.
>
> > > --
> > > 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.
>
> > --
> > AJ

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



500.html and STATIC_URL

2011-05-25 Thread bax...@gretschpages.com
Am I correct in understanding that when there is a 500 error and the
user is routed to 500.html, it does not know settings.STATIC_URL or
settings.MEDIA_URL, but 404.html does?

-- 
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: Preselected Radio button

2011-05-25 Thread bruno desthuilliers
On May 25, 4:12 pm, Ndungi Kyalo  wrote:
> Am trying to pre-select a radio button created with the django.forms library :
>
>     choices = forms.ChoiceField(
>         widget = forms.RadioSelect(),
>         choices = [
>             ['a', 'i liked it'],
>             ['b', 'i did not like it']
>         ],
>         required=True
>     )
>
> How would I go about getting the 'a' choice pre-selected on an unbound form ?

http://docs.djangoproject.com/en/1.3/ref/forms/api/#dynamic-initial-values

IIRC, this should be enough.

As a side note, you'd better use tuples than lists for your choices -
at least for the "value, label" pairs which are semantically tuples,
and possibly for the choices list itself but then it's more of a micro-
optimisation (tuples are lest costly than lists).

-- 
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: Form Validation - Redisplay With Error

2011-05-25 Thread bruno desthuilliers
On May 25, 3:54 pm, Robin  wrote:
> Because that would be too easy? ;)

Well... 

>  Sincere thanks, Bruno.  A lot of
> this is new to me...python, Django, web dev, and even open source.
> Didn't even think of that!

Surprisingly enough, it took me a couple weeks realizing I could as
well just read the source code when I started working on / with oss.

wrt/ web dev, I think the most important thing to learn is the HTTP
protocol itself (and a couple others related specs like cookies etc).
Once you get it, lot of things in Django (or any other decent web
framework) starts to make sense, and it's easier to know what to look
for in the doc.

(ok, I assume you already have a decent knowledge of things like SQL,
HTML, text processing, Python etc).

-- 
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: Form Validation - Redisplay With Error

2011-05-25 Thread Ndungi Kyalo
sorry, i'll repost under the appropriate subject.

On 25 May 2011 17:11, Ndungi Kyalo  wrote:
> Am trying to pre-select a radio button created with the django.forms library
> :
>     vote = forms.ChoiceField(
>         widget = forms.RadioSelect(),
>         choices = [
>             ['a', 'i liked it'],
>             ['b', 'i did not like it']
>         ],
>         required=True
>     )
> How would I go about getting the 'a' choice pre-selected on an unbound form
> ?
> --
> Ndungi Kyalo

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



Preselected Radio button

2011-05-25 Thread Ndungi Kyalo
Am trying to pre-select a radio button created with the django.forms library :

choices = forms.ChoiceField(
widget = forms.RadioSelect(),
choices = [
['a', 'i liked it'],
['b', 'i did not like it']
],
required=True
)

How would I go about getting the 'a' choice pre-selected on an unbound form ?

-- 
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: Form Validation - Redisplay With Error

2011-05-25 Thread Ndungi Kyalo
Am trying to pre-select a radio button created with the django.forms library
:

vote = forms.ChoiceField(
widget = forms.RadioSelect(),
choices = [
['a', 'i liked it'],
['b', 'i did not like it']
],
required=True
)

How would I go about getting the 'a' choice pre-selected on an unbound form
?

--
Ndungi Kyalo

-- 
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: Form Validation - Redisplay With Error

2011-05-25 Thread Robin
Because that would be too easy? ;)  Sincere thanks, Bruno.  A lot of
this is new to me...python, Django, web dev, and even open source.
Didn't even think of that!  There's so much to learn, it can be
overwhelming.  Thank you again, I'll have a look through the code
today.

On May 25, 1:02 am, bruno desthuilliers
 wrote:
> On May 25, 4:48 am, Robin  wrote:
>
> > I've tried to track down this information (new to Django and web dev)
> > and I'm certainly not expecting a spoon-fed answer.  A nudge in the
> > right direction would be most appreciated. :)
>
> Why don't you just have a look at the code of the builtin auth
> form ?-)
>
> https://code.djangoproject.com/browser/django/trunk/django/contrib/au...

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



Master/detail in the admin

2011-05-25 Thread Thomas Weholt
I've googled and looked at the docs, but haven't found anything
related to this scenario:

I got a master/detail model, defined like so:

class Master(models.Model):
title = models.CharField(max_length=100)

def details_url(self):
return 'Details'
 self.content_object)
details_url.short_description = 'Link to details'
details_url.allow_tags = True

class Detail(models.Model):
master = models.ForeignKey(Master)
details = models.TextField()

They're exposed in the admin using admin.py. My question is this:

1) How can I make the details_url property in the Master-model so that
when exposed in the admin.py a user can click it and go the listing of
details and only see details related to that instance of Master-model?
2) If this can only be done using a custom view, how do I get the view
to produce a page looking like the rest of the admin? I know I can use
the same template code as the admin, but is there a faster way to
produce for instance listings like the details in my case? Generic
views/classes?
3) Adding Master to list_filter for the detailsAdmin-class is not
possible due to the amount of Master-records. Or is it ...? And even
if it was possible, how can I set filters from another page, like if I
click a link in the change_list for Master-model going to the Details
change_list, how can I set the filtering to be set to a specific
instance of a Master model?

In short; all I want is the have the change_list filtered to only show
details related to a specific master-record and reuse as much of the
admin-code/featurebase as possible.

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



Re: UK-based Django Host?

2011-05-25 Thread Nan

Well, I was sort of hoping someone had found a Webfaction equivalent
somewhere on the other side of the pond.  ;-)

Rackspace managed cloud is way out of our price range, and we
really only need resources on the level of a large shared or smallish
VPS plan.


On May 25, 9:48 am, Daniel Hilton  wrote:
> On 25 May 2011 14:43, Nan  wrote:
>
>
>
> > Thanks for the suggestions, guys.  I've heard great things about
> > Linode, but we really need managed hosting.
>
> Then have a look at Rackspace cloud managed options - I think that's
> the closest you're going to get without finding an individual /
> technical organisation to manage it for you.
>
> Cheers,
> Dan
>
>
>
>
>
>
>
>
>
>
>
> > On May 25, 7:24 am, Simon Connah  wrote:
> >> On 24 May 2011, at 18:03, Nan wrote:
>
> >> > I know this question has been asked before, but the most recent thread
> >> > I can find in the archives is from 2007, and presumably the landscape
> >> > has changed since then.
>
> >> > I'm looking for a Webfaction-like host with servers in the UK.  It
> >> > needs to allow long-running processes, of course, and would ideally be
> >> > (like Webfaction) fully managed.  (We don't have the staff to keep a
> >> > server updated or tuned).  We need plenty of memory, shell access (of
> >> > course), and preferably mod_wsgi.
>
> >> > Does anyone have any recommendations of hosts they've worked with?
>
> >> > Thanks!
> >> > -Nan
>
> >> I use Linode (US based host) with a VPS in their London datacentre. It's 
> >> fantastic. The IRC channel is chock full of Python programmers as well :).
>
> >> Simon.
>
> > --
> > 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 
> > athttp://groups.google.com/group/django-users?hl=en.
>
> --
> Dan Hilton
> www.twitter.com/danhiltonwww.DanHilton.co.uk
> 

-- 
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: django raw_id_fields patch

2011-05-25 Thread Ernesto Guevara
I need change the FK id value in raw_id to

Thanks!

2011/5/25 epic2005 

> who have the raw_id_fields patch url.. or some sugguest for modify
> raw_id_fields pop id back in the textbox  , please give me , thanks a
> lot.
>
> --
> 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: UK-based Django Host?

2011-05-25 Thread Daniel Hilton
On 25 May 2011 14:43, Nan  wrote:
>
> Thanks for the suggestions, guys.  I've heard great things about
> Linode, but we really need managed hosting.

Then have a look at Rackspace cloud managed options - I think that's
the closest you're going to get without finding an individual /
technical organisation to manage it for you.

Cheers,
Dan
>
> On May 25, 7:24 am, Simon Connah  wrote:
>> On 24 May 2011, at 18:03, Nan wrote:
>>
>> > I know this question has been asked before, but the most recent thread
>> > I can find in the archives is from 2007, and presumably the landscape
>> > has changed since then.
>>
>> > I'm looking for a Webfaction-like host with servers in the UK.  It
>> > needs to allow long-running processes, of course, and would ideally be
>> > (like Webfaction) fully managed.  (We don't have the staff to keep a
>> > server updated or tuned).  We need plenty of memory, shell access (of
>> > course), and preferably mod_wsgi.
>>
>> > Does anyone have any recommendations of hosts they've worked with?
>>
>> > Thanks!
>> > -Nan
>>
>> I use Linode (US based host) with a VPS in their London datacentre. It's 
>> fantastic. The IRC channel is chock full of Python programmers as well :).
>>
>> Simon.
>
> --
> 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.
>
>



-- 
Dan Hilton

www.twitter.com/danhilton
www.DanHilton.co.uk


-- 
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: UK-based Django Host?

2011-05-25 Thread Nan

Thanks for the suggestions, guys.  I've heard great things about
Linode, but we really need managed hosting.

On May 25, 7:24 am, Simon Connah  wrote:
> On 24 May 2011, at 18:03, Nan wrote:
>
> > I know this question has been asked before, but the most recent thread
> > I can find in the archives is from 2007, and presumably the landscape
> > has changed since then.
>
> > I'm looking for a Webfaction-like host with servers in the UK.  It
> > needs to allow long-running processes, of course, and would ideally be
> > (like Webfaction) fully managed.  (We don't have the staff to keep a
> > server updated or tuned).  We need plenty of memory, shell access (of
> > course), and preferably mod_wsgi.
>
> > Does anyone have any recommendations of hosts they've worked with?
>
> > Thanks!
> > -Nan
>
> I use Linode (US based host) with a VPS in their London datacentre. It's 
> fantastic. The IRC channel is chock full of Python programmers as well :).
>
> Simon.

-- 
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: How do you organize your deployment enviroment

2011-05-25 Thread DK
100% south migration :)

-- 
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: How do you organize your deployment enviroment

2011-05-25 Thread Daniel Roseman
On Wednesday, May 25, 2011 1:22:40 PM UTC+1, jonas wrote:
>
> I'm just wondering how you could handle database changes.
>
> Let's say you have a existing working project and the client asks for some 
> changes.
>
> These changes force you to create an extra table and modify some tables 
> (models). 
> On the development server I could modify the changes to the database and 
> the models files myself.
> But deploying these changes to the production server seems a bit harder to 
> overcome without the fear of loosing your data.
>
> I don't think the newly created models and database tables would form a 
> problem. Simply running ./manage.py syncdb would create the table(s) for us 
> without any problems. 
> But what about tables (models) that are modified ?
>
> How would you best handle such cases of deployment ?
>
That's what South is for.
--
DR. 

-- 
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: Stuck at filtering/slicing

2011-05-25 Thread Michel30
hmm had a send accident..

I tried
 
Documentrevision.objects.values('documentid').annotate(Max('versionnumber')).filter
and it retrieves a list of values, but I need the objects to use later
on

On May 25, 2:40 pm, Michel30  wrote:
> I've tried annotate before but I ran into the issue that it returns a
> list of values I believe?
> I tried:
>
> On May 25, 1:40 pm, Jani Tiainen  wrote:
>
> > On Wed, 2011-05-25 at 02:59 -0700, Michel30 wrote:
> > > Hello all,
>
> > > I have the following model:
>
> > > class Documentrevision(models.Model):
> > >     docrevid = models.AutoField(primary_key=True,
> > > db_column='DocRevID')
> > >     documentid = models.ForeignKey(Document, db_column='DocumentID')
> > >     submitterid = models.ForeignKey('Author', db_column='SubmitterID')
> > >     documenttitle = models.CharField(max_length=765,
> > > db_column='DocumentTitle')
> > >     publicationinfo = models.TextField(db_column='PublicationInfo',
> > > blank=True)
> > >     versionnumber = models.IntegerField(db_column='VersionNumber')
> > >     abstract = models.TextField(db_column='Abstract', blank=True)
> > >     revisiondate = models.DateTimeField(null=True,
> > > db_column='RevisionDate', blank=True)
> > >     timestamp = models.DateTimeField(db_column='TimeStamp')
> > >     obsolete = models.IntegerField(null=True, db_column='Obsolete',
> > > blank=True)
> > >     keywords = models.CharField(max_length=720, db_column='Keywords',
> > > blank=True)
> > >     note = models.TextField(db_column='Note', blank=True)
> > >     demanaged = models.IntegerField(null=True, db_column='Demanaged',
> > > blank=True)
>
> > > Now I want to retrieve all entries that match obsolete=0, then order
> > > on revisiondate and docrevid and last get only the highest
> > > versionnumber for each group of documentid.
>
> > > I got this far:
> > >     found_entries =
> > > Documentrevision.objects.filter(obsolete=0).order_by('-revisiondate','-
> > > docrevid')
>
> > > This gives me all versionnumbers though: I've been trying several ways
> > > to slice, group , do for-loops and can't get it to work..
> > > Any ideas are greatly appreciated :-)
> > > Thanks
>
> > DocumentRevision.objects.values('documentid').annotate(Max('docrevid)').filter(...)
>
> > Should do the trick.
>
> > --
>
> > Jani Tiainen
>
>

-- 
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: Stuck at filtering/slicing

2011-05-25 Thread Michel30
I've tried annotate before but I ran into the issue that it returns a
list of values I believe?
I tried:


On May 25, 1:40 pm, Jani Tiainen  wrote:
> On Wed, 2011-05-25 at 02:59 -0700, Michel30 wrote:
> > Hello all,
>
> > I have the following model:
>
> > class Documentrevision(models.Model):
> >     docrevid = models.AutoField(primary_key=True,
> > db_column='DocRevID')
> >     documentid = models.ForeignKey(Document, db_column='DocumentID')
> >     submitterid = models.ForeignKey('Author', db_column='SubmitterID')
> >     documenttitle = models.CharField(max_length=765,
> > db_column='DocumentTitle')
> >     publicationinfo = models.TextField(db_column='PublicationInfo',
> > blank=True)
> >     versionnumber = models.IntegerField(db_column='VersionNumber')
> >     abstract = models.TextField(db_column='Abstract', blank=True)
> >     revisiondate = models.DateTimeField(null=True,
> > db_column='RevisionDate', blank=True)
> >     timestamp = models.DateTimeField(db_column='TimeStamp')
> >     obsolete = models.IntegerField(null=True, db_column='Obsolete',
> > blank=True)
> >     keywords = models.CharField(max_length=720, db_column='Keywords',
> > blank=True)
> >     note = models.TextField(db_column='Note', blank=True)
> >     demanaged = models.IntegerField(null=True, db_column='Demanaged',
> > blank=True)
>
> > Now I want to retrieve all entries that match obsolete=0, then order
> > on revisiondate and docrevid and last get only the highest
> > versionnumber for each group of documentid.
>
> > I got this far:
> >     found_entries =
> > Documentrevision.objects.filter(obsolete=0).order_by('-revisiondate','-
> > docrevid')
>
> > This gives me all versionnumbers though: I've been trying several ways
> > to slice, group , do for-loops and can't get it to work..
> > Any ideas are greatly appreciated :-)
> > Thanks
>
> DocumentRevision.objects.values('documentid').annotate(Max('docrevid)').filter(...)
>
> Should do the trick.
>
> --
>
> Jani Tiainen

-- 
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: Parsing an XML feed using ElementTree

2011-05-25 Thread Sithembewena Lloyd Dube
P.S: I was aware that I posted a non-django question: I just took the chance
that someone here may have needed to do the same.

Thanks!

On Wed, May 25, 2011 at 2:35 PM, Sithembewena Lloyd Dube
wrote:

> Hi Everyone,
>
> Thanks for all your suggestions. I read up on gzip and urllib and also
> learned in the process that I could use urllib2 as its the latest form of
> that library.
>
> Herewith my solution: I don't know how elegant it is, but it works just
> fine.
>
> def get_contests():
>  url = '
> http://xml.matchbook.com/xmlfeed/feed?sport-id=&vendor=TEST&sport-name=&short-name=Po
> '
>  req = urllib2.Request(url)
>  req.add_header('accept-encoding','gzip/deflate')
>  opener = urllib2.build_opener()
>  response = opener.open(req)
>  compressed_data = response.read()
>  compressed_stream = StringIO.StringIO(compressed_data)
>  gzipper = gzip.GzipFile(fileobj=compressed_stream)
>  data = gzipper.read()
>  current_path = os.path.realpath(MEDIA_ROOT + '/xml-files/d.xml')
>  data_file = open(current_path, 'w')
>  data_file.write(data)
>  data_file.close()
>  xml_data = ET.parse(open(current_path, 'r'))
>  contest_list = []
>  for contest_parent_node in xml_data.getiterator('contest'):
>   contest = Contest()
>   for contest_child_node in contest_parent_node:
>if (contest_child_node.tag == "name" and
> contest_child_node.text is not None and contest_child_node.text != ""):
> contest.name = contest_child_node.text
>if (contest_child_node.tag == "league" and
> contest_child_node.text is not None and contest_child_node.text != ""):
>contest.league = contest_child_node.text
>if (contest_child_node.tag == "acro" and
> contest_child_node.text is not None and contest_child_node.text != ""):
>contest.acro = contest_child_node.text
>if (contest_child_node.tag == "time" and
> contest_child_node.text is not None and contest_child_node.text != ""):
>contest.time = contest_child_node.text
>if (contest_child_node.tag == "home" and
> contest_child_node.text is not None and contest_child_node.text != ""):
>contest.home = contest_child_node.text
>if (contest_child_node.tag == "away" and
> contest_child_node.text is not None and contest_child_node.text != ""):
>contest.away = contest_child_node.text
>   contest_list.append(contest)
>  try:
>   os.remove(current_path)
>  except:
>   pass
>  return contest_list
>
> Many thanks!
>
>
>
>
>
> On Tue, May 24, 2011 at 10:26 PM, Brian Bouterse wrote:
>
>> We all have our opinions.  Either way this conversation is OT from Django.
>>
>>
>> On Tue, May 24, 2011 at 4:07 PM, Masklinn  wrote:
>>
>>> On 2011-05-24, at 21:57 , Brian Bouterse wrote:
>>> > +1 for xpath
>>> >
>>> > I also like using
>>> > xml.dom.minidom>> >since
>>> > it is so simple and straightforward.
>>> >
>>> I'm sorry, but I whole-heartedly disagree with this. ElementTree is
>>> orders of magnitude simpler and more straightforward than the unending pain
>>> of working with the DOM interface.
>>>
>>> --
>>> 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.
>>>
>>>
>>
>>
>> --
>> Brian Bouterse
>> ITng 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
>> django-users+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/django-users?hl=en.
>>
>
>
>
> --
> Regards,
> Sithembewena Lloyd Dube
>



-- 
Regards,
Sithembewena Lloyd Dube

-- 
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: Parsing an XML feed using ElementTree

2011-05-25 Thread Sithembewena Lloyd Dube
Hi Everyone,

Thanks for all your suggestions. I read up on gzip and urllib and also
learned in the process that I could use urllib2 as its the latest form of
that library.

Herewith my solution: I don't know how elegant it is, but it works just
fine.

def get_contests():
 url = '
http://xml.matchbook.com/xmlfeed/feed?sport-id=&vendor=TEST&sport-name=&short-name=Po
'
 req = urllib2.Request(url)
 req.add_header('accept-encoding','gzip/deflate')
 opener = urllib2.build_opener()
 response = opener.open(req)
 compressed_data = response.read()
 compressed_stream = StringIO.StringIO(compressed_data)
 gzipper = gzip.GzipFile(fileobj=compressed_stream)
 data = gzipper.read()
 current_path = os.path.realpath(MEDIA_ROOT + '/xml-files/d.xml')
 data_file = open(current_path, 'w')
 data_file.write(data)
 data_file.close()
 xml_data = ET.parse(open(current_path, 'r'))
 contest_list = []
 for contest_parent_node in xml_data.getiterator('contest'):
  contest = Contest()
  for contest_child_node in contest_parent_node:
   if (contest_child_node.tag == "name" and
contest_child_node.text is not None and contest_child_node.text != ""):
contest.name = contest_child_node.text
   if (contest_child_node.tag == "league" and
contest_child_node.text is not None and contest_child_node.text != ""):
   contest.league = contest_child_node.text
   if (contest_child_node.tag == "acro" and
contest_child_node.text is not None and contest_child_node.text != ""):
   contest.acro = contest_child_node.text
   if (contest_child_node.tag == "time" and
contest_child_node.text is not None and contest_child_node.text != ""):
   contest.time = contest_child_node.text
   if (contest_child_node.tag == "home" and
contest_child_node.text is not None and contest_child_node.text != ""):
   contest.home = contest_child_node.text
   if (contest_child_node.tag == "away" and
contest_child_node.text is not None and contest_child_node.text != ""):
   contest.away = contest_child_node.text
  contest_list.append(contest)
 try:
  os.remove(current_path)
 except:
  pass
 return contest_list

Many thanks!




On Tue, May 24, 2011 at 10:26 PM, Brian Bouterse  wrote:

> We all have our opinions.  Either way this conversation is OT from Django.
>
>
> On Tue, May 24, 2011 at 4:07 PM, Masklinn  wrote:
>
>> On 2011-05-24, at 21:57 , Brian Bouterse wrote:
>> > +1 for xpath
>> >
>> > I also like using
>> > xml.dom.minidom> >since
>> > it is so simple and straightforward.
>> >
>> I'm sorry, but I whole-heartedly disagree with this. ElementTree is orders
>> of magnitude simpler and more straightforward than the unending pain of
>> working with the DOM interface.
>>
>> --
>> 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.
>>
>>
>
>
> --
> Brian Bouterse
> ITng 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
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>



-- 
Regards,
Sithembewena Lloyd Dube

-- 
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: How do you organize your deployment enviroment

2011-05-25 Thread Jonas Geiregat
I'm just wondering how you could handle database changes.

Let's say you have a existing working project and the client asks for some 
changes.

These changes force you to create an extra table and modify some tables 
(models). 
On the development server I could modify the changes to the database and the 
models files myself.
But deploying these changes to the production server seems a bit harder to 
overcome without the fear of loosing your data.

I don't think the newly created models and database tables would form a 
problem. Simply running ./manage.py syncdb would create the table(s) for us 
without any problems. 
But what about tables (models) that are modified ?

How would you best handle such cases of deployment ?


Op 23-mei-2011, om 09:00 heeft DK het volgende geschreven:

> Hi,
> 
> I am having a django project that  is being frequently deployed on clean 
> linux installation. After a few deployments I have noticed that this process 
> is very time consuming for me (every time I am preparing run scripts for 
> everything, configuring cronjobs, paths to log files, etc) but this could be 
> easily automated.
> 
> What are a ready solutions to manage such deployments?
> 
> My typical workflow is:
> 1) install packages on debian/ubuntu via aptitude (like database, etc)
> 2) creating new virtualenv + getting pip
> 3) pip install -r requirements (to setup enviroment)
> 4) fetch django project from code repository
> 5) setup runtime dir (I keep there: run - for pid files, logs, conf - for 
> some config variables or scritps, scripts - some starting srcipts)
> 6) setup crontab jobs 
> 7) setup webserver + django wsgi to be started 
> 
> 
> Sure - I can write some custom made installer for that, but wondering if 
> there is some generic tool for such things.
> 
> PS. I have heard about fabric, but didn't investigate this tool yet. 
> 
> 
> 
> 
> -- 
> 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.


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



Re: login with subdomains

2011-05-25 Thread tom
Hey Lucian,

that sounds solid. I will implement that together with an additional
auth backend. Looking into the option of subclassing remoteuserbackend
and adding the functionality there but also leverage the remote_user
META variable. That sounds to me like a very robust solution.
Thanks for describing in that detail!

I keep you posted about the final implementation.

regards, tom

On 25 Mai, 13:39, "Cal Leeming [Simplicity Media Ltd]"
 wrote:
> Hi OP,
>
> To do this, you need to use what's known as a 'handoff'. This basically
> means handing off an authenticated session to a different FQDN.
>
> There are several ways you can do this, but I would recommend using the
> following:
>
>    - Create a receiver URL on each FQDN which can be handed off to (in this
>    case whatever.* and www.*), called /handoff/(.*)
>    - Create a secret string inside the settings file, which will be used to
>    build a hash of the username and password.
>    - From the originating site, generate a hash of the username and password
>    (salted with the secret string), store this hash (along with the original
>    username and password) in a cache server for 60 seconds, and redirect the
>    user to the new domain on /handoff/insert_hash_here.
>    - On the receiving site, extract the hash, and check the cache server to
>    make sure it exists, and then re-authenticate the user manually using
>    login() with the username and password extracted from the cache entry.
>
> This is pretty much the industry standard way of doing things properly.
> There are easier (and less secure) alternatives, but I would highly
> recommend using this (it's certainly what we use anyway).
>
> Cal
>
> On Wed, May 25, 2011 at 12:00 PM, Lucian Nicolescu wrote:
>
>
>
> > You're right, it would be valid for all subdomains. Hmm ... I can't
> > see a solution without a hack. Eg: authenticate the user on
> > agileamp.com and at the same time do a AJAX request to the subdomain's
> > authentication clone.
>
> > This way the a cookie would be set only for the TLD (agileamp.com) and
> > for the subdomain (whatever.agileamp.com). The two sessions would be
> > different but I guess that's okay, right?
>
> > Now that I think of it it would be simpler to make the session global
> > and add the subdomain restriction to it. This way when the user visits
> > a subdomain the first thing you do is to check the restriction in the
> > session.
>
> > Let us know what you come up with!
>
> > Lucian
>
> > On Wed, May 25, 2011 at 12:46 PM, tom  wrote:
> > > well, I thought about this, but wouldn't then the session be valid for
> > > test.agileamp.com as well as for test2.agileamp.com? I want to set the
> > > session only for test.agileamp.com (the subdomain where the account
> > > belongs to).
>
> > > On 25 Mai, 10:30, Lucian Nicolescu  wrote:
> > >> I think you can use the SESSION_COOKIE_DOMAIN and set it up to
> > >> ".agileamp.com" (docs:
> >http://docs.djangoproject.com/en/dev/topics/http/sessions/#session-co...).
>
> > >> Lucian
>
> > >> On Tue, May 24, 2011 at 11:46 PM, tom  wrote:
> > >> > Hello,
>
> > >> > I have a application, where I want that users log in to a special
> > >> > subdomain. For example: The login screen is served atwww.agileamp.com
> > >> > and the user is member of the account with subdomain
> > >> > test.agileamp.com.
>
> > >> > When the user logs in atwww.agileamp.com/login/Iwant to make sure,
> > >> > that he gets the session cookie set for his accounts subdomain.
> > >> > test.agileamp.com.
>
> > >> > Any ideas?
>
> > >> > regards, Tom
>
> > >> > --
> > >> > 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 athttp://
> > 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.

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

Re: (extendable) social network plugin

2011-05-25 Thread Leon van der Ree
Thanks Matias,

I had the time to take a good look at django-social-auth and this was
the thing I was looking for. This looks great!

I will come back about the social-communication plugin, which is
capable of performing all kind of postings on social networks in a
unified way, in another post once I have some more time.

Regards
Leon


On 23 mei, 14:32, Leon van der Ree  wrote:
> Thanks for your response Matias,
>
> Unfortunately some things have come in between, but I will definitely
> take another look at social-auth once I've get some time and let you
> know about the result!
>
> Regards
> Leon
>
> On 20 mei, 17:52, Matías Aguirre  wrote:
>
>
>
>
>
>
>
> > Excerpts from Leon van der Ree's message of Fri May 20 11:21:15 -0300 2011:
>
> > > Hi all,
>
> > Hi,
>
> > > First a short intro, since this is my first post
>
> > > Last few years I have been working on and with Symfony (Php) a lot,
> > > but since I am done with the ugly bugs within Php I decided to switch
> > > to another development environment. I have always been interested in
> > > other languages and frameworks and Python and Django always looked
> > > very promising to me. Now that I have a new job I was able to make
> > > this switch so I dived into Python and Django. I think I now have a
> > > basic understanding of how to optimally use the dynamic capabilities
> > > of Python (something that you can't properly meke use of in Php if you
> > > ask me) and I understand the design of Django. Untill now all seems
> > > brilliant!
>
> > Welcome!
>
> > > My first assignment in Django is to develop a social-media powered
> > > website, so I started to explore the community plugins but now got a
> > > bit disappointed. I haven't found anything that is capable to handle
> > > several different social networks. Am I missing something or isn't it
> > > there yet?
>
> > > So far I found several social-authorization applications, but most of
> > > them where tightly coupled with the social networks they can handle so
> > > there is no easy way of adding different networks from outside the
> > > application (by E.G. adding an extra application for another network
> > > and provide it to the generic-app through your project
> > > configuration).
> > > Other social media plugins that I found are capable of doing more than
> > > only authorization, but are build specifically for one social network.
> > > Django is so nicely organised, and capable of being extended with all
> > > kind of functionality, so I would have expect social-media apps that
> > > where designed this way as well?
>
> > You might have foundhttp://github.com/omab/django-social-auth/already,
> > as you can see it's easy to extend adding more and more authentication
> > backends, they can be on a separated module even. But, it only take care
> > of authentication, that's because there are plenty of projects that
> > handle user data retrieval and each project have different needs. And
> > I prefer the do-one-single-thing principle.
>
> > Anyway It's easy to extend using the defined signals, there you can
> > easily retrieve user data from the different social-media sites.
>
> > > My idea of a social media application is that it should be extendable
> > > and capable of doing more than only handling authorisation. Depending
> > > on the social network you have more or less functionality that can be
> > > used. E.G. Facebook and Twitter both support posting messages, but
> > > only Facebook supports liking things. But you have thinkgs like Orkut
> > > (and in Holland Hyves) as well, which could make use of the same
> > > generic interface to support like-ing and sending messages, while
> > > others, like e.g. gmail only support authorisation.
>
> > This could be a interesting side project, but it should do only that, no
> > more IMO.
>
> > > I think there can be a generic interface with functionality and
> > > specialised classes per social network that implement this
> > > functionality. Than in your project settings you should be able to
> > > simply (configure and) enable these networrks.These specialised
> > > classes for all the different networks can be provided in different
> > > apps, so anyone can build new connections without modifying the
> > > generic social-app. In these specialised apps you can choose how to
> > > implement the connection to the network yourself (use the entire
> > > python facebook library, or write a custom facebook authroisation
> > > module yourself). I think a good base for this is the implementation
> > > of django-allauth although it currently has some hardcoded
> > > configuration (urls, templatetags, etc) and is limited to only
> > > authorisation.
>
> > > Any feedback about this would be greatly appreciated!
> > > Leon
>
> > Thanks,
> > Matías
> > --
> > Matías Aguirre 

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

Re: Stuck at filtering/slicing

2011-05-25 Thread Jani Tiainen
On Wed, 2011-05-25 at 02:59 -0700, Michel30 wrote:
> Hello all,
> 
> I have the following model:
> 
> class Documentrevision(models.Model):
> docrevid = models.AutoField(primary_key=True,
> db_column='DocRevID')
> documentid = models.ForeignKey(Document, db_column='DocumentID')
> submitterid = models.ForeignKey('Author', db_column='SubmitterID')
> documenttitle = models.CharField(max_length=765,
> db_column='DocumentTitle')
> publicationinfo = models.TextField(db_column='PublicationInfo',
> blank=True)
> versionnumber = models.IntegerField(db_column='VersionNumber')
> abstract = models.TextField(db_column='Abstract', blank=True)
> revisiondate = models.DateTimeField(null=True,
> db_column='RevisionDate', blank=True)
> timestamp = models.DateTimeField(db_column='TimeStamp')
> obsolete = models.IntegerField(null=True, db_column='Obsolete',
> blank=True)
> keywords = models.CharField(max_length=720, db_column='Keywords',
> blank=True)
> note = models.TextField(db_column='Note', blank=True)
> demanaged = models.IntegerField(null=True, db_column='Demanaged',
> blank=True)
> 
> Now I want to retrieve all entries that match obsolete=0, then order
> on revisiondate and docrevid and last get only the highest
> versionnumber for each group of documentid.
> 
> I got this far:
> found_entries =
> Documentrevision.objects.filter(obsolete=0).order_by('-revisiondate','-
> docrevid')
> 
> This gives me all versionnumbers though: I've been trying several ways
> to slice, group , do for-loops and can't get it to work..
> Any ideas are greatly appreciated :-)
> Thanks
> 

DocumentRevision.objects.values('documentid').annotate(Max('docrevid)').filter(...)

Should do the trick.

-- 

Jani Tiainen


-- 
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: Limit admin login domain?

2011-05-25 Thread Cal Leeming [Simplicity Media Ltd]
Yup, you can. But, you have to use multihost.py middleware. Google for
django multihost :)

(we had the exact same requirement, and this is how we resolved it. Also,
multihost is a billion times nicer than the sites framework that comes with
Django, imho).

Cal

2011/5/25 λq 

> Hi guys,
>
> Can I limit only a certain domain can login into django admin?
>
> Without running multiple django instances. Is it possible?
>
> 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.
>

-- 
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: login with subdomains

2011-05-25 Thread Cal Leeming [Simplicity Media Ltd]
Hi OP,

To do this, you need to use what's known as a 'handoff'. This basically
means handing off an authenticated session to a different FQDN.

There are several ways you can do this, but I would recommend using the
following:

   - Create a receiver URL on each FQDN which can be handed off to (in this
   case whatever.* and www.*), called /handoff/(.*)
   - Create a secret string inside the settings file, which will be used to
   build a hash of the username and password.
   - From the originating site, generate a hash of the username and password
   (salted with the secret string), store this hash (along with the original
   username and password) in a cache server for 60 seconds, and redirect the
   user to the new domain on /handoff/insert_hash_here.
   - On the receiving site, extract the hash, and check the cache server to
   make sure it exists, and then re-authenticate the user manually using
   login() with the username and password extracted from the cache entry.

This is pretty much the industry standard way of doing things properly.
There are easier (and less secure) alternatives, but I would highly
recommend using this (it's certainly what we use anyway).

Cal

On Wed, May 25, 2011 at 12:00 PM, Lucian Nicolescu wrote:

> You're right, it would be valid for all subdomains. Hmm ... I can't
> see a solution without a hack. Eg: authenticate the user on
> agileamp.com and at the same time do a AJAX request to the subdomain's
> authentication clone.
>
> This way the a cookie would be set only for the TLD (agileamp.com) and
> for the subdomain (whatever.agileamp.com). The two sessions would be
> different but I guess that's okay, right?
>
> Now that I think of it it would be simpler to make the session global
> and add the subdomain restriction to it. This way when the user visits
> a subdomain the first thing you do is to check the restriction in the
> session.
>
> Let us know what you come up with!
>
> Lucian
>
> On Wed, May 25, 2011 at 12:46 PM, tom  wrote:
> > well, I thought about this, but wouldn't then the session be valid for
> > test.agileamp.com as well as for test2.agileamp.com? I want to set the
> > session only for test.agileamp.com (the subdomain where the account
> > belongs to).
> >
> > On 25 Mai, 10:30, Lucian Nicolescu  wrote:
> >> I think you can use the SESSION_COOKIE_DOMAIN and set it up to
> >> ".agileamp.com" (docs:
> http://docs.djangoproject.com/en/dev/topics/http/sessions/#session-co...).
> >>
> >> Lucian
> >>
> >>
> >>
> >> On Tue, May 24, 2011 at 11:46 PM, tom  wrote:
> >> > Hello,
> >>
> >> > I have a application, where I want that users log in to a special
> >> > subdomain. For example: The login screen is served atwww.agileamp.com
> >> > and the user is member of the account with subdomain
> >> > test.agileamp.com.
> >>
> >> > When the user logs in atwww.agileamp.com/login/I want to make sure,
> >> > that he gets the session cookie set for his accounts subdomain.
> >> > test.agileamp.com.
> >>
> >> > Any ideas?
> >>
> >> > regards, Tom
> >>
> >> > --
> >> > 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 athttp://
> 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.
>
>

-- 
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: UK-based Django Host?

2011-05-25 Thread Simon Connah
On 24 May 2011, at 18:03, Nan wrote:

> I know this question has been asked before, but the most recent thread
> I can find in the archives is from 2007, and presumably the landscape
> has changed since then.
> 
> I'm looking for a Webfaction-like host with servers in the UK.  It
> needs to allow long-running processes, of course, and would ideally be
> (like Webfaction) fully managed.  (We don't have the staff to keep a
> server updated or tuned).  We need plenty of memory, shell access (of
> course), and preferably mod_wsgi.
> 
> Does anyone have any recommendations of hosts they've worked with?
> 
> Thanks!
> -Nan

I use Linode (US based host) with a VPS in their London datacentre. It's 
fantastic. The IRC channel is chock full of Python programmers as well :).

Simon.

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



django raw_id_fields patch

2011-05-25 Thread epic2005
who have the raw_id_fields patch url.. or some sugguest for modify
raw_id_fields pop id back in the textbox  , please give me , thanks a
lot.

-- 
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: login with subdomains

2011-05-25 Thread Lucian Nicolescu
You're right, it would be valid for all subdomains. Hmm ... I can't
see a solution without a hack. Eg: authenticate the user on
agileamp.com and at the same time do a AJAX request to the subdomain's
authentication clone.

This way the a cookie would be set only for the TLD (agileamp.com) and
for the subdomain (whatever.agileamp.com). The two sessions would be
different but I guess that's okay, right?

Now that I think of it it would be simpler to make the session global
and add the subdomain restriction to it. This way when the user visits
a subdomain the first thing you do is to check the restriction in the
session.

Let us know what you come up with!

Lucian

On Wed, May 25, 2011 at 12:46 PM, tom  wrote:
> well, I thought about this, but wouldn't then the session be valid for
> test.agileamp.com as well as for test2.agileamp.com? I want to set the
> session only for test.agileamp.com (the subdomain where the account
> belongs to).
>
> On 25 Mai, 10:30, Lucian Nicolescu  wrote:
>> I think you can use the SESSION_COOKIE_DOMAIN and set it up to
>> ".agileamp.com" 
>> (docs:http://docs.djangoproject.com/en/dev/topics/http/sessions/#session-co...).
>>
>> Lucian
>>
>>
>>
>> On Tue, May 24, 2011 at 11:46 PM, tom  wrote:
>> > Hello,
>>
>> > I have a application, where I want that users log in to a special
>> > subdomain. For example: The login screen is served atwww.agileamp.com
>> > and the user is member of the account with subdomain
>> > test.agileamp.com.
>>
>> > When the user logs in atwww.agileamp.com/login/I want to make sure,
>> > that he gets the session cookie set for his accounts subdomain.
>> > test.agileamp.com.
>>
>> > Any ideas?
>>
>> > regards, Tom
>>
>> > --
>> > 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 
>> > athttp://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.



Stuck at filtering/slicing

2011-05-25 Thread Michel30
Hello all,

I have the following model:

class Documentrevision(models.Model):
docrevid = models.AutoField(primary_key=True,
db_column='DocRevID')
documentid = models.ForeignKey(Document, db_column='DocumentID')
submitterid = models.ForeignKey('Author', db_column='SubmitterID')
documenttitle = models.CharField(max_length=765,
db_column='DocumentTitle')
publicationinfo = models.TextField(db_column='PublicationInfo',
blank=True)
versionnumber = models.IntegerField(db_column='VersionNumber')
abstract = models.TextField(db_column='Abstract', blank=True)
revisiondate = models.DateTimeField(null=True,
db_column='RevisionDate', blank=True)
timestamp = models.DateTimeField(db_column='TimeStamp')
obsolete = models.IntegerField(null=True, db_column='Obsolete',
blank=True)
keywords = models.CharField(max_length=720, db_column='Keywords',
blank=True)
note = models.TextField(db_column='Note', blank=True)
demanaged = models.IntegerField(null=True, db_column='Demanaged',
blank=True)

Now I want to retrieve all entries that match obsolete=0, then order
on revisiondate and docrevid and last get only the highest
versionnumber for each group of documentid.

I got this far:
found_entries =
Documentrevision.objects.filter(obsolete=0).order_by('-revisiondate','-
docrevid')

This gives me all versionnumbers though: I've been trying several ways
to slice, group , do for-loops and can't get it to work..
Any ideas are greatly appreciated :-)
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: login with subdomains

2011-05-25 Thread tom
well, I thought about this, but wouldn't then the session be valid for
test.agileamp.com as well as for test2.agileamp.com? I want to set the
session only for test.agileamp.com (the subdomain where the account
belongs to).

On 25 Mai, 10:30, Lucian Nicolescu  wrote:
> I think you can use the SESSION_COOKIE_DOMAIN and set it up to
> ".agileamp.com" 
> (docs:http://docs.djangoproject.com/en/dev/topics/http/sessions/#session-co...).
>
> Lucian
>
>
>
> On Tue, May 24, 2011 at 11:46 PM, tom  wrote:
> > Hello,
>
> > I have a application, where I want that users log in to a special
> > subdomain. For example: The login screen is served atwww.agileamp.com
> > and the user is member of the account with subdomain
> > test.agileamp.com.
>
> > When the user logs in atwww.agileamp.com/login/I want to make sure,
> > that he gets the session cookie set for his accounts subdomain.
> > test.agileamp.com.
>
> > Any ideas?
>
> > regards, Tom
>
> > --
> > 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 
> > athttp://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: Synchronize method or model field access

2011-05-25 Thread Daniel Roseman
On Tuesday, May 24, 2011 9:52:58 PM UTC+1, Etam wrote:
>
> Hi,
>
> how do you synchronize a method (or model field access) in Django?
>
> It doesn't work:
>
> from multiprocessing import Lock
> change_status_lock = Lock()
> def change_status(self, status):
> self.change_status_lock.acquire()
> ...
> self.change_status_lock.release()
>
> Thanks in advance,
> Etam.
>
>
Synchronise what with what?

"It doesn't work" is utterly useless. What does it do? How does that differ 
from what you were expecting? What errors do you get?
--
DR. 

-- 
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: UK-based Django Host?

2011-05-25 Thread Jorge Bastida
Linode 512 here, excellent service.

2011/5/25 Stuart MacKay 

> I use a Linode 512 VPS hosted in London. So far it has been awesome.
>
> Stuart MacKay
> Lisbon, Portugal
>
>
>  I know this question has been asked before, but the most recent thread
>> I can find in the archives is from 2007, and presumably the landscape
>> has changed since then.
>>
>> I'm looking for a Webfaction-like host with servers in the UK.  It
>> needs to allow long-running processes, of course, and would ideally be
>> (like Webfaction) fully managed.  (We don't have the staff to keep a
>> server updated or tuned).  We need plenty of memory, shell access (of
>> course), and preferably mod_wsgi.
>>
>> Does anyone have any recommendations of hosts they've worked with?
>>
>> Thanks!
>> -Nan
>>
>>
> --
> 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: UK-based Django Host?

2011-05-25 Thread Stuart MacKay

I use a Linode 512 VPS hosted in London. So far it has been awesome.

Stuart MacKay
Lisbon, Portugal


I know this question has been asked before, but the most recent thread
I can find in the archives is from 2007, and presumably the landscape
has changed since then.

I'm looking for a Webfaction-like host with servers in the UK.  It
needs to allow long-running processes, of course, and would ideally be
(like Webfaction) fully managed.  (We don't have the staff to keep a
server updated or tuned).  We need plenty of memory, shell access (of
course), and preferably mod_wsgi.

Does anyone have any recommendations of hosts they've worked with?

Thanks!
-Nan



--
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: login with subdomains

2011-05-25 Thread Lucian Nicolescu
I think you can use the SESSION_COOKIE_DOMAIN and set it up to
".agileamp.com" (docs:
http://docs.djangoproject.com/en/dev/topics/http/sessions/#session-cookie-domain).

Lucian

On Tue, May 24, 2011 at 11:46 PM, tom  wrote:
> Hello,
>
> I have a application, where I want that users log in to a special
> subdomain. For example: The login screen is served at www.agileamp.com
> and the user is member of the account with subdomain
> test.agileamp.com.
>
> When the user logs in at www.agileamp.com/login/ I want to make sure,
> that he gets the session cookie set for his accounts subdomain.
> test.agileamp.com.
>
> Any ideas?
>
> regards, Tom
>
> --
> 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: UK-based Django Host?

2011-05-25 Thread Daniel Hilton
On 24 May 2011 20:01, Nan  wrote:
> Thanks, Matt.  Normally I'd agree with you, but this application isn't
> just a website -- it's sensitive to latency issues and will be
> integrating with a third-party service that's also UK-based, so we're
> looking at minimizing cross-Atlantic round-trips.

If you're that worried about latency then a cheap lowend vps maybe the
way. Both slicehost, Rackspace cloud and linode do
London based vps's or try tagadab. Or what about an amazon small
instance in Ireland? Or ovh in France or london?

For actual hardware have a look on http://www.lowenddedi.net/

HTH
Dan

>
>
>
> On May 24, 2:46 pm, shofty  wrote:
>> just use webfaction, you dont know that they're US when you connect
>> from the UK, speed isnt an issue.
>> I moved to a VPS for cost reasons, but webfaction were fine for me.
>>
>> Matt
>>
>> On May 24, 6:03 pm, Nan  wrote:
>>
>>
>>
>>
>>
>>
>>
>> > I know this question has been asked before, but the most recent thread
>> > I can find in the archives is from 2007, and presumably the landscape
>> > has changed since then.
>>
>> > I'm looking for a Webfaction-like host with servers in the UK.  It
>> > needs to allow long-running processes, of course, and would ideally be
>> > (like Webfaction) fully managed.  (We don't have the staff to keep a
>> > server updated or tuned).  We need plenty of memory, shell access (of
>> > course), and preferably mod_wsgi.
>>
>> > Does anyone have any recommendations of hosts they've worked with?
>>
>> > Thanks!
>> > -Nan
>
> --
> 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.
>
>



-- 
Dan Hilton

www.twitter.com/danhilton
www.DanHilton.co.uk


-- 
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: Weird problem with rendering a Variable in a custom tag

2011-05-25 Thread bruno desthuilliers
On May 25, 4:43 am, stevedegrace  wrote:
> And you are absolutely correct, using a local variable in the render
> method and not rebinding self,ip resolves the problem. Thank you very
> much. Can you explain why this is?

"Once a node is parsed, its render method may be called any number of
times"
(http://docs.djangoproject.com/en/1.3/howto/custom-template-tags/
#thread-safety-considerations)

If you wan to make sure, just add a couple print statements (or better
use the logger) in the __init__ and render methods.

HTH

-- 
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: Form Validation - Redisplay With Error

2011-05-25 Thread bruno desthuilliers
On May 25, 4:48 am, Robin  wrote:
> I've tried to track down this information (new to Django and web dev)
> and I'm certainly not expecting a spoon-fed answer.  A nudge in the
> right direction would be most appreciated. :)

Why don't you just have a look at the code of the builtin auth
form ?-)

https://code.djangoproject.com/browser/django/trunk/django/contrib/auth/forms.py#L80

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