Re: Anyone sync'd a django project with flickr recently? django-syncr

2011-09-30 Thread i...@webbricks.co.uk
ok, couple of things to note.

1. get it from the svn, the zip hasn't been updated in a while.

2. you need to follow the instructions here.
http://skooshmagoo.com/weblog/2010/sep/05/fixing-django-syncr-umedium-640/

with those two, you might stand a chance of syncing some photos.
sets, now thats a totally different kettle of fish.
found this snippet, but not tried it out yet.
http://djangosnippets.org/snippets/299/

think the whole sets sync needs moving into a management command, cos
it can take a while!

On Sep 29, 9:07 pm, "i...@webbricks.co.uk" 
wrote:
> I've searched. pretty much everyone 
> recoomendshttp://code.google.com/p/django-syncr/
>
> thing is, it doesn't actually do anything.
>
> am i right in thinking that this code when run, should sync to the
> django database information (sets and photos) from the flickr user you
> give it?
>
> I've given it two users, both on 365 days length and i just don't get
> any recent photos sync'd.
>
> no errors, just no results. i dont even know if I'm expecting it to do
> what i think it does, because the explanation is lacking on the site.
>
> anyone used it?
>
> Matt

-- 
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 to do something just like in user right assignment ?

2011-09-30 Thread BILLION Sébastien

Hi,

You must add a ManyToManyField in your models

https://docs.djangoproject.com/en/dev/ref/models/fields/#django.db.models.ManyToManyField

class Person(models.Model):
name = models.Charfield(max_lenght=200)
colours = models.ManyToManyField(Color)

class Color(models.Model):
name = models.Charfield(max_lenght=200)
persons = models.ManyToManyField(Person)


and in your admin.py, you must redefine your ModelForm and remplace it 
in ModelAdmin : 
http://stackoverflow.com/questions/1226760/filter-manytomany-box-in-django-admin





BILLION Sébastien

the Answer to the ultimate question of life, the universe and everything 
is 42


http://www.sebastienbillion.com/ 

Le 30/09/2011 02:55, bino oetomo a écrit :

Dear All ..

Let's say I have 2 model in manyTOmany relation, i.e : Persons and 
colours


I want a 2 CRUD interface for this , that is :

1. Persons : where I can add colours to each person, and
2. Colours : where I can add Persons to each colour

I also want the "ADD" methode (Add colours to person, and add Persons 
to colour) is just like the Django "User Admin" interface .. when we 
want to asign user-rights to a user.
Just for reference I post the screen capture of it at 
http://i55.tinypic.com/33l2umg.png


How to do that ?
Will I need an intermediate model (i.e : PersonColour) ?
Kindly please give me your enlightment.

Sincerely
-bino-



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



Define Meta attributes at runtime

2011-09-30 Thread Isaac

Hi folks,

I'm wondering if it's possible to set / redefine Meta attributes of a 
given model at runtime.


The problem arises because I'm using a framework with many classes 
defined there, and interacting in a right way. I need to redefine some 
of Meta attributes of that class, but without overriding framework file, 
because it can cause many trouble in any update.


Anyone know how I can access them?

To set an example:

folder1
__init__.py
models.py

from folder1.models import ModelTrouble

ModelTrouble.Meta.verbose_name = "my_verbose_name"

Thanks in advance
Isaac

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



[Admin] Form Fields Rendering Completely Incorrectly

2011-09-30 Thread Nikhil Somaru
Hi All,

Django Version: 1.3
OS: Mac OS X Lion
Browsers: Chrome, Safari, FF
Other: Virtualenv

The models are only registered with admin, there are no ModelAdmin classes.
For some reason, all TextField's on all models (even those with really small
max_length's) render as textarea, even those which have the parameter
choices passed to them (they should be a drop-down box). The class being
applied to them is vLargeTextField.

This is a brand-new Django project, there is no custom css/html and the
devserver is returning 200 (OK) for all requests.

Your help is appreciated.
-- 
Yours,
Nikhil Somaru

-- 
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: [Admin] Form Fields Rendering Completely Incorrectly

2011-09-30 Thread Ilian Iliev
As stated in dcumentation:
https://docs.djangoproject.com/en/dev/ref/models/fields/#textfield

A large text field. The admin represents this as a  (a multi-line
input).
You should use CharField instead of TextField

-- 
eng. Ilian Iliev
Web Software Developer

Mobile: +359 88 66 08 400
Website: http://ilian.i-n-i.org


On Fri, Sep 30, 2011 at 2:01 PM, Nikhil Somaru  wrote:

> Hi All,
>
> Django Version: 1.3
> OS: Mac OS X Lion
> Browsers: Chrome, Safari, FF
> Other: Virtualenv
>
> The models are only registered with admin, there are no ModelAdminclasses. 
> For some reason, all
> TextField's on all models (even those with really small max_length's)
> render as textarea, even those which have the parameter choices passed to
> them (they should be a drop-down box). The class being applied to them is
> vLargeTextField.
>
> This is a brand-new Django project, there is no custom css/html and the
> devserver is returning 200 (OK) for all requests.
>
> Your help is appreciated.
> --
> Yours,
> Nikhil Somaru
>
>  --
> 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.



Looking for a job in the Arctic Circle

2011-09-30 Thread Kevin Renskers
Hi all,

I am a Senior Python/Django programmer from The Netherlands, and I am on a 
quest to move to the Arctic Circle. Right now my focus is on Reykjavik in 
Iceland and Tromsø in Norway. It's quite hard to find jobs in these regions, 
and it's even harder because I don't have a network of people I know in the 
Arctic.

I know it's a long shot, but I am hoping someone on this group knows someone 
else, and they work at a company that could use a programmer, something like 
that :)

My linkedin account with my skills and experience: 
http://nl.linkedin.com/in/kevinrenskers
My twitter account where I write about my quest: 
http://www.twitter.com/movetoarctic

I also do Javascript and iPhone/Mac development, and have 9 years of 
experience in PHP.

Thanks!

Kevin

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

2011-09-30 Thread Daniel Roseman
On Friday, 30 September 2011 12:35:30 UTC+1, Kevin Renskers wrote:

> Hi all,
>
> I am a Senior Python/Django programmer from The Netherlands, and I am on a 
> quest to move to the Arctic Circle. Right now my focus is on Reykjavik in 
> Iceland and Tromsø in Norway. It's quite hard to find jobs in these regions, 
> and it's even harder because I don't have a network of people I know in the 
> Arctic.
>
> I know it's a long shot, but I am hoping someone on this group knows 
> someone else, and they work at a company that could use a programmer, 
> something like that :)
>
> My linkedin account with my skills and experience: 
> http://nl.linkedin.com/in/kevinrenskers
> My twitter account where I write about my quest: 
> http://www.twitter.com/movetoarctic
>
> I also do Javascript and iPhone/Mac development, and have 9 years of 
> experience in PHP.
>
> Thanks!
>
> Kevin
>


Reykjavik is well south of the Arctic Circle - in fact all of Iceland 
(except for a small offshore island, apparently) is below the circle.
--
DR.

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

2011-09-30 Thread Yves S. Garret
http://www.ccpgames.com/en/jobs

On Fri, Sep 30, 2011 at 7:35 AM, Kevin Renskers  wrote:

> Hi all,
>
> I am a Senior Python/Django programmer from The Netherlands, and I am on a
> quest to move to the Arctic Circle. Right now my focus is on Reykjavik in
> Iceland and Tromsø in Norway. It's quite hard to find jobs in these regions,
> and it's even harder because I don't have a network of people I know in the
> Arctic.
>
> I know it's a long shot, but I am hoping someone on this group knows
> someone else, and they work at a company that could use a programmer,
> something like that :)
>
> My linkedin account with my skills and experience:
> http://nl.linkedin.com/in/kevinrenskers
> My twitter account where I write about my quest:
> http://www.twitter.com/movetoarctic
>
> I also do Javascript and iPhone/Mac development, and have 9 years of
> experience in PHP.
>
> Thanks!
>
> Kevin
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/django-users/-/5zG0VNJNBG0J.
> 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: Looking for a job in the Arctic Circle

2011-09-30 Thread Kevin Renskers
Ha, yeah I know that Iceland is not in the Arctic Circle, strictly speaking. 
Maybe I should've said the Arctic Circle region.

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

2011-09-30 Thread spawgi
http://www.arcticstartup.com/



On Fri, Sep 30, 2011 at 6:09 PM, Kevin Renskers  wrote:

> Ha, yeah I know that Iceland is not in the Arctic Circle, strictly
> speaking. Maybe I should've said the Arctic Circle region.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/django-users/-/oe7TEqSVgMkJ.
>
> 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://spawgi.wordpress.com
We can do it and do it better.

-- 
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: Looking for a job in the Arctic Circle

2011-09-30 Thread Kevin Renskers
CCP actually wanted me for their UI Programmer position. Did the first round 
of interviews, made a usability report for them, all was well. And then they 
decided that they don't really need a UI Programmer after all :(

Their other positions are not really a great match for me, sadly. Too much 
C++, DirectX, GPU stuff, etc.

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

2011-09-30 Thread Kevin Renskers
Awesome, thanks!

On Friday, September 30, 2011 2:44:45 PM UTC+2, Sumod wrote:
>
> http://www.arcticstartup.com/
>
>
>
> On Fri, Sep 30, 2011 at 6:09 PM, Kevin Renskers  wrote:
>
>> Ha, yeah I know that Iceland is not in the Arctic Circle, strictly 
>> speaking. Maybe I should've said the Arctic Circle region. 
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Django users" group.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msg/django-users/-/oe7TEqSVgMkJ.
>>
>> To post to this group, send email to django...@googlegroups.com.
>> To unsubscribe from this group, send email to 
>> django-users...@googlegroups.com.
>> For more options, visit this group at 
>> http://groups.google.com/group/django-users?hl=en.
>>
>
>
>
> -- 
> http://spawgi.wordpress.com
> We can do it and do it better.
>  

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

2011-09-30 Thread spawgi
Have you checked hdmessaging.com?

On Fri, Sep 30, 2011 at 6:17 PM, Kevin Renskers  wrote:

> CCP actually wanted me for their UI Programmer position. Did the first
> round of interviews, made a usability report for them, all was well. And
> then they decided that they don't really need a UI Programmer after all :(
>
> Their other positions are not really a great match for me, sadly. Too much
> C++, DirectX, GPU stuff, etc.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/django-users/-/1PqrbM7SjkoJ.
>
> 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://spawgi.wordpress.com
We can do it and do it better.

-- 
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: Looking for a job in the Arctic Circle

2011-09-30 Thread Yves S. Garret
Whatever, their loss :-)

On Fri, Sep 30, 2011 at 8:47 AM, Kevin Renskers  wrote:

> CCP actually wanted me for their UI Programmer position. Did the first
> round of interviews, made a usability report for them, all was well. And
> then they decided that they don't really need a UI Programmer after all :(
>
> Their other positions are not really a great match for me, sadly. Too much
> C++, DirectX, GPU stuff, etc.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/django-users/-/1PqrbM7SjkoJ.
>
> 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: Looking for a job in the Arctic Circle

2011-09-30 Thread Cal Leeming [Simplicity Media Ltd]
Hmm - CCP would have been a very good company to get in with :/

I'm surprised you have not found any other decent positions in Nederland
tbh.

BoxedIce (owners of ServerDensity) are always on the look out for new
developers, they offer remote working, and they already have staff in
Nederland.

Hope this helps.

Cal

On Fri, Sep 30, 2011 at 1:47 PM, Kevin Renskers  wrote:

> CCP actually wanted me for their UI Programmer position. Did the first
> round of interviews, made a usability report for them, all was well. And
> then they decided that they don't really need a UI Programmer after all :(
>
> Their other positions are not really a great match for me, sadly. Too much
> C++, DirectX, GPU stuff, etc.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/django-users/-/1PqrbM7SjkoJ.
>
> 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: Looking for a job in the Arctic Circle

2011-09-30 Thread Cal Leeming [Simplicity Media Ltd]
Here you go:

http://blog.boxedice.com/2011/05/25/were-hiring-sysadmin-devops/
*
*
http://blog.boxedice.com/2011/08/12/were-hiring-engineering-and-design/

Contact David at he...@boxedice.com for more info.

Cal

On Fri, Sep 30, 2011 at 1:51 PM, Cal Leeming [Simplicity Media Ltd] <
cal.leem...@simplicitymedialtd.co.uk> wrote:

> Hmm - CCP would have been a very good company to get in with :/
>
> I'm surprised you have not found any other decent positions in Nederland
> tbh.
>
> BoxedIce (owners of ServerDensity) are always on the look out for new
> developers, they offer remote working, and they already have staff in
> Nederland.
>
> Hope this helps.
>
> Cal
>
>
> On Fri, Sep 30, 2011 at 1:47 PM, Kevin Renskers  wrote:
>
>> CCP actually wanted me for their UI Programmer position. Did the first
>> round of interviews, made a usability report for them, all was well. And
>> then they decided that they don't really need a UI Programmer after all :(
>>
>> Their other positions are not really a great match for me, sadly. Too much
>> C++, DirectX, GPU stuff, etc.
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msg/django-users/-/1PqrbM7SjkoJ.
>>
>> 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: Looking for a job in the Arctic Circle

2011-09-30 Thread Kevin Renskers
Finding a position in The Netherlands would be SUPER easy. The problem is 
that I want to immigrate to another country :) Remote working from The 
Netherlands is not what I am looking for.


On Friday, September 30, 2011 2:51:28 PM UTC+2, SleepyCal wrote:
>
> Hmm - CCP would have been a very good company to get in with :/
>
> I'm surprised you have not found any other decent positions in Nederland 
> tbh. 
>
> BoxedIce (owners of ServerDensity) are always on the look out for new 
> developers, they offer remote working, and they already have staff in 
> Nederland.
>
> Hope this helps.
>
> Cal
>
> On Fri, Sep 30, 2011 at 1:47 PM, Kevin Renskers  wrote:
>
>> CCP actually wanted me for their UI Programmer position. Did the first 
>> round of interviews, made a usability report for them, all was well. And 
>> then they decided that they don't really need a UI Programmer after all :(
>>
>> Their other positions are not really a great match for me, sadly. Too much 
>> C++, DirectX, GPU stuff, etc.
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Django users" group.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msg/django-users/-/1PqrbM7SjkoJ.
>>
>> To post to this group, send email to django...@googlegroups.com.
>> To unsubscribe from this group, send email to 
>> django-users...@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 view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/_OtQN-CLLLEJ.
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: Looking for a job in the Arctic Circle

2011-09-30 Thread Thomas Weholt
Ok, this is of-topic, but why immigrate from The Netherlands and why
for the Love of All that's Holy would you move to the coldest place on
earth? I live in Norway and just don't understand this. And sorry, I
am aware this is not django related.

Thomas

On Fri, Sep 30, 2011 at 2:55 PM, Kevin Renskers  wrote:
> Finding a position in The Netherlands would be SUPER easy. The problem is
> that I want to immigrate to another country :) Remote working from The
> Netherlands is not what I am looking for.
>
>
> On Friday, September 30, 2011 2:51:28 PM UTC+2, SleepyCal wrote:
>>
>> Hmm - CCP would have been a very good company to get in with :/
>> I'm surprised you have not found any other decent positions in Nederland
>> tbh.
>> BoxedIce (owners of ServerDensity) are always on the look out for new
>> developers, they offer remote working, and they already have staff in
>> Nederland.
>> Hope this helps.
>> Cal
>>
>> On Fri, Sep 30, 2011 at 1:47 PM, Kevin Renskers  wrote:
>>>
>>> CCP actually wanted me for their UI Programmer position. Did the first
>>> round of interviews, made a usability report for them, all was well. And
>>> then they decided that they don't really need a UI Programmer after all :(
>>> Their other positions are not really a great match for me, sadly. Too
>>> much C++, DirectX, GPU stuff, etc.
>>>
>>> --
>>> You received this message because you are subscribed to the Google Groups
>>> "Django users" group.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msg/django-users/-/1PqrbM7SjkoJ.
>>> To post to this group, send email to django...@googlegroups.com.
>>> To unsubscribe from this group, send email to
>>> django-users...@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 view this discussion on the web visit
> https://groups.google.com/d/msg/django-users/-/_OtQN-CLLLEJ.
> 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.
>



-- 
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: Define Meta attributes at runtime

2011-09-30 Thread John
I don't believe you'd be able to do this without altering the code for
the framework itself; the Django model metaclass hides the Meta
attribute (among other things) for non-abstract-base classes.

On Sep 30, 6:45 am, Isaac  wrote:
> Hi folks,
>
> I'm wondering if it's possible to set / redefine Meta attributes of a
> given model at runtime.
>
> The problem arises because I'm using a framework with many classes
> defined there, and interacting in a right way. I need to redefine some
> of Meta attributes of that class, but without overriding framework file,
> because it can cause many trouble in any update.
>
> Anyone know how I can access them?
>
> To set an example:
>
> folder1
>      __init__.py
>      models.py
>
> from folder1.models import ModelTrouble
>
> ModelTrouble.Meta.verbose_name = "my_verbose_name"
>
> Thanks in advance
> Isaac

-- 
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: Looking for a job in the Arctic Circle

2011-09-30 Thread Kevin Renskers
I don't think many people will ever understand why I'd want to move to the 
Arctic region. But, I really don't understand how many people would like to 
live in Spain, France or Italy. Me, I like long, cold winters with lots of 
snow. I don't like hot summers. I'm just weird I guess :)

Reykjavik and Tromsø are not that cold by the way. Reykjavik has an average 
low of minus 3 in january, Tromsø minus 7.

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

2011-09-30 Thread Luis Morales
wouldn't a template tag work best in a case like this?

something like {% NavBar %} or {% GetNav NavName %}

that way you can have your own cache code inside you template tag
code, like storing the database result into memcached or redis and
avoid a relational db call each page. them you you modify you
navigation data model you can you invalidate the cache and recreate
it. it will also be a lot simplier to reuse in other projects as you
wont have to inlcude a decorator on each view.

On Sep 30, 2:59 am, Victor Hooi  wrote:
> Hi,
>
> We have a common navigation bar on nearly every page (view) that contains a
> dropdown - this dropdown is populated with items from a database table. This
> dropdown also has AJAX behaviour attached to it.
>
> I'm thinking I can create a decorator that will retrieve the list from the
> database, and return a Python list
>
> We can then wrap every single view in this decorator, and then pass the list
> to the template for rendering.
>
> Firstly - is there a more elegant alternative, rather than wrapping every
> single view in this decorator? (Middleware? Or is that a poor fit here?
> Anything else?).
>
> And secondly - are there are any performance issues here? We're making
> database calls with every single view, just to get a list for a navigation
> dropdown. Smarter way?
>
> I know I can use the caching middleware to cache entire pages, or even
> template fragments - but how about caching a single list() like this? What
> are other methods people are using to tackle this?
>
> Cheers,
> Victor

-- 
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: set_test_cookie() on every page?

2011-09-30 Thread John
While this is not directly your question, if you want to do something
on literally every view, the easiest way to do it would most likely be
to add a custom middleware with a process_request or process_response
method.

More to the point, you should not call set_test_cookie on every view -
in the example on the Django docs, the view calls set_test_cookie()
then checks for success only if the request method is POST, and if it
worked, the logic is short-circuited by a return.  So effectively, the
workflow for that page goes like this:

-user requests login page with method GET
-set_test_cookie is called on view
-user receives page and Set-Cookie header
-user logs in, sending form data with POST
-view sees user requesting with POST and checks for existence of
cookie
-if it fails, it tells the user to enable cookies.
-otherwise, user is logged in (and the cookie should have been
deleted, but it's not a major problem)

As the user should request the page normally (a GET) before they log
in (a POST), you should be able to detect whether they have cookies
enabled.  There is a weakness in this logic - if the user POSTs
directly to the page, they may not have the test cookie set, but even
if you call set_test_cookie on every view, this won't close that.


On Sep 29, 8:49 pm, Victor Hooi  wrote:
> Hi,
>
> I've read the Django docs on setting test cookies
> (https://docs.djangoproject.com/en/dev/topics/http/sessions/#setting-t...),
> and I'm still a bit confused.
>
> One of our views sets a session variable to remember the object a user is
> currently viewing (we figured it wasn't worth storing in the database for
> this).
>
> Should I put set_test_cookie() on every view? That seems a bit
> silly/redundant.
>
> However, if I only put it on the view that sets the session variable,
> doesn't that mean the user has to visit that page twice - once to set the
> cookie, and (since the if test will fail that first time) again to verify it
> was set? How will the user even know to do that?
>
> Do people actually check for the test cookie these days, or do they just
> assume it's set?
>
> But then if we call delete_test_cookie(), doesn't that mean we have to set
> it all over again if the user needs to sets thesession variable again? Or
> should we not call delete_test_cookie()
>
> Cheers,
> Victor

-- 
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: [Admin] Form Fields Rendering Completely Incorrectly

2011-09-30 Thread Nikhil Somaru
Much obliged, thank you.

On Fri, Sep 30, 2011 at 4:35 PM, Ilian Iliev  wrote:

> As stated in dcumentation:
> https://docs.djangoproject.com/en/dev/ref/models/fields/#textfield
>
> A large text field. The admin represents this as a  (a
> multi-line input).
> You should use CharField instead of TextField
>
> --
> eng. Ilian Iliev
> Web Software Developer
>
> Mobile: +359 88 66 08 400
> Website: http://ilian.i-n-i.org
>
>
> On Fri, Sep 30, 2011 at 2:01 PM, Nikhil Somaru  wrote:
>
>> Hi All,
>>
>> Django Version: 1.3
>> OS: Mac OS X Lion
>> Browsers: Chrome, Safari, FF
>> Other: Virtualenv
>>
>> The models are only registered with admin, there are no ModelAdminclasses. 
>> For some reason, all
>> TextField's on all models (even those with really small max_length's)
>> render as textarea, even those which have the parameter choices passed to
>> them (they should be a drop-down box). The class being applied to them is
>> vLargeTextField.
>>
>> This is a brand-new Django project, there is no custom css/html and the
>> devserver is returning 200 (OK) for all requests.
>>
>> Your help is appreciated.
>> --
>> Yours,
>> Nikhil Somaru
>>
>>  --
>> 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.
>



-- 
Yours,
Nikhil Somaru

-- 
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: Looking for a job in the Arctic Circle

2011-09-30 Thread Yves S. Garret
You got your reasons.  That's alright.

Have you looked into Greenland?  How about doing a self-employed gig where
you do coding for other based on contracts and orders?

On Fri, Sep 30, 2011 at 9:27 AM, Kevin Renskers  wrote:

> I don't think many people will ever understand why I'd want to move to the
> Arctic region. But, I really don't understand how many people would like to
> live in Spain, France or Italy. Me, I like long, cold winters with lots of
> snow. I don't like hot summers. I'm just weird I guess :)
>
> Reykjavik and Tromsø are not that cold by the way. Reykjavik has an average
> low of minus 3 in january, Tromsø minus 7.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/django-users/-/I00h3_up_a8J.
>
> 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: Get latest item by many items in a queryset

2011-09-30 Thread Dmitry Kuznetsov
Something like this?

backends = [backend1,backend2,backend3]
latest_status = Status.objects.filter(backend__in=backends).latest()

Regards,
Dmitry

On Sep 29, 7:36 pm, Colin  wrote:
> Hi Users,
>
> So I have a DB that has a list of backends and there properties and I
> have a table that gets updated with if it is able to access and the
> status. It is only updated when it is reported down or, if it was
> reported down and is currenly back up.
>
> What i want to do is make a queryset that will get only the latest
> status for a list of backends.
>
> #models.py
>
> class Backend(models.Model):
>         src_host = models.CharField(max_length=255)
>         ip = models.CharField(max_length=45)
>         port = models.CharField(max_length=8)
>         endpoint_name = models.CharField(max_length=255)
>         service_prop_name = models.CharField(max_length=255)
>         endpoint_url = models.CharField(max_length=255)
>
> class Status(models.Model):
>         backend = models.ForeignKey(Backend)
>         timestamp = models.DateTimeField()
>         status = models.CharField(max_length=255)
>
>         class Meta():
>                 get_latest_by = 'timestamp'
>
> What I would like to do is get the latest status reported for the last
> ten minutes. Without having to loop through a list querysets and
> performing the .latest() function on it.
>
> Is this possible?
>
> Thanks,
>
> Colin

-- 
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: Get latest item by many items in a queryset

2011-09-30 Thread John
I believe that there is no real way for you to avoid having to perform
a query for each backend instance.  Even in raw SQL, I don't think
there is a way to do what you want - in postgres, for example, you
could not both order by the timestamp and get distinct values based on
backend.

However, there is an alternative solution - you can make one query and
request all statuses from the past 10 minutes, then manually find the
most recent statuses per backend.  For instance:

from datetime import datetime, timedelta

backends = Backend.objects.all()
statuses = Status.objects.filter(timestamp__gt=(datetime.now()-
timedelta(minutes=10))).order_by(timestamp).only('backend')

mapping = {}

for st in statuses:
mapping[st.backend_id] = st

print 'The following have had no status update in the past 10 minutes:
'
print '\n'.join(map(str, filter(lambda x:(x.id not in mapping),
backends)))

Depending on how many status updates you make per 10 minute period on
each backend, this could have very low (or very high) overhead on
database IO and webserver CPU usage.

On Sep 29, 7:36 pm, Colin  wrote:
> Hi Users,
>
> So I have a DB that has a list of backends and there properties and I
> have a table that gets updated with if it is able to access and the
> status. It is only updated when it is reported down or, if it was
> reported down and is currenly back up.
>
> What i want to do is make a queryset that will get only the latest
> status for a list of backends.
>
> #models.py
>
> class Backend(models.Model):
>         src_host = models.CharField(max_length=255)
>         ip = models.CharField(max_length=45)
>         port = models.CharField(max_length=8)
>         endpoint_name = models.CharField(max_length=255)
>         service_prop_name = models.CharField(max_length=255)
>         endpoint_url = models.CharField(max_length=255)
>
> class Status(models.Model):
>         backend = models.ForeignKey(Backend)
>         timestamp = models.DateTimeField()
>         status = models.CharField(max_length=255)
>
>         class Meta():
>                 get_latest_by = 'timestamp'
>
> What I would like to do is get the latest status reported for the last
> ten minutes. Without having to loop through a list querysets and
> performing the .latest() function on it.
>
> Is this possible?
>
> Thanks,
>
> Colin

-- 
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: Get latest item by many items in a queryset

2011-09-30 Thread John
That would still return a single value - the status update with the
latest timestamp with one of those backends.

On Sep 30, 9:47 am, Dmitry Kuznetsov  wrote:
> Something like this?
>
> backends = [backend1,backend2,backend3]
> latest_status = Status.objects.filter(backend__in=backends).latest()
>
> Regards,
> Dmitry
>
> On Sep 29, 7:36 pm, Colin  wrote:
>
>
>
>
>
>
>
> > Hi Users,
>
> > So I have a DB that has a list of backends and there properties and I
> > have a table that gets updated with if it is able to access and the
> > status. It is only updated when it is reported down or, if it was
> > reported down and is currenly back up.
>
> > What i want to do is make a queryset that will get only the latest
> > status for a list of backends.
>
> > #models.py
>
> > class Backend(models.Model):
> >         src_host = models.CharField(max_length=255)
> >         ip = models.CharField(max_length=45)
> >         port = models.CharField(max_length=8)
> >         endpoint_name = models.CharField(max_length=255)
> >         service_prop_name = models.CharField(max_length=255)
> >         endpoint_url = models.CharField(max_length=255)
>
> > class Status(models.Model):
> >         backend = models.ForeignKey(Backend)
> >         timestamp = models.DateTimeField()
> >         status = models.CharField(max_length=255)
>
> >         class Meta():
> >                 get_latest_by = 'timestamp'
>
> > What I would like to do is get the latest status reported for the last
> > ten minutes. Without having to loop through a list querysets and
> > performing the .latest() function on it.
>
> > Is this possible?
>
> > Thanks,
>
> > Colin

-- 
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: Get latest item by many items in a queryset

2011-09-30 Thread Tom Evans
On Fri, Sep 30, 2011 at 2:48 PM, John  wrote:
> I believe that there is no real way for you to avoid having to perform
> a query for each backend instance.  Even in raw SQL, I don't think
> there is a way to do what you want - in postgres, for example, you
> could not both order by the timestamp and get distinct values based on
> backend.
>

Sure you can:

SELECT backend.*, s1.*
FROM backend
INNER JOIN status s1
ON backend.id = s1.backend_id
LEFT JOIN status s2
ON s1.backend_id = s2.backend_id AND s2.timestamp > s1.timestamp
WHERE backend.id IN (1,2,3,4)
AND s2.id IS NULL

That will extract all the backend info and the status info for the
most recent timestamp in a single tuple. The trick is joining to the
status table twice and excluding all rows that have smaller
timestamps.

Remember that SQL is really very powerful, much more powerful than is
exposed by the ORM.


Cheers

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.



Re: Get latest item by many items in a queryset

2011-09-30 Thread Colin
Thanks for the info guys!

Is there any changes I could make to my model? Right now I have about
165k backends and a huge number of statuses. But they are small if you
only grab the last 10 or so minutes of statuses.

On Sep 30, 10:43 am, Tom Evans  wrote:
> On Fri, Sep 30, 2011 at 2:48 PM, John  wrote:
> > I believe that there is no real way for you to avoid having to perform
> > a query for each backend instance.  Even in raw SQL, I don't think
> > there is a way to do what you want - in postgres, for example, you
> > could not both order by the timestamp and get distinct values based on
> > backend.
>
> Sure you can:
>
> SELECT backend.*, s1.*
> FROM backend
> INNER JOIN status s1
> ON backend.id = s1.backend_id
> LEFT JOIN status s2
> ON s1.backend_id = s2.backend_id AND s2.timestamp > s1.timestamp
> WHERE backend.id IN (1,2,3,4)
> AND s2.id IS NULL
>
> That will extract all the backend info and the status info for the
> most recent timestamp in a single tuple. The trick is joining to the
> status table twice and excluding all rows that have smaller
> timestamps.
>
> Remember that SQL is really very powerful, much more powerful than is
> exposed by the ORM.
>
> Cheers
>
> 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.



Re: CSRF with AJAX problem

2011-09-30 Thread Kenneth Love
You're using AJAX and forms incorrectly, then. Any form that has a
solid effect on your database (creating, replacing, or deleting data)
should be POSTed and should have CSRF token.

Look into pydanny's django-uni-form project (http://readthedocs.org/
docs/dango-uni-form/en/latest/) for creating your forms. It'll create
the CSRF token for you if you set the form method to POST (again, as
it should be). Then, in your AJAX function that submits the form,
submit the key & value of the CSRF token field to the endpoint. Now
you have AJAX forms that are still safe and sane.

On Sep 29, 5:15 pm, galgal  wrote:
> Yes, but that JavaScript code is useless until {% csrf_token %} or get_token
> is used. I don't use POST forms - only AJAX forms so I don't have that
> cookie made after page load.

-- 
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 1.3] django.views.generic.TemplateView example

2011-09-30 Thread Micky Hulse
Code:



When using the new class-based generic views, is there a faster way
for me to pass URL params to the template?

Thanks!
Micky

-- 
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: Get latest item by many items in a queryset

2011-09-30 Thread Colin
Hmm this may work for me. if I add the time range to the latest_status
it is close to what I want! Thanks a bunch

On Sep 30, 9:47 am, Dmitry Kuznetsov  wrote:
> Something like this?
>
> backends = [backend1,backend2,backend3]
> latest_status = Status.objects.filter(backend__in=backends).latest()
>
> Regards,
> Dmitry
>
> On Sep 29, 7:36 pm, Colin  wrote:
>
>
>
>
>
>
>
> > Hi Users,
>
> > So I have a DB that has a list of backends and there properties and I
> > have a table that gets updated with if it is able to access and the
> > status. It is only updated when it is reported down or, if it was
> > reported down and is currenly back up.
>
> > What i want to do is make a queryset that will get only the latest
> > status for a list of backends.
>
> > #models.py
>
> > class Backend(models.Model):
> >         src_host = models.CharField(max_length=255)
> >         ip = models.CharField(max_length=45)
> >         port = models.CharField(max_length=8)
> >         endpoint_name = models.CharField(max_length=255)
> >         service_prop_name = models.CharField(max_length=255)
> >         endpoint_url = models.CharField(max_length=255)
>
> > class Status(models.Model):
> >         backend = models.ForeignKey(Backend)
> >         timestamp = models.DateTimeField()
> >         status = models.CharField(max_length=255)
>
> >         class Meta():
> >                 get_latest_by = 'timestamp'
>
> > What I would like to do is get the latest status reported for the last
> > ten minutes. Without having to loop through a list querysets and
> > performing the .latest() function on it.
>
> > Is this possible?
>
> > Thanks,
>
> > Colin

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



"Unidentified Errors" message instead of ValidationError

2011-09-30 Thread Ted Gruenloh


Hey there.

OK, trying to add a clean method to a ModelForm in Django.  I'm adding a simple 
raise statement just to see if it works, and instead of my message, I get 
"Unidentified Errors.  Please notify..."

Here's my (simple) test:


class ConfigurationForm(forms.ModelForm):
    ...

    def clean(self):
        cleaned_data =self.cleaned_data
        typeid=cleaned_data.get("typeid")
        value =cleaned_data.get("value") 

        if value and typeid:
           raiseforms.ValidationError("this is the error")


I couldn't even find a reference to "Unidentified Errors" anywhere in the 
django code base.  Thanks in advance for your help. 

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



Re: CSRF with AJAX problem

2011-09-30 Thread Yaşar Arabacı
To create csrf cookie without using csrf tag, your view needs to be
decorated with django.views.decorators.csrf.ensure_csrf_cookie. Also check:
https://code.djangoproject.com/ticket/16936

2011/9/30 Kenneth Love 

> You're using AJAX and forms incorrectly, then. Any form that has a
> solid effect on your database (creating, replacing, or deleting data)
> should be POSTed and should have CSRF token.
>
> Look into pydanny's django-uni-form project (http://readthedocs.org/
> docs/dango-uni-form/en/latest/) for creating your forms. It'll create
> the CSRF token for you if you set the form method to POST (again, as
> it should be). Then, in your AJAX function that submits the form,
> submit the key & value of the CSRF token field to the endpoint. Now
> you have AJAX forms that are still safe and sane.
>
> On Sep 29, 5:15 pm, galgal  wrote:
> > Yes, but that JavaScript code is useless until {% csrf_token %} or
> get_token
> > is used. I don't use POST forms - only AJAX forms so I don't have that
> > cookie made after page load.
>
> --
> 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://yasar.serveblog.net/

-- 
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 Forms: Radio buttons and label displayed in the same line?

2011-09-30 Thread voss
Hello all,

Is it possible to display radio buttons and label in the same line using 
Django forms? Below is an example:

_Choices = (
(1,'A'),
(2,'B'),
(3,'C'),
)

class QuestionForm(forms.Form):
question  = forms.ChoiceField(label='Please choose one!', 
choices=_Choices, widget=forms.RadioSelect())

How to display "Please choose one!",  A, B, and C all on the same line?

Thank you!

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/97uo1h7c90IJ.
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 Forms: Radio buttons and label displayed in the same line?

2011-09-30 Thread Ilian Iliev
Hi, you can do it with CSS styling, custom widget or custom HTML.
Check this link for the custom HTML approach -
http://ilian.i-n-i.org/django-forms-choicefield-and-custom-html-output/
This is not the best one but if you need it only for a single place go for
it.

-- 
eng. Ilian Iliev
Web Software Developer

Mobile: +359 88 66 08 400
Website: http://ilian.i-n-i.org

On Fri, Sep 30, 2011 at 11:03 PM, voss  wrote:

> Hello all,
>
> Is it possible to display radio buttons and label in the same line using
> Django forms? Below is an example:
>
> _Choices = (
> (1,'A'),
> (2,'B'),
> (3,'C'),
> )
>
> class QuestionForm(forms.Form):
> question  = forms.ChoiceField(label='Please choose one!',
> choices=_Choices, widget=forms.RadioSelect())
>
> How to display "Please choose one!",  A, B, and C all on the same line?
>
> Thank you!
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/django-users/-/97uo1h7c90IJ.
> 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: Django Forms: Radio buttons and label displayed in the same line?

2011-09-30 Thread voss
Thanks, eng. Ilian Iliev. I will definitely take a look!


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

2011-09-30 Thread serek
I understand you quite well.
>From the same reason I have moved to Copenhagen.
Not so cold as I expected, but nice.

If you do not find anything in Reykjavik or Tromsø you can try
http://www.xstream.dk/company/jobs
It is rather PHP job(if we get more python people I hope we switch;)
Just send CV do not bother if there is open position.

Good luck



On Sep 30, 3:27 pm, Kevin Renskers  wrote:
> I don't think many people will ever understand why I'd want to move to the
> Arctic region. But, I really don't understand how many people would like to
> live in Spain, France or Italy. Me, I like long, cold winters with lots of
> snow. I don't like hot summers. I'm just weird I guess :)
>
> Reykjavik and Tromsø are not that cold by the way. Reykjavik has an average
> low of minus 3 in january, Tromsø minus 7.

-- 
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: Looking for a job in the Arctic Circle

2011-09-30 Thread Brett Epps
Might be too warm or too far south for you, but consider Wisconsin.  We get 
plenty of snow here.

Brett

From: Kevin Renskers mailto:i...@bolhoed.net>>
Reply-To: mailto:django-users@googlegroups.com>>
Date: Fri, 30 Sep 2011 06:27:30 -0700
To: mailto:django-users@googlegroups.com>>
Cc: <2...@weholt.org>
Subject: Re: Looking for a job in the Arctic Circle

I don't think many people will ever understand why I'd want to move to the 
Arctic region. But, I really don't understand how many people would like to 
live in Spain, France or Italy. Me, I like long, cold winters with lots of 
snow. I don't like hot summers. I'm just weird I guess :)

Reykjavik and Tromsø are not that cold by the way. Reykjavik has an average low 
of minus 3 in january, Tromsø minus 7.

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

2011-09-30 Thread andres . osinski
You can also go to the (literal) polar extreme and consider something in 
Antarctica or Tierra del Fuego, in Chile or Argentina. There are many countries 
that need qualified technical staff for their research/military bases in 
Antarctica. As for Chile and Argentina, both require highly qualified staff, 
immigration is dead easy, and the quality of life in the southernmos extremes 
is actually very high, and slighty cheaper than Europe.
Enviado desde mi BlackBerry de Movistar (http://www.movistar.com.ar) 

-Original Message-
From: Brett Epps 
Sender: django-users@googlegroups.com
Date: Fri, 30 Sep 2011 20:39:42 
To: django-users@googlegroups.com
Reply-To: django-users@googlegroups.com
Cc: 2...@weholt.org<2...@weholt.org>
Subject: Re: Looking for a job in the Arctic Circle

Might be too warm or too far south for you, but consider Wisconsin.  We get 
plenty of snow here.

Brett

From: Kevin Renskers mailto:i...@bolhoed.net>>
Reply-To: mailto:django-users@googlegroups.com>>
Date: Fri, 30 Sep 2011 06:27:30 -0700
To: mailto:django-users@googlegroups.com>>
Cc: <2...@weholt.org>
Subject: Re: Looking for a job in the Arctic Circle

I don't think many people will ever understand why I'd want to move to the 
Arctic region. But, I really don't understand how many people would like to 
live in Spain, France or Italy. Me, I like long, cold winters with lots of 
snow. I don't like hot summers. I'm just weird I guess :)

Reykjavik and Tromsø are not that cold by the way. Reykjavik has an average low 
of minus 3 in january, Tromsø minus 7.

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

2011-09-30 Thread Kevin Renskers
Thanks for the suggestion, but the US is not really an option, social- and 
economic security wise and also the distance back to the Netherlands. I'd 
like to be able to afford a flight back to friends and family more then once 
or twice a year :)

Pretty much the same goes for Chile or Argentina. It's just too far away, 
and a bit too extreme a change for me.

Also, I'm happy to report that I got two serious job offers by mail, both 
for Python/Javascript jobs in Reykjavik. Starting my own company up north, 
as someone suggested, is definitely plan b. I would prefer a stable income 
though, so I hope these jobs turn out to be good options.

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

2011-09-30 Thread Cal Leeming [Simplicity Media Ltd]
Swap lifes with me in the UK - seriously, I'd give anything to live in
Nederland - you are so lucky!

On Fri, Sep 30, 2011 at 10:04 PM, Kevin Renskers  wrote:

> Thanks for the suggestion, but the US is not really an option, social- and
> economic security wise and also the distance back to the Netherlands. I'd
> like to be able to afford a flight back to friends and family more then once
> or twice a year :)
>
> Pretty much the same goes for Chile or Argentina. It's just too far away,
> and a bit too extreme a change for me.
>
> Also, I'm happy to report that I got two serious job offers by mail, both
> for Python/Javascript jobs in Reykjavik. Starting my own company up north,
> as someone suggested, is definitely plan b. I would prefer a stable income
> though, so I hope these jobs turn out to be good options.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/django-users/-/RcVmZb98Pg0J.
>
> 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: set_test_cookie() on every page?

2011-09-30 Thread Victor Hooi
heya,

John - thanks for the reply.

In this case, it's an JQuery .post() call linked to a dropdown menu 
(https://groups.google.com/d/topic/django-users/tw0lM-QkdGw/discussion).

The dropdown is a common navigation element on every page. It's used to set 
a session variable that stores which object a user is working on at the 
moment (see attached screenshot).

In my webpage:

  $('#dropdown_choice').click(function() {

$.post("/set_conference", {"current_conference": "conference_name"}, 
function(data) {alert(data)});

});


Then in my view:

# TODO: Set test cookies (although if we're logged in, we can assume cookies 
works)

def set_current_conference(request):

if not request.is_ajax() or not request.method == 'POST':

return HttpResponseNotAllowed(['POST'])
request.session['current_conference'] = 
request.POST.get("current_conference")
return HttpResponse('Set current_conference to ' + 
str(request.POST.get("current_conference")))

 
So it seems I would need to put the set_test_cookie() logic on every page, 
since they could make this call from any page with the dropdown. Or is there 
another way?

How would people normally handle having an AJAX POST call like this to set a 
session variable?

Or should I just (dangerously) assume that cookies will work automatically? 
Alternative?

Cheers,
Victor

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

2011-09-30 Thread Victor Hooi
heya,

I do like the idea of just including a custom template tag =).

Hmm, can custom template tags interact with models or query the database 
like that?

Firstly, Is it possible, and secondly, is it considered good practice? 

Cheers,
Victor

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/ScSr2-kGquYJ.
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 Forms: Radio buttons and label displayed in the same line?

2011-09-30 Thread voss

Hi eng. Ilian Iliev,

I visited your page 
(http://ilian.i-n-i.org/django-forms-choicefield-and-custom-html-output/) and 
now my code works!


After visiting the page, though, I realized that I'd asked a stupid 
question. What I ended up doing is that I started a Python interactive 
interpreter, printed the form as HTML, copied and pasted it to the 
template , and did some CSS styling as you suggested. It is now working 
with my original views.


Once again, thank you for the great link! It is very helpful!!

cheers,

voss


On 9/30/11 3:13 PM, Ilian Iliev wrote:

Hi, you can do it with CSS styling, custom widget or custom HTML.
Check this link for the custom HTML approach - 
http://ilian.i-n-i.org/django-forms-choicefield-and-custom-html-output/
This is not the best one but if you need it only for a single place go 
for it.


--
eng. Ilian Iliev
Web Software Developer

Mobile: +359 88 66 08 400
Website: http://ilian.i-n-i.org 

On Fri, Sep 30, 2011 at 11:03 PM, voss > wrote:


Hello all,

Is it possible to display radio buttons and label in the same line
using Django forms? Below is an example:

_Choices = (
(1,'A'),
(2,'B'),
(3,'C'),
)

class QuestionForm(forms.Form):
question  = forms.ChoiceField(label='Please choose one!',
choices=_Choices, widget=forms.RadioSelect())

How to display "Please choose one!",  A, B, and C all on the same
line?

Thank you!
-- 
You received this message because you are subscribed to the Google

Groups "Django users" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/django-users/-/97uo1h7c90IJ.
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: How to do something just like in user right assignment ?

2011-09-30 Thread bino oetomo

Dear Sébastien

Thankyou for your enlightment
I really appreciate it

Sincerely
-bino-


On 09/30/2011 03:34 PM, BILLION Sébastien wrote:

Hi,

You must add a ManyToManyField in your models

https://docs.djangoproject.com/en/dev/ref/models/fields/#django.db.models.ManyToManyField 




...

--
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: Wired image file upload problem

2011-09-30 Thread @@
Sorry, it's the size limitation.
Didn't aware the settings.FILE_UPLOAD_MAX_MEMORY_SIZE was changed.

On Thu, Sep 29, 2011 at 5:57 PM, Jian Chang  wrote:

> size limitation?
> it is wired.
> [?]
>
> 2011/9/28 @@ 
>
>> Hi
>> I got a image can't upload while other image works fine, and i use paint
>> open this image and save it as another file, then the other file can be
>> uploaded.
>> The debug page shows the request.FILES is None.
>> The attachment is the image can't upload. Sorry for sending a mail with
>> attachment.
>>
>> Is this problem related to the image exif info?
>> 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.
>

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

<<342.gif>>

How REST Access ?

2011-09-30 Thread bino oetomo

Dear All.

Kindly please give me your enlightment to CRUD Django database using 
HTTP-GET.


For the sake of simplicity, I use basic django example from 
https://docs.djangoproject.com/en/1.2//intro/tutorial02/

I didn't add any fancy things.
My admin.py as simple as :

-START---
from polls.models import Poll, Choice
from django.contrib import admin

admin.site.register(Poll)
admin.site.register(Choice)

-STOP

Currently, I can add records to Poll and Choice from web interface after 
login.


What I have to write so that I can add another Records to "Choice" using 
simple http get , i.e :


http://127.0.0.1:8000/admin/poll/choice/add/?username=bino&password=123&poll=1&choice=iam+trying

I need this because I plan to post Kannel dlr to django, and AFAIK 
kannel do this by using singleshoot of GET so it can not deal with 
default Django Authentication mechanism.


Sincerely
-bino-

--
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 1.3] django.views.generic.TemplateView example

2011-09-30 Thread Russell Keith-Magee
On Saturday, October 1, 2011, Micky Hulse  wrote:
> Code:
>
> 
>
> When using the new class-based generic views, is there a faster way
> for me to pass URL params to the template?

There's no need to subclass TemplateView and provide your own implementation
of get_context_data() - the default TemplateView implementation does exactly
(and I mean character-for-character exactly) what you've defined. So, you
just need to deploy a default TemplateView in your urls.py:

('^foo/(?P\d+)/$',
TemplateView.as_view(template_name='my_template.html'))

Your template should work exactly as-is.

I know the class-based views docs aren't as good as they could be - thats
mostly my fault. I also know that "read the source" isn't a real
documentation answer. However, the CBV code is quite well documented
internally, and isn't all that complex at the end of the day - if you've got
questions about how to do something obscure with CBVs, a quick peruse of the
source is well worth your time.

Yours,
Russ Magee %-)

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