Re: [ANNOUNCE] Django 1.5 alpha 1 released

2012-10-25 Thread Stephen Anto
Hi, Nice to hear thank you so much for all who worked together for coming up new version. On Fri, Oct 26, 2012 at 1:28 AM, James Bennett wrote: > Our first milestone on the road to Django 1.5 came today, with the > release of the first alpha package. > > Blog post about it is here: > > https

Re: Installing Djando and tutor polls app

2012-10-25 Thread Stephen Anto
Hi, as Lachian said, It is spelling mistake for ForeignKey. Just correct your word. On Fri, Oct 26, 2012 at 8:56 AM, Lachlan Musicman wrote: > On Fri, Oct 26, 2012 at 10:39 AM, Rodrigo Morgado > wrote: > > Hi everybody, > > > > I'm new in Django framework. I installed version 1.3.1 over Python

Re: Installing Djando and tutor polls app

2012-10-25 Thread Lachlan Musicman
On Fri, Oct 26, 2012 at 10:39 AM, Rodrigo Morgado wrote: > Hi everybody, > > I'm new in Django framework. I installed version 1.3.1 over Python 2.7.3 in > Ubuntu. > I already did all steps but i have an error when i execute python manage.py > sql polls to create my table's project in mysql. > > Tr

Installing Djando and tutor polls app

2012-10-25 Thread Rodrigo Morgado
Hi everybody, I'm new in Django framework. I installed version 1.3.1 over Python 2.7.3 in Ubuntu. I already did all steps but i have an error when i execute python manage.py sql polls to create my table's project in mysql. Traceback (most recent call last): File "manage.py", line 14, in

How does threading and processes work in Django

2012-10-25 Thread dwang
Hi, I'm new to Django and need some help understanding how threading works in Django. I have some data that I'd like to recompute periodically in the background and have it shared between requests. If I start a thread in one of the view functions (e.g. my_thread.start()), would Django kill this

How can I compare the value of an aggregate with a list of results from a model

2012-10-25 Thread Érico Oliveira
my view: def comprar(request): if request.method == 'POST': form = FormComprar(request.POST) if form.is_valid(): form = form.save() retorno = 'Intenção de compra computada.' form = FormComprar() else: form = FormComprar() total

Intermittent mysql connection errors

2012-10-25 Thread Guy
I'm experiencing an annoying problem with a couple of django apps. Both apps are games built on Django that make regular calls to the db using python-db. We have error emails turned on, and every so often (the interval doesn't seem to follow a pattern but it's usually no more than once in a hal

Re: Modernizing the Tutorial

2012-10-25 Thread Lachlan Musicman
On Fri, Oct 26, 2012 at 1:02 PM, Tomas Neme wrote: >> However, there is also scope for a focussed tutorial about class-based views >> in general. IMHO one of the biggest uptake problems around class-based > > This is what I meant. Something that brings in, easy and clearly, the > concept of mixins

Re: Modernizing the Tutorial

2012-10-25 Thread Tomas Neme
> However, there is also scope for a focussed tutorial about class-based views > in general. IMHO one of the biggest uptake problems around class-based This is what I meant. Something that brings in, easy and clearly, the concept of mixins, the different mixins,something that, for example, take tw

Re: Modernizing the Tutorial

2012-10-25 Thread Russell Keith-Magee
On Thu, Oct 25, 2012 at 9:00 PM, Tomas Neme wrote: > Now that function-based views are being deprecated, or at least that > class-based views are being favored, there should be a tutorial with > them in the docs, shouldn't it? > > I don't mean replacing the current one, because that'd raise the e

create sql functions before tests

2012-10-25 Thread Zoltan Szalai
Hi, Do you have any idea how could I run some custom sql that creates some C functions before tests start to run? django: 1.3.4, postgres 9.1 thx Zoli -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to djang

Re: Documentation helpers in the admindocs (django 1.4)

2012-10-25 Thread Craig Bateman
I think this is a bug in 1.4 that is probably addressed in the dev version. The model docstring is not run through the markdown to HTML routine in the django version I'm using. Was simple enough to patch locally. On Sep 10, 2012 1:58 PM, "craig" wrote: > It could be I'm doing something wrong, but

Re: Modernizing the Tutorial

2012-10-25 Thread Lachlan Musicman
On Fri, Oct 26, 2012 at 2:00 AM, Tomas Neme wrote: > Now that function-based views are being deprecated, or at least that > class-based views are being favored, there should be a tutorial with > them in the docs, shouldn't it? > > I don't mean replacing the current one, because that'd raise the en

[ANNOUNCE] Django 1.5 alpha 1 released

2012-10-25 Thread James Bennett
Our first milestone on the road to Django 1.5 came today, with the release of the first alpha package. Blog post about it is here: https://www.djangoproject.com/weblog/2012/oct/25/15-alpha-1/ Release notes are here: https://docs.djangoproject.com/en/dev/releases/1.5-alpha-1/ And you can get th

should Django groups and permissions be hard-coded or bootstrapped?

2012-10-25 Thread Tony Schmidt
I'm building an app that assumes the existence of certain groups and permissions for its workflow. For example, a "member" can log into the app and view and edit their personal data, but cannot see notes that would typically be displayed on the same screen. An "employee" can see those notes a

Re: pub_date timezone

2012-10-25 Thread Brendan Carroll
Thank Emrah Appreciate your help. Will try that later as I have an online lecture until 2100hrs. Brendan On 25 October 2012 18:10, Emrah Atalay wrote: > Hi again, > > Remove 'date published' string from pub_date=models.DateTimeField > > from django.db import models > > class Poll(models.Model)

Re: pub_date timezone

2012-10-25 Thread Emrah Atalay
Hi again, Remove 'date published' string from pub_date=models.DateTimeField from django.db import models class Poll(models.Model): question = models.CharField(max_length=200) put_date = models.DateTimeField() class Choice(models.Model): poll = models.ForeignKey(Poll) choice = mo

Re: pub_date timezone

2012-10-25 Thread BrendanC
Hi erm I put that line in and still won't work. In my models.py file I have the following: from django.db import models class Poll(models.Model): question = models.CharField(max_length=200) put_date = models.DateTimeField ('date published') class Choice(models.Model): poll = model

Re: pub_date timezone

2012-10-25 Thread BrendanC
Hi erm Went back over your comment and realised what you commented. After python manage.py I gget the python prompt>>> and then typed from polls.models import Poll, Choice then I typed: Poll.objects.all() and got the array brace [] returned. then I typed from django.utils import timezone the

Re: Strange behaviour after pressing on button

2012-10-25 Thread Nikolas Stevenson-Molnar
It looks like you're submitting your request via AJAX and using the X-CSRFToken header. It's very possible that one of your proxies isn't forwarding that header correctly. You might try submitting it as an actual form parameter instead. _Nik On 10/25/2012 6:01 AM, Stone wrote: > Over Firefox and

queryset-didn't show result.

2012-10-25 Thread DjgoNy
I have a project where i have to extract data from database whenever i click on it. It should be shown in a table and it will be shown individually but whenever i use queryset in my view it didn't show anything and when i commented the queryset then it will be shown all the listed data but not i

Re: Documentation helpers in the admindocs (django 1.4)

2012-10-25 Thread Robert Bergs
This looks like it is a known issue. See ticket 5405. On Monday, 10 September 2012 21:57:49 UTC+1, craig wrote: > > It could be I'm doing something wrong, but I have the admin documentation > working, and read about the helpers ( :model:`app.model`,

Re: Date widget not HTML5

2012-10-25 Thread Victor Rocha
You need to roll out your own widget. I assume django will have html5 support in the near future. On Wednesday, October 24, 2012 1:04:07 PM UTC-4, Juan Pablo Tamayo wrote: > > > > Is there any reason not to have the date widget input tag have the > attribute type="date" instead of just type="te

Re: Translation: DjangoUnicodeDecodeError

2012-10-25 Thread Tom Evans
On Thu, Oct 25, 2012 at 2:31 PM, Sandro Dutra wrote: > Hi, I'm having a little problems with translations... > > I've various {% trans "anything" %}, everything is correctly configured, I > do the makemessages and compilemesages with sucess, and everything works > correctly, but I've a problem, wh

Translation: DjangoUnicodeDecodeError

2012-10-25 Thread Sandro Dutra
Hi, I'm having a little problems with translations... I've various {% trans "anything" %}, everything is correctly configured, I do the makemessages and compilemesages with sucess, and everything works correctly, but I've a problem, when I insert special characters in *.po files, I get DjangoUnico

Re: pub_date timezone

2012-10-25 Thread Emrah Atalay
Hi brendan, You have the import class before using, so from polls.models import Poll 2012/10/25 Brendan Carroll > Hi all > I am new to Django and I'm having an issue with some code. I am trying to > get through the first tutorial from the Django site. > I have a file called polls/models.py and

pub_date timezone

2012-10-25 Thread Brendan Carroll
Hi all I am new to Django and I'm having an issue with some code. I am trying to get through the first tutorial from the Django site. I have a file called polls/models.py and have created a class that contains the following code class Poll(models.Model): question = models.CharField(max_lengt

Re: Strange behaviour after pressing on button

2012-10-25 Thread Stone
Over Firefox and Firebug I have received that CSRF Validation failed. My server is running on apache2-2.2.22 and there are two proxy's All template file and forms includes csrf_token tag. On Oct 24, 6:54 pm, Nikolas Stevenson-Molnar wrote: > It's possible that the CSRF token isn't being sent corr

Modernizing the Tutorial

2012-10-25 Thread Tomas Neme
Now that function-based views are being deprecated, or at least that class-based views are being favored, there should be a tutorial with them in the docs, shouldn't it? I don't mean replacing the current one, because that'd raise the entry point a lot, but cloning the original tutorial, but imple

Re: Puzzled about WSGI vs. FastCGI

2012-10-25 Thread Fred
Thanks Nik. I'll experiment. On Thursday, October 25, 2012 12:23:57 AM UTC+2, Nikolas Stevenson-Molnar wrote: > > Correct. I've found proxying to an HTTP WSGI server to be eaisier as you > don't need to configure passing of FastCGI params. I use Gunicorn with > nginx, and it requires very litt

Re: implement of view

2012-10-25 Thread Tomas Neme
>>> How can i create 2 views on one page? >>> def sql(request): and def portal(request): You can't. A View *is* a page. Do the tutorial. You could use class-based views and have a view that inherits from both, and combines the contexts (this is _not_ in the tuto) -- "The whole of Japan is pure i

Re: CachedStaticFilesStorage headache

2012-10-25 Thread florian
ok, just needed to post to find the answer myself! my STATIC_ROOT was "static/" , don't know why i haven't changed it! now, it is os.path.join(ROOT, "static/") and it works perfectly I leave the post in case it would help someone -- You received this message because you are subscribed to the G

Re: implement of view

2012-10-25 Thread Markus Christen
> > How can i create 2 views on one page? >> def sql(request): and def portal(request): >> > -- 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/-/xneUlf_fSGA

CachedStaticFilesStorage headache

2012-10-25 Thread florian
Hi, i try to use CachedStaticFilesStorage and, for now, it only gives me a headache! Whay i've done : 1 - put STATICFILES_STORAGE = 'django.contrib.staticfiles.storage.CachedStaticFilesStorage' in setting 2 - DEBUG = False 3 - add 'staticfiles': { 'BACKEND': 'django.core.cache.back

Re: Reverse for 'app_list' with arguments '()' and keyword arguments '{'app_label': ''}' not found.

2012-10-25 Thread Nick Doyle
Had the same problem. Seems the top-level problem is with extending the django admin template "change_form.html". It has a tag in there referring to "app_list" which isn't set when we extend. More than that I couldn't fix right now. So worked around it by, for the form, change to extend *base_si

Re: implement of view

2012-10-25 Thread Markus Christen
Hmm ok, i can use return render_to_response("sql.html", { 'row': row }) and when i call now http://127.0.0.1:8000/sql/, i can see the correct data. But i will call http://127.0.0.1:8000/portal/ and try to implements the sql code in this page. I have by base.html in addition now " {% incl

Re: implement of view

2012-10-25 Thread Markus Christen
Ok, when i use now http://127.0.0.1:8000/sql/, the output is Kundendaten [('bla Hansruedi (THA) ', 'hansruedi@blubb.ch ')]. i have in base.html now " {% include "sql.html" %}" in addition. when i use now http://127.0.0.1:8000/portal/, my output is just: Kundendaten . how can i fix this pro

Re: a way to display a model formset in a ModelAdmin ?

2012-10-25 Thread Nicolas Emiliani
> > > Create New adminmodel class and define fieldsets... For example > http://www.f2finterview.com/web/Django/22/ it is clearly explain you > > Hi Stephen, thanks for the reply, but it doesn't solve it since every field specified in the fieldset at the Model admin needs to either exist in Model or

Re: Internationalization: trans with object property

2012-10-25 Thread Tom Evans
On Wed, Oct 24, 2012 at 2:16 PM, Ma Ba wrote: > Hi, > I have a question about the internationalization feature ... > > I have a country model: > > class Country(models.Model): > nameKey = models.CharField(max_length=50) > shortNameKey = models.CharField(max_length=30) > > The properties 'n

Re: Best way to detect if a user has changed password

2012-10-25 Thread Tom Evans
On Wed, Oct 24, 2012 at 10:23 PM, Roarster wrote: > I'm running a Django 1.4 site and I have some operations I want to perform > if a user changes their password. I'm using the standard contrib.auth user > accounts with the normal password_change view and I'm not sure if I should > somehow hook i

Re: Populate database from views

2012-10-25 Thread Coulson Thabo Kgathi
thanks will try that -- 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/-/EQbQ4UGctlsJ. To post to this group, send email to django-users@googlegroups.com. To un

Re: Best way to detect if a user has changed password

2012-10-25 Thread Roarster
Thanks for the answers, that was pretty much what I was expecting. I haven't had a chance to test this yet but do you think it'll be as simple as just comparing the value with the previous value, seeing as the password field is (I assume) a bit different with it storing the hash rather than th

Re: Populate database from views

2012-10-25 Thread Stephen Anto
Hi, if you have data in array list just use this for list in array_list: modelObj = YourModel() modelObj.fieldname = list modelObj.save() I believe it will help you... Thank you for visiting http://www.f2finterview.com/web/Django/ On Thu, Oct 25, 2012 at 3:05 PM, Coulson Thabo Kg

Populate database from views

2012-10-25 Thread Coulson Thabo Kgathi
is it possible to do this? i have data that i recieve into the view from my template and i want to save that data which is in an array in my view to a database anybody help or link to where i can learn a way to do that thanks a lot -- You received this message because you are subscribed to t

Re: a way to display a model formset in a ModelAdmin ?

2012-10-25 Thread Stephen Anto
Hi, Create New adminmodel class and define fieldsets... For example http://www.f2finterview.com/web/Django/22/ it is clearly explain you On Thu, Oct 25, 2012 at 3:51 AM, Nicolas Emiliani wrote: > Hi, > > As the subject states, is there a way to display a model formset in a > ModelForm? > > The

Re: Append only tables/models

2012-10-25 Thread Mike Burr
On Oct 25, 3:44 pm, Christophe Pettus wrote: > On Oct 25, 2012, at 8:26 AM, Mike Burr wrote: > > > I know there are DBMS-specific ways of doing this. I know that there > > are Django ways of making fields read-only. What I cannot find is a > > way to make a table/model append-only. > > You can alw