Re: acces cleaned data from a dynamic form

2012-06-26 Thread het.oosten
Ok when i render {{formset}} in the template everything works fine. When i 
render the form fields seperately, the first field of the "dishes form" is 
missing. This wont be hard to figure out further. Thanks for all the help!

Rob

-- 
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/-/FCYEOz2PZ8sJ.
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: base_url() in django

2012-06-26 Thread Raitucarp


> Is this an actual issue? You realize that there's no difference between 
> /doc/ and http://example.com/doc/ if the current server is 
> http://example.com/? 
>
> See here: 
> https://docs.djangoproject.com/en/1.4/ref/templates/builtins/#url 
>

No no, that's not my issue. {% url %} template tag just create relative url 
that represent the views url. But, what I am going to ask here is create 
absolute url path. I mean in codeigniter I just call base_url() to create 
the base url where I am work. In django, it's hard to do that, just it.

-- 
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/-/cinsOV4C4fMJ.
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: Hey

2012-06-26 Thread kenneth gonsalves
On Mon, 2012-06-25 at 05:01 -0700, bruno desthuilliers wrote:
> > How can I extract data from DB so that I can take that data n send
> it to 
> > templates to display graphs according to DataBase values .
> > How can I write view function for that?
> >
> 
> 
> Everything you need to know is here : https://docs.djangoproject.com 

do they mention how to put a meaningful subject line ;-)
-- 
regards
Kenneth Gonsalves

-- 
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 page doesn't auto-refresh

2012-06-26 Thread ledzgio
Hi,

I have a problemi with the admin page. In my admin page I have 3 fields 
that refers to the same table called Team: when I want to add a new Team by 
pressint the green "+" button, the popoup shows up and I can fill the form 
and adding a new Team. When I click save, the pop up disappears and I have 
the new value close to the "+" button I have pressed upon. But the problem 
is that the other fields that refers to the table Team in the page are 
empty, so I have to refresh the page in order to see the just added Team 
show. 

How can I fix this behavior?

thanks

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

2012-06-26 Thread Sithembewena Lloyd Dube
Hi everyone,

I have a form on which I'm calling save() and if it is successful I would
like to display 'your post has been saved' or similar in the template. How
would one go about that in Django 1.4?

I am sifting through the docs and cannot seem to find a definitive answer.

Thanks in advance.

-- 
Regards,
Sithembewena Lloyd Dube

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



Django & Pyramid Con JP 2012: September 15(Sat)-16(Sun), in Tokyo Japan

2012-06-26 Thread Hiroki Kiyohara
Hi all

I'm glad to announce the dates for Django & Pyramid Con JP 2012.
The conference will be held in Tokyo, Japan from September 15th(Sat) to 
16th(Sun) 2012
at Advanced Institute of Industrial Technology (http://aiit.ac.jp/english/).

The conference will be held next to PyConJP 2012 
(http://2012.pycon.jp/en/), same day.
You can visit Django & Pyramid Con with same ticket for PyCon JP 2012.
About more detail, I will announce you as this group.

thx.

Hiroki Kiyohara

-- 
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/-/eEp3DNgvt-EJ.
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.



am new to the django ,facing problem in searching the database with primary key(student id)

2012-06-26 Thread rick


Reverse for 'add_record.views.search' with arguments '(,)' and keyword arguments '{}' not found.

-- 
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/-/_HT0ni6iu8gJ.
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.4 - how to display a success message on form save

2012-06-26 Thread 罗健忠
you may use HttpResponseRedirect to redirect to another page to display the
successful message

On 26 June 2012 17:48, Sithembewena Lloyd Dube  wrote:

> Hi everyone,
>
> I have a form on which I'm calling save() and if it is successful I would
> like to display 'your post has been saved' or similar in the template. How
> would one go about that in Django 1.4?
>
> I am sifting through the docs and cannot seem to find a definitive answer.
>
> Thanks in advance.
>
> --
> Regards,
> Sithembewena Lloyd Dube
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>

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



PROBLEM: Variable of settings.py imported from the Environment does not change, although it has different values in two different VirtualHosts

2012-06-26 Thread alvaroalo
*Hello everybody,*
*
*
*I would like to ask you how to solve an issue that is actually driving me 
crazy. I have found several threads and workarounds of people who seem to 
have faced a similar problem, but I havent actually found a valid solution 
to my problem. Here it is:*
*
*
*1. I have several VirtualHosts defined in my Apache configuration file. 
Each of these VirtualHosts try to access a GUI which has been designed 
using Python and mod_wsgi. In these Apache configuration files, I have 
defined an Environment Variable which I then use in the wsgi script*


SetEnv MY_VAR my_var_name

...

WSGIScriptAlias /gui "/guipath/django.wsgi"



*2. Googling a bit, I found a guy answering how to actually use Environment 
Variables in the templates. In this sense, it was necessary to set them in 
the WSGI script file. Below is my WSGI file:*


import os
import sys

path = os.path.dirname(os.path.abspath(__file__)) + '/..'
path2 = os.path.dirname(os.path.abspath(__file__))
if path not in sys.path:
sys.path.append(path)
if path2 not in sys.path:
sys.path.append(path2)

os.environ['DJANGO_SETTINGS_MODULE'] = 'gui.settings'

import django.core.handlers.wsgi
_application = django.core.handlers.wsgi.WSGIHandler()

def application(environ, start_response):
  os.environ['VAR_NAME'] = environ['MY_VAR']
  return _application(environ, start_response)


*3. Then, in settings.py, I am actually loading this variable in order to 
be used from the views.py file*
*
*
*
*
VARIABLE = os.environ['VAR_NAME']
*
*
*
*
*4. Finally, I import the settings file in the views file, and I then load 
the value of VARIABLE in each of the views.*
*
*
*
*
*All the process seems to work OK, except for the following problem. *
*
*
*- In my case, each VirtualHost has been configured to have a different IP, 
and a different MY_VAR value, and all these IPs can actually access to the 
GUI. The problem arises when I try to switch from one IP to another. Let us 
assume the case of two different virtual hosts. Let us call them VH1 and 
VH2.*
*- If I type the IP corresponding to the GUI of the first virtual host, I 
receive for the first time*
*
*
*
*
"WELCOME TO THE VH1 GUI"
*
*
*
*
*- Then, I switch to the IP corresponding to the second virtual host. The 
result I receive is then*
*
*
*
*
"WELCOME TO THE VH1 GUI" *
*


*- Now, if I restart Apache, and I reload this second IP, y receive:*
*
*
*
*
"WELCOME TO THE VH2 GUI"  *
*

*- I have checked whether the environment variable assignation was working 
or not, by printing the value in the WSGI script, and the value was 
changing each time I switched from one virtual host to the other. So the 
problems seems to be that settings.py is loaded just once at the beginning, 
and the variables are not refreshed any more.*
*
*
*Could you please tell me a way to solve this problem?? I would be 
extremely grateful*
*
*
*Thank you very very much in advance.*
*
*
*With kind regards,*
*Alvaro*

-- 
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/-/OCw0ix7LUzsJ.
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 with soaplib2.0

2012-06-26 Thread Jeff Silverman
I'm trying to use the soaplib 2.0 web service snippet example and
continue to receive a 405 method not allowed error when trying to
access the method.  I coded the example as is, with the views.py and
urls.py exactly as shown.  I'm new to web services, so I know i've
missed something, but I cannot seem to determine what?

I would sure appreciate any help or understanding of what's missing.

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



language

2012-06-26 Thread armagan
Hi,

I'm trying to write the month name from number. I have done. But month's 
name is English. I want to change the name to Turkish.

*In [35]: m = calendar.month_name[3]*

*In [36]: m*

*Out[36]: 'March'*

Can you help me?

-- 
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/-/63Zm0uSAg0sJ.
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: language

2012-06-26 Thread kenneth gonsalves
On Tue, 2012-06-26 at 04:59 -0700, armagan wrote:
> I'm trying to write the month name from number. I have done. But
> month's 
> name is English. I want to change the name to Turkish. 

this may help you:
https://docs.djangoproject.com/en/dev/topics/i18n/
-- 
regards
Kenneth Gonsalves

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

2012-06-26 Thread Masklinn
On 2012-06-26, at 13:59 , armagan wrote:

> Hi,
> 
> I'm trying to write the month name from number. I have done. But month's 
> name is English. I want to change the name to Turkish.
> 
> *In [35]: m = calendar.month_name[3]*
> 
> *In [36]: m*
> 
> *Out[36]: 'March'*
> 
> Can you help me?

That's got nothing to do with Django, FWIW. If you go see the documentation[0]
it says:

> An array that represents the months of the year in the current locale.

How do you set the current locale?

with locale.setlocale:

> http://docs.python.org/library/locale.html?highlight=locale#locale.setlocale

>>> import calendar, locale
>>> calendar.month_name[1]
'January'
>>> locale.setlocale(locale.LC_TIME, 'fr_fr')
'fr_fr'
>>> calendar.month_name[1]
'janvier'
>>> locale.setlocale(locale.LC_TIME, 'tr_TR')
'tr_TR'
>>> calendar.month_name[1]
'Ocak'

I would, however, recommend against that as setlocale is not
thread-safe. Instead, I'd use Babel[1] as it does not require
altering global state:

>>> import babel.dates
>>> babel.dates.get_month_names()[1]
u'January'
>>> babel.dates.get_month_names(locale='fr_fr')[1]
u'janvier'
>>> babel.dates.get_month_names(locale='tr_TR')[1]
u'Ocak'

[0] 
http://docs.python.org/library/calendar.html?highlight=month_name#calendar.month_name
[1] 
http://babel.edgewall.org/wiki/ApiDocs/babel.dates#babel.dates:get_month_names

-- 
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.4 - how to display a success message on form save

2012-06-26 Thread Jirka Vejrazka
Hi,

  have you checked the messaging framework in Django?

  HTH

Jirka

-- 
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.4 - how to display a success message on form save

2012-06-26 Thread Sithembewena Lloyd Dube
@newkedison, thank you for the suggestion. I wish to stay on the page
without doing any redirects.

@Jirka - thanks. I saw something about the messaging framework and even
tried one example which did not work.

I ended up doing the following (which worked):

In view:
success = default value here
if form.is_valid():
form.errors['success'] = 'Saved'

return self.render_to_response(request, template_name, {
'tomatoes': tomatoes,
'success': success,
})

... and in template:

{{ success }}

Regards.

On Tue, Jun 26, 2012 at 2:20 PM, Jirka Vejrazka wrote:

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


-- 
Regards,
Sithembewena Lloyd Dube

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



Re: Django 1.4 - how to display a success message on form save

2012-06-26 Thread Sithembewena Lloyd Dube
I did do:
#if form.save():
success = form.errors['success']

On Tue, Jun 26, 2012 at 2:35 PM, Sithembewena Lloyd Dube
wrote:

> @newkedison, thank you for the suggestion. I wish to stay on the page
> without doing any redirects.
>
> @Jirka - thanks. I saw something about the messaging framework and even
> tried one example which did not work.
>
> I ended up doing the following (which worked):
>
> In view:
> success = default value here
> if form.is_valid():
> form.errors['success'] = 'Saved'
> 
> return self.render_to_response(request, template_name, {
> 'tomatoes': tomatoes,
> 'success': success,
> })
>
> ... and in template:
>
> {{ success }}
>
> Regards.
>
>
> On Tue, Jun 26, 2012 at 2:20 PM, Jirka Vejrazka 
> wrote:
>
>> Hi,
>>
>>  have you checked the messaging framework in Django?
>>
>>  HTH
>>
>>Jirka
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To post to this group, send email to django-users@googlegroups.com.
>> To unsubscribe from this group, send email to
>> django-users+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/django-users?hl=en.
>>
>>
>
>
> --
> Regards,
> Sithembewena Lloyd Dube
>



-- 
Regards,
Sithembewena Lloyd Dube

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



Re: Django 1.4 - how to display a success message on form save

2012-06-26 Thread Jirka Vejrazka
>> @Jirka - thanks. I saw something about the messaging framework and even
>> tried one example which did not work.

Using the messaging framework is actually very simple.

You need to enable the messaging framework (see the steps here:
https://docs.djangoproject.com/en/1.4/ref/contrib/messages/ )

In your template, you need this (I have that in my base template so
it's included in all pages):

  {% if messages %}
{% for message in messages %}
  {{ message }}
{% endfor %}
  {% endif %}

Obviously, you'll need some formatting/CSS around it.

And in your views.py (or forms.py, ...)

from django.contrib import messages

   if form.is_valid():
 messages.success(request, 'Your form was saved')

And that's it!


   Jirka

-- 
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: am new to the django ,facing problem in searching the database with primary key(student id)

2012-06-26 Thread bruno desthuilliers


On Tuesday, June 26, 2012 8:47:27 AM UTC+2, rick wrote:
>
> Reverse for 'add_record.views.search' with arguments '( Student_login object>,)' and keyword arguments '{}' not found.
>
>
 Your problem is with reverse url resolving, not with "searching the 
database".  

-- 
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/-/Th6Zm4_xiRQJ.
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: ImportError: Settings cannot be imported, because environment variable DJANGO_SETTINGS_MODULE is undefined.

2012-06-26 Thread bruno desthuilliers
Désolé, je ne parle pas espagnol...

On Monday, June 25, 2012 7:49:01 AM UTC+2, totechess wrote:
>
> Tengo el siguiente problema. Con la última actualización de django 1.5 
> supongamos estoy en un directorio x y al hacer django-admin 
> startproject miProyecto me genera la carpeta miProyecto con la 
> siguiente estructura 
>
> manage.py 
> miProyecto/ 
>__init__.py  settings.py  urls.py  wsgi.py 
>
> al posicionarme en el directorio raiz del proyecto me lanza el 
> siguiente error 
> ImportError: Settings cannot be imported, because environment variable 
> DJANGO_SETTINGS_MODULE is undefined. 
>
> Anterior a esta version no me generaba esta estructura de archivos. 
> ¿Como puedo corregir el problema?

-- 
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/-/b5btuIeux7UJ.
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: Finding a developer

2012-06-26 Thread Phang Mulianto
Hi ,

i think depend on where you search it.

if you  search djangoers in here..you find plenty of it.

if you search ROR in their mailing list, there are plenty of it too..

i think the important think is you know about the engine you want to use..

in today world, developer works from remote is not a rare thing...

Regards,

Mulianto

On Mon, Jun 25, 2012 at 5:16 AM, Mengu  wrote:

> well, it may be hard to find if you require their presence otherwise
> you will find many great developers who are looking for remote full/
> part time work.
>
> On Jun 24, 11:35 pm, "Bob Carlson"  wrote:
> > I have been planning to implement my backend server in Django/Python but
> I am
> > still in the early phases. I thought I ought to look into Ruby on Rails
> as well.
> > The technical articles comparing them come out pretty even. It appears
> that
> > there is perhaps three times as much RR activity out there as
> Django/Python. I
> > am doing prototype work myself right now, but I will need professional
> help
> > eventually. That led me to my question.
> >
> > Is it easier to find a Django developer or a Rails developer? Despite
> there
> > being more activity around Rails, the availability of developers may not
> follow.
> > Also, is there any difference in cost?
> >
> > Cheers, Bob
> >
> > Bob Carlson | +1 719 571 9228 (office)  | +1 541 521 9525 (mobile)
> >
> > b...@rjcarlson.com  | rjcarlson49 (aim or skype)
>
> --
> 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: Render time

2012-06-26 Thread Larry Martell
On Mon, Jun 25, 2012 at 6:56 AM, Melvyn Sopacua  wrote:
> On 25-6-2012 14:00, Larry Martell wrote:
>> On Mon, Jun 25, 2012 at 5:56 AM, bruno desthuilliers
>>  wrote:
>>> On Monday, June 25, 2012 1:34:08 PM UTC+2, larry@gmail.com wrote:

  Now they want me to add to that how long
 the browser takes to render the page
>>>
>>>
>>> How would server code ever know this ?
>>
>> My assumption is that it would be collected or calculated on the
>> client side and sent back to the server. But I have no clue how that
>> could be done (or even if it could be done).
>>
>
> The issue is what your client's definitions are.
> A browser starts rendering as soon it receives data. Is that your
> starting point?
> If your definition is that "as soon as all data is received" and until
> browser has fully displayed things, this is a bit more difficult. First,
> there's no event for this. The closest approximation is
> "DOMContentLoaded", which is used by JQuery's documentready. The
> difference between "all data received" and "DOM parsing done" is the cpu
> cycles it takes to parse the main DOM tree. Since your clients already
> are asking for fractions of seconds in the common case, this is significant.
>
> Secondly, window.onload is your stoptime event, but this doesn't fire
> until /everything/ is loaded. This means any networking problems with
> content have to time out, but for the end user, everything displays
> correctly. In fact, a user can click on to the next page before this
> even fires.
>
> So, reliably, you can't really do this and your best approximation is
> the event firing times for window.onload minus DOMContentLoaded, or
> JQuery's $(document).ready [1].
> You can embed the row id for your statistics as a JavaScript variable in
> your template.
> And finally, you'd send the calculation back using Ajax requests,
> something you'll find plenty of howto's for on the web.
>
> [1]
> 

Thanks for the reply Melvyn. I'll be investigating these solutions.

-- 
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: Render time

2012-06-26 Thread Larry Martell
On Mon, Jun 25, 2012 at 9:04 PM, Andy McKay  wrote:
>> Now they want me to add to that how long
>> the browser takes to render the page after it gets the data.
>
> You can use the navigation timing API:
>
> https://dvcs.w3.org/hg/webperf/raw-file/tip/specs/NavigationTiming/Overview.html
>
> We use this in conjuction with graphite and django-statsd to produce
> graphs of hour long our sites takes to render.
>
> http://blog.mozilla.org/webdev/2012/01/06/timing-amo-user-experience/
>
> And some more links:
>
> https://github.com/andymckay/django-statsd
> http://django-statsd.readthedocs.org/en/latest/#front-end-timing-integration
> http://graphite.wikidot.com/

Great! Thanks very much Andy. I'll look into these and let everyone
know what I ultimately do.

-- 
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: ImportError: Settings cannot be imported, because environment variable DJANGO_SETTINGS_MODULE is undefined.

2012-06-26 Thread alvaroalo


On Monday, June 25, 2012 7:49:01 AM UTC+2, totechess wrote:
>
> Tengo el siguiente problema. Con la última actualización de django 1.5 
> supongamos estoy en un directorio x y al hacer django-admin 
> startproject miProyecto me genera la carpeta miProyecto con la 
> siguiente estructura 
>
> manage.py 
> miProyecto/ 
>__init__.py  settings.py  urls.py  wsgi.py 
>
> al posicionarme en el directorio raiz del proyecto me lanza el 
> siguiente error 
> ImportError: Settings cannot be imported, because environment variable 
> DJANGO_SETTINGS_MODULE is undefined. 
>
> Anterior a esta version no me generaba esta estructura de archivos. 
> ¿Como puedo corregir el problema?


Hola totechess,

En el script wsgi.py debes definir esa variable

path = os.path.dirname(os.path.abspath(__file__)) + '/..'
path2 = os.path.dirname(os.path.abspath(__file__))
if path not in sys.path:
sys.path.append(path)
if path2 not in sys.path:
sys.path.append(path2)

os.environ['DJANGO_SETTINGS_MODULE'] = 'miProyecto.settings'

¿Lo tienes así configurado?

Un saludo,
Alvaro

-- 
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/-/VPNJlO5TzHgJ.
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: Logout- Back Button

2012-06-26 Thread Javier Guerra Giraldez
On Mon, Jun 25, 2012 at 9:17 PM, Sajja1260  wrote:
> On Friday, 28 November 2008 14:35:48 UTC+5:30, jai_python wrote:
>>
>> Any possible to clear browser cache alone using javascript? it ill
>> help to solve this back button problem.

cache and history are two different things.

-- 
Javier

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



How can Selenium see a record that I can't find from a debugger?

2012-06-26 Thread Bryan
I am creating Selenium tests for my App.
I can create a new user, but I can't seem to figure out how to have it 
deleted from the database.

After the tests run successfully the first time, subsequent tests fail 
because the username already exists.

**Why am I not able to query the newly created record in the debugger 
despite being able to see the new record on the page?**  

**How do I delete a record from the database in a test?**

This is what I have been doing:  

from selenium import webdriver  
from django.utils import unittest  
from forum.models import Question, Answer, User  
  
class TestOSQAAuthentication(unittest.TestCase):  
scheme = 'http'  
host = 'localhost'  
port = ''  
 
def setUp(self):  
self._driver = webdriver.Firefox()  
self._driver.implicitly_wait(25)  
  
  
def test_anon_can_create_new_account_manually(self):  

self._driver.get('http://localhost:8000/account/local/register/')  

self._driver.find_element_by_id('id_username').send_keys('MrManual')  

self._driver.find_element_by_id('id_email').send_keys('t...@gmail.com')  

self._driver.find_element_by_id('id_password1').send_keys('test')  

self._driver.find_element_by_id('id_password2').send_keys('test')  
self._driver.find_element_by_id('bnewaccount').click()   
# verify MrManual was created  
self._driver.get('http://localhost:8000/users/')  
self._driver.find_element_by_link_text('MrManual')  
# MrManual seems to be created, but I don't see MrManual in the 
database during debugging with:  
# import ipdb; ipdb.set_trace()  
#ipdb> User.objects.all()  
#[, , ]  
# here I am trying to delete the user from the database 
directly.
User.objects.filter(username="MrManual").delete()  
"""For some reason I can't delete the record from the database 
from the test.  
Selenium can find the new user in the browser, but I can't 
query the database to find it."""

-- 
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/-/tZ8Wiygvk_MJ.
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: Finding a developer

2012-06-26 Thread Kurtis Mullins
If you are doing the work yourself, use whichever you prefer. If you are
paying someone else to do the work, give them the freedom to choose what to
use. Just find someone who can complete the task at hand within your budget
and the toolset really shouldn't matter -- as long as they're not doing it
in some manner that no other developer will ever touch the code base.

-- 
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: New to DJANGO

2012-06-26 Thread alvaroalo
I support the other users' opinion.

- Try checking the Django tutorial from the very first step
- You can also follow "The Definitive Guide to Django", which is 90% mainly 
based on the Django Tutorial

http://www.puyb.net/download/djangobook/res.pdf 


On Friday, June 22, 2012 1:52:52 AM UTC+2, Jeff Silverman wrote:
>
> I am new to Django.  I am trying to get the Class version of hello_world 
> to work.  I cannot find a good full example of the code that works.  I have 
> made multiple view.py files and urls.py files trying to get it to work.  I 
> cannot seem to come up with the right url to pass the variables name and 
> times in.  I am using soaplib among other libraries.  Pretty much trying 
> anything I find.
>
> Can anyone point out a full urls.py, views.py and url combination that 
> works?  Ultimately, I want to use the wsdl to expose the funtions to NINTEX 
> workflows.
>
> Any thing will be helpful.
>

-- 
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/-/GvsSr_mtBAEJ.
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: Logout- Back Button

2012-06-26 Thread Kurtis Mullins
You can't clear the browser's cache using Javascript.

On Tue, Jun 26, 2012 at 9:58 AM, Javier Guerra Giraldez
wrote:

> On Mon, Jun 25, 2012 at 9:17 PM, Sajja1260 
> wrote:
> > On Friday, 28 November 2008 14:35:48 UTC+5:30, jai_python wrote:
> >>
> >> Any possible to clear browser cache alone using javascript? it ill
> >> help to solve this back button problem.
>
> cache and history are two different things.
>
> --
> Javier
>
> --
> 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: base_url() in django

2012-06-26 Thread Kurtis Mullins
We understand the issue. You want to display absolute URL including the
hostname and protocol in your templates. That's not difficult to do, you
just need to write a custom template tag to do this. There's many ways to
go about doing this -- however, if you're only running a single web-site on
this Django application, I recommend creating a a base URL configuration
option in your settings.py and using that for generating the full URL.

The case we're trying to make is -- why do that? Just like Raitucarp said,
using an absolute path provides the same end-result as including the
hostname and protocol. There's only a few cases where you'd want to do that
-- primarily when trying to create links that will be used externally (for
example, a "copy and paste link" or for email templates).

Also, you mention {% url ... %} does relative paths. It doesn't. It does
absolute. It just doesn't include the hostname and protocol. A relative
path would not begin with a leading "/".

Good luck!

On Tue, Jun 26, 2012 at 3:58 AM, Raitucarp
wrote:

>
> Is this an actual issue? You realize that there's no difference between
>> /doc/ and http://example.com/doc/ if the current server is
>> http://example.com/?
>>
>> See here:
>> https://docs.djangoproject.**com/en/1.4/ref/templates/**builtins/#url
>>
>
> No no, that's not my issue. {% url %} template tag just create relative
> url that represent the views url. But, what I am going to ask here is
> create absolute url path. I mean in codeigniter I just call base_url() to
> create the base url where I am work. In django, it's hard to do that, just
> it.
>
> --
> 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/-/cinsOV4C4fMJ.
>
> 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: base_url() in django

2012-06-26 Thread Kurtis Mullins
>
> The case we're trying to make is -- why do that? Just like Raitucarp said,
> using an absolute path provides the same end-result as including the
> hostname and protocol. There's only a few cases where you'd want to do that
>

Whoops, sorry Raitucarp. I meant Melvyn :)

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



Jobs for $35+/hour? Or just go back to strictly-freelance?

2012-06-26 Thread Kurtis Mullins
Hey Guys,

I've been working on a pretty big Django project for a while now. Between
everything we've covered so far -- I've got some pretty good experience in.
Particularly with using a range of techniques and overcoming many different
obstacles. I find myself reading the Django source code almost daily and
consider myself on the "high-end" of the learning scale; not an expert but
definitely making good pace.

Anyways, my current project doesn't pay as much as I need to make. Between
my school loans, child care, etc... I'm barely covering my minimum expenses
and I'm already sacrificing quite a bit to survive on this income.

This project still has a little while to go before it will be determine
whether or not it'll succeed or fail. Either way, I need look at other
opportunities for the future. Does anyone know of any Django (or general
development) positions that allow telecommuting for more than $35/hour? Or
on the other hand, should I just go back to strictly freelance and aim for
the $50/hour that most would charge to do the same job? There's plenty of
jobs out there but I can't move from my area (South-West Ohio).

Thanks!
- Kurtis Mullins

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



Generating random alphanumeric codes

2012-06-26 Thread Sithembewena Lloyd Dube
Hi,

Would anyone have tips on how to generate random 4-digit alphanumeric codes
in python? Also, how does one calculate the number of possible combinations?

Thanks in advance.

-- 
Regards,
Sithembewena Lloyd Dube

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



Re: Generating random alphanumeric codes

2012-06-26 Thread Adrian Bool

On 26 Jun 2012, at 15:53, Sithembewena Lloyd Dube wrote:
> Would anyone have tips on how to generate random 4-digit alphanumeric codes 
> in python? Also, how does one calculate the number of possible combinations?

For upper case, lower case and digits we have,

26 + 26 + 10 = 62 

...possibilities for each position.  If you have four positions you have,

62 * 62 * 62 * 62 = 14776336

... possible combinations.

You can create a random number in this range by,

import Random from random

def build_population(spans):
for span in spans:
for x in range(ord(span[0]), ord(span[1]) + 1):
yield chr(x)

population = list(build_population( (('A','Z'), ('a', 'z'), ('0', '9')) 
))

r = Random()

r.sample(population, 4)
['C', 'l', 'q', 'y']

You may need to look into getting some entropy into the random number 
generator...

Cheers

aid

-- 
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: Finding a developer

2012-06-26 Thread Doug Snyder
How much you need to worry about differences in ROR or django infistructure
probably depends a lot on what your project entails. How much is it a job
that requires a framework? Django or ROR can be used for pretty common
generic web projects like a simple CMS system or it can be used for an
involved web app that's got a lot of specific functionality. I guess you
have to look at your specific functional needs and see how demanding or not
they are and get a basic idea of how they might work under either
framework. I've got a web app brewing in the back of my mind ( that I
haven't coded yet :-/ and it relies on functionality through a specific
mathematical python package. Python has a lot of packages written for it
that may or may not have anything to do with web development. I'm not a ROR
person, but I think ROR and Ruby itself have much less packages written for
it since its more of a web development and server scripting language, while
python is the language of choice for a lot of people that want to write
code in an easy language with quick development time. For 99% of web
projects this aspect of python may be completely irrelevant because you
won't be using any of its plethera of packages. But is you need some
specific, not so common functionality, see if there's some python code that
does what you want, and if Ruby has that also. I like python in general,
and so when I write websites its natural to use django.
If you're doing something more like a run of the mill website there's less
concern about which framework you choose.
But if you are going to scale or use large data stores and use
alternative's to your SQL DB and really push the limits there's a lot of
considerations that I'm not really up on . . . but you should either
understand these or find someone else that does ( not me :-0 )

Doug

On Tue, Jun 26, 2012 at 9:59 AM, Kurtis Mullins wrote:

> If you are doing the work yourself, use whichever you prefer. If you are
> paying someone else to do the work, give them the freedom to choose what to
> use. Just find someone who can complete the task at hand within your budget
> and the toolset really shouldn't matter -- as long as they're not doing it
> in some manner that no other developer will ever touch the code base.
>
> --
> 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: Django 1.4 - how to display a success message on form save

2012-06-26 Thread maumercado
Go with @JirkaV suggestion, also, you can add some jquery effect so that 
the div appears then fades out on success or on error... its pretty simple 
and really great!

On Tuesday, June 26, 2012 4:48:31 AM UTC-5, Lloyd Dube wrote:
>
> Hi everyone,
>
> I have a form on which I'm calling save() and if it is successful I would 
> like to display 'your post has been saved' or similar in the template. How 
> would one go about that in Django 1.4?
>
> I am sifting through the docs and cannot seem to find a definitive answer.
>
> Thanks in advance.
>
> -- 
> Regards,
> Sithembewena Lloyd Dube
>  

-- 
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/-/jIYGL0QUR30J.
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.4 - how to display a success message on form save

2012-06-26 Thread Kurtis Mullins
We do it all over our site. I use class-based views but you can checkout my
"MessageMixin". I have the code on this stackoverflow page:

http://stackoverflow.com/questions/5531258/example-of-django-class-based-deleteview/10903943#10903943

It will show up wherever you send the user to next, as long as your
template is coded to display the message.

-- 
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: am new to the django ,facing problem in searching the database with primary key(student id)

2012-06-26 Thread rick
thanks my friend...

On Tuesday, June 26, 2012 6:29:10 PM UTC+5:30, bruno desthuilliers wrote:
>
>
>
> On Tuesday, June 26, 2012 8:47:27 AM UTC+2, rick wrote:
>>
>> Reverse for 'add_record.views.search' with arguments '(> Student_login object>,)' and keyword arguments '{}' not found.
>>
>>
>  Your problem is with reverse url resolving, not with "searching the 
> database".  
>

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



interpretting urls

2012-06-26 Thread Smaran Harihar
Hi,

I am bit confused about what exactly do these urls imply in the url.py

urlpatterns = patterns('',
 (r'^(?:index/?)?$', 'geonode.views.index'),
(r'^(?Phelp)/?$', 'geonode.views.static'),
(r'^developer/?$', 'geonode.views.developer'),
url(r'^lang\.js$', 'django.views.generic.simple.direct_to_template',
   {'template': 'lang.js', 'mimetype': 'text/javascript'},
'lang'),
(r'^maps/', include('geonode.maps.urls'))


I know that a simple url syntax like this,

url(r'^data/$', 'geonode.maps.views.browse_data')

implies, that it will execute the function browse_data in views.py in the
maps directory, inside the geonode dir.

But not sure what the above urls imply. I am absolutely new to Django so
can u explain in simple terms.

-- 
Thanks & Regards
Smaran Harihar

-- 
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: Generating random alphanumeric codes

2012-06-26 Thread Patricio Valarezo

El 26/06/12 10:13, Adrian Bool escribió:


On 26 Jun 2012, at 15:53, Sithembewena Lloyd Dube wrote:
Would anyone have tips on how to generate random 4-digit alphanumeric 
codes in python? Also, how does one calculate the number of possible 
combinations?



mm... if I undertand you, maybe this could be useful:

http://docs.python.org/library/itertools.html

specially the combinations

http://docs.python.org/library/itertools.html#itertools.combinations

PV

--
patoVala
Linux User#280504
Hablando en http://www.elprimoalcahuete.com
"The difference between a good haircut and a bad one is seven days."
+--[ DSA 1024]+
| .o..|
| .oo..   |
|   . =....   |
|  . = + ... o .  |
|   *   .S= + o   |
|  . .   o = E|
| . o |
| |
| |
+-+

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



How to Query objects.filter ForeignKey

2012-06-26 Thread easypie
I'm trying to pass a objects.filter dictionary to HttpResponse. The problem 
is I have 2 models: InfoBox and InfoDetail. InfoDetail is linked to InfoBox 
by models.ForeignKey(InfoBox). What I want to do is filter by title which 
lives in the InfoBox model. I performed infobox = 
InfoDetail.objects.filter(title=info_title), but it returns an error cus 
'title' doesn't live in InfoDetail.

How can i grab and filter it by title and pass {'infobox': infobox} in 
HttpResponse when HttpRequest is called?

Here's models: http://paste.ubuntu.com/1061144/
Here's views: http://paste.ubuntu.com/1061146/

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



Getting tuple of (sql, params) from the ORM.

2012-06-26 Thread David Novakovic
Hey all,

Is it possible to get a tuple of (sql, params) from an ORM queryset?

I need to use the async postgres driver (txpostgres) on some backend code 
and I'd like to use the ORM to generate SQL but actually run it through my 
own connection.

I've had a look at queryset.query but from what I can see it's just useful 
for debug as nothing is escaped properly etc (I'd expect the driver to do 
the param interpolation anyway).

Thanks in advance!

D

-- 
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/-/WPqdzztk8MMJ.
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: Getting tuple of (sql, params) from the ORM.

2012-06-26 Thread Jeremy Dunck
On Tue, Jun 26, 2012 at 11:40 AM, David Novakovic
 wrote:
> Hey all,
>
> Is it possible to get a tuple of (sql, params) from an ORM queryset?

Yep:

sql, params = qs.query.get_compiler('default').as_sql()

(Fancy meeting you here. :))

-- 
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 page doesn't auto-refresh

2012-06-26 Thread Melvyn Sopacua
On 26-6-2012 11:15, ledzgio wrote:
> Hi,
> 
> I have a problemi with the admin page. In my admin page I have 3 fields 
> that refers to the same table called Team: when I want to add a new Team by 
> pressint the green "+" button, the popoup shows up and I can fill the form 
> and adding a new Team. When I click save, the pop up disappears and I have 
> the new value close to the "+" button I have pressed upon. But the problem 
> is that the other fields that refers to the table Team in the page are 
> empty, so I have to refresh the page in order to see the just added Team 
> show. 
> 
> How can I fix this behavior?

You can't. You should fix your models or use an InlineAdminModel. It
sounds like you're duplicating fields from the foreign key table Team in
other parts of the model.
Either that, or you're using both an InlineAdminModel and have the
foreign key available in admin model.

Without seeing the model definitions and the admin model definitions, we
can only guess.

-- 
Melvyn Sopacua


-- 
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: Render time

2012-06-26 Thread Melvyn Sopacua
On 26-6-2012 5:04, Andy McKay wrote:
>> Now they want me to add to that how long
>> the browser takes to render the page after it gets the data.
> 
> You can use the navigation timing API:
> 
> https://dvcs.w3.org/hg/webperf/raw-file/tip/specs/NavigationTiming/Overview.html

Wow, really nice. Can't believe I missed that.

-- 
Melvyn Sopacua


-- 
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: Logout- Back Button

2012-06-26 Thread Melvyn Sopacua
On 26-6-2012 4:17, Sajja1260 wrote:
> hi all,
> i'm also facing the same problm... can any one help me

What problem?
Redirect after a get request? => document.replace().

-- 
Melvyn Sopacua


-- 
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 Query objects.filter ForeignKey

2012-06-26 Thread Kurtis Mullins
>
>  I performed infobox = InfoDetail.objects.filter(title=info_title), but it
> returns an error cus 'title' doesn't live in InfoDetail.
>
> How can i grab and filter it by title and pass {'infobox': infobox} in
> HttpResponse when HttpRequest is called?
>

If you want to filter by a certain title, then you'd do something like this:

InfoDetail.objects.filter(infobox__title="Some Title")

That would return all InfoDetail objects whose related InfoBox has a
specific title.

If that doesn't help solve your problem, let me know what else you're stuck
on :)

-- 
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: Render time

2012-06-26 Thread Jani Tiainen
I stumbled upon this while looking about this timing stuff:
http://www.html5rocks.com/en/tutorials/webperformance/basics/

Seemed slightly more verbose than W3C formal documentation.

On Tue, Jun 26, 2012 at 10:38 PM, Melvyn Sopacua wrote:

> On 26-6-2012 5:04, Andy McKay wrote:
> >> Now they want me to add to that how long
> >> the browser takes to render the page after it gets the data.
> >
> > You can use the navigation timing API:
> >
> >
> https://dvcs.w3.org/hg/webperf/raw-file/tip/specs/NavigationTiming/Overview.html
>
> Wow, really nice. Can't believe I missed that.
>
> --
> Melvyn Sopacua
>
>
> --
> 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.
>
>


-- 
Jani Tiainen

- Well planned is half done, and a half done has been sufficient before...

-- 
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 Query objects.filter ForeignKey

2012-06-26 Thread easypie
That worked like a charm! I read about the double underscore but didn't 
think much about it when it crossed my mind. I've been grinding on this for 
the whole day. My eyes... =)

On Tuesday, June 26, 2012 1:04:40 PM UTC-7, Kurtis wrote:
>
>  I performed infobox = InfoDetail.objects.filter(title=info_title), but it 
>> returns an error cus 'title' doesn't live in InfoDetail.
>>
>> How can i grab and filter it by title and pass {'infobox': infobox} in 
>> HttpResponse when HttpRequest is called?
>>
>
> If you want to filter by a certain title, then you'd do something like 
> this:
>
> InfoDetail.objects.filter(infobox__title="Some Title") 
>
> That would return all InfoDetail objects whose related InfoBox has a 
> specific title.
>
> If that doesn't help solve your problem, let me know what else you're 
> stuck on :)
>

-- 
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/-/5fEndcSA6KIJ.
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.



Object Permissions List Population

2012-06-26 Thread Karandeep Nagra
So I've created a Server model and whenever a server instance is created, a 
group associated with that server is also created.  So for server "Bender", 
the group "Bender Admins" is created.  Now, when a Request model instance 
is created with Bender as its foreignkey, I automatically assign Bender 
Admins the "modify" permission for that instance, using the 
object_permissions package 
(https://code.osuosl.org/projects/object-permissions), but now I need to 
populate the list of requests in the admin change list interface.  I want 
to display only those requests that the user is authorized to modify.  Any 
ideas on how to do this?  I know it needs to be in the template 
change_list.html or change_list_results.html.

-- 
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/-/0nUxW0BOh0IJ.
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: New to DJANGO

2012-06-26 Thread Russell Keith-Magee
On Tue, Jun 26, 2012 at 9:59 PM, alvaroalo  wrote:
> I support the other users' opinion.
>
> - Try checking the Django tutorial from the very first step
> - You can also follow "The Definitive Guide to Django", which is 90% mainly
> based on the Django Tutorial
>
> 

We *will not* tolerate the use of official Django forums to support
the illegal distribution of copyrighted work -- especially when you're
violating the copyright of members of this community.

The Django Book is available for free online [1]. However, the PDF is
NOT freely distributable.

You have been warned. If you make another attempt to use a Django
forum for the purposes of illegally distributing copyrighted work, you
will be banned from posting to this list.

[1] http://djangobook.com

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.



Re: New to DJANGO

2012-06-26 Thread Kurtis Mullins
> We *will not* tolerate the use of official Django forums to support
> the illegal distribution of copyrighted work -- especially when you're
> violating the copyright of members of this community.
>
> The Django Book is available for free online [1]. However, the PDF is
> NOT freely distributable.
>
> You have been warned. If you make another attempt to use a Django
> forum for the purposes of illegally distributing copyrighted work, you
> will be banned from posting to this list.
>
> [1] http://djangobook.com


I'm not trying to defend the potentially-illegal distribution of the
material. However, after reading this response, I took a quick look at
the Django Book's license. It seems it's covered under two separate
licensing schemes, both shown on this page:
http://www.djangobook.com/license/

The first part is the initial copyright at the top of the page. It
seems to indicate that you cannot redistribute this material without
written consent. Clear enough.

However, scroll down a bit -- or even looking at the link from the
main page -- it appears to be covered under the GNU Free Documentation
License.  And I quote: "to assure everyone the effective freedom to
copy and redistribute it, with or without modifying it, either
commercially or noncommercially."

So, does this fall under the GNU Documentation License or the author's
Copyright block? They cannot work together (incompatible) unless it is
dual licensed -- in which case, I believe alvaroalo would have been
well within his rights to make this slight modification and
distribution effort.

-- 
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: New to DJANGO

2012-06-26 Thread Kurtis Mullins
Actually, turns out I just had to read a bit more :) Sorry!

So, the actual content of the Django Book is allowed to be freely
re-distributed under the GNU Free Documentation License. The actual
"Layout and design" remains under the control of the authors and
required written permission to reproduce. I did not see the
distributed content but I'll leave the up to you guys to determine
whether or not that user is violating this portion of the licensing.

-- 
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: New to DJANGO

2012-06-26 Thread Russell Keith-Magee
On Wed, Jun 27, 2012 at 9:56 AM, Kurtis Mullins
 wrote:
> Actually, turns out I just had to read a bit more :) Sorry!
>
> So, the actual content of the Django Book is allowed to be freely
> re-distributed under the GNU Free Documentation License. The actual
> "Layout and design" remains under the control of the authors and
> required written permission to reproduce. I did not see the
> distributed content but I'll leave the up to you guys to determine
> whether or not that user is violating this portion of the licensing.

As far as I could make out, what was being distributed in this case
was the official APress PDF, which is protected layout and design.

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.



Django 1.4 Why does the create project command create 2 identical folders

2012-06-26 Thread Python_Junkie
When one creates a project with django-admin.py why is a second my site 
folder created?

Mysite
Mysite
polls

Thanks in advance.

What is its function/value in this new version

-- 
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/-/wSdsYgVkNGAJ.
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.4 Why does the create project command create 2 identical folders

2012-06-26 Thread Sergiy Khohlov
first one name of the project second  one name of the application. You
had executed both command

2012/6/27 Python_Junkie :
> When one creates a project with django-admin.py why is a second my site
> folder created?
>
> Mysite
> Mysite
> polls
>
> Thanks in advance.
>
> What is its function/value in this new version
>
> --
> 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/-/wSdsYgVkNGAJ.
> 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.