Re: TinyMCE config

2012-08-02 Thread Aljoša Mohorović
On Thu, Aug 2, 2012 at 3:19 AM, jondbaker  wrote:
> TINYMCE_JS_URL = os.path.join(PROJECT_ROOT,
> 'templates/static/js/tiny_mce/tiny_mce.js')
> TINYMCE_JS_ROOT = os.path.join(PROJECT_ROOT, 'templates/static/js/tiny_mce')

You don't need to set TINYMCE_JS_URL/TINYMCE_JS_ROOT because it is set
automatically based on staticfiles settings.
It's available as configuration option if you need to override default setup.
When you "pip install django-tinymce" all required files are copied so
you can skip step 4 as described in docs, you just need to set
STATIC_ROOT/STATIC_URL.

basically, if you have tinymce in INSTALLED_APPS and urlpatterns and
django has staticfiles properly configured it will work as expected.

let me know if you're still having issues w/ setup and feel free to
contact me if you have any questions.

Aljosa
--
https://twitter.com/maljosa
https://github.com/aljosa

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



Major Trouble Understanding Sessions Documentation

2012-08-02 Thread Gregory Thompson Jr.
I'd like to pass form data from one view to another.  

Here's my attempt: 

*#Models.py*from django import forms
class Textizer(forms.Form):
to_textize = forms.CharField(max_length=100)

def __unicode__(self):
return self.to_textize
*#views.py*from textize.models import Textizerfrom django.http import 
HttpResponseRedirectfrom django.shortcuts import render_to_responsefrom 
django.core.context_processors import csrf
def index(request):
if request.method == 'POST':
form = Textizer(request.POST)

if form.is_valid():
request.session['text'] = form.cleaned_data['to_textize']
return HttpResponseRedirect('/results')

else:
form = Textizer()

c = {'form': form}
c.update(csrf(request))
return render_to_response('C:/Documents and 
Settings/quansai/projects/textsite/templates/index.html', c)
def results(request):
text = request.session.get('text', None)
c = {'text' : text}
return render_to_response('C:/Documents and 
Settings/quansai/projects/textsite/templates/results.html', c)


I really don't understand the following, and I've read the documentation over 
and over.  I've been on this for two days:


   - How to initiate a session
   - How sessions are checked
   - How to retrieve form data from one page to handle the data on another.

Again, I've read through the documentation.  I've asked on IRC but everyone 
pretty much just says "RTFM" even when I tell them I have.  This is absolutely 
frustrating as an extreme beginner.

I'd also like to add that I DO understand the core Python language.  Please, 
unless it's absolutely necessary, don't try explaining to me what a dictionary, 
tuple, list, etc... is.  I've already had my intelligence insulted by the users 
on IRC in this regard.  I really just don't understand the sessions 
documentation. 

-- 
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/-/1xFNBaS1eogJ.
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.



Noob question

2012-08-02 Thread Robert
Hi all, I´ve developed that model, but i´m quite confused about the sintax, 
looks a bit freaky... Hers my code:

from django.db import models

##
 PROJETOS 
##

class Projetos(models.Model):

#PRIMARY KEY
i_id = models.AutoField(primary_key=True)

#FIELDS
i_motivo_oferta = models.IntegerField()
s_nome_projeto = models.CharField("Projeto",max_length=100)
s_integrador = models.CharField("Integrador",max_length=100)
s_contend_provider = models.CharField("Contend 
Provider",max_length=100)
s_marca_servico = models.CharField("Marca do 
Serviço",max_length=100)

ABRANGENCIA = (('R', 'Regional'),('N', 'Nacional'),)
s_abrangencia = models.CharField("Abrangência",max_length=2, 
choices=ABRANGENCIA)

TIPO_SERVICO = (('C', 'Cross'),('W', 'White Label'),)
i_id_tipo_servico =  models.CharField("Tipo de 
Serviço",max_length=2, choices=TIPO_SERVICO)

i_valor_retry = models.IntegerField("Valor de retry")
i_la =  models.IntegerField("Large account")
d_lanc_comercial = models.DateField("Lançamento comercial")
d_term_projeto = models.DateField("Término do projeto")

???
??? PLANOS_DE_MIDIA = (('I', 'Internet'), ('T', 'TV'), ('R', 
'Radio'), ('R', 'Revista'), ('R', 'Midia Exterior'), ('R', 'Outros'),)
??? i_plan_midia = models.CharField("Plano de midia",max_length=2, 
choices=PLANOS_DE_MIDIA)
???

d_data_acordo = models.DateField("Data de Acordo")
d_data_revisao = models.DateField("Data de Revisão")
i_ura_id =  models.IntegerField("URA ID")
s_ura_desc = models.CharField("Descição URA",max_length=200)

#FOREIGN KEY "Perfil_Servico"
i_id_perfil_servico = models.ForeignKey(Perfil_Servico)



###
  RELAÇÕES N -> 1  COM A TABELA PROJETOS  #
###

# Para cada "PROJETO" eu tenho varios Header Enrichment #
class Header_Enrich(models.Model):
#PRIMARY KEY
i_id = models.AutoField(primary_key=True)
#FIELDS
s_url = models.URLField("Url")
b_wap = models.BooleanField("Wap")
b_web = models.BooleanField("Web")
#FOREIGN KEY "Projetos"
i_id_projetos = models.ForeignKey(Projetos)

# Para cada "PROJETO" eu tenho varias estimativas de trafego/receita 
para cada mes do ano. #
class Traf_Receita(models.Model):
#PRIMARY KEY
i_id = models.AutoField(primary_key=True)
#FIELDS
i_mes = models.IntegerField("Mês")
i_ano = models.IntegerField("Ano")
i_trafego = models.IntegerField("Trafego")
i_receita = models.IntegerField("Receita")
#FOREIGN KEY "Projetos"
i_id_projetos = models.ForeignKey(Projetos)

# Para cada "PROJETO" eu tenho varias tarifas e descrições. #
class Tarifar_Proj(models.Model):
#PRIMARY KEY
i_id = models.AutoField(primary_key=True)
#FIELDS
i_tarifa_proj = models.IntegerField("Tarifa")
s_desc_tarifa = models.CharField("Descrição da tarifa", 
max_length=200)
#FOREIGN KEY "Projetos"
i_id_projetos = models.ForeignKey(Projetos)

# Para cada "PROJETO" eu tenho varios planejamentos de midia. #
class Planej_Midia(models.Model):
#PRIMARY KEY
i_id = models.AutoField(primary_key=True)
#FIELDS
s_planej_midea = models.CharField("Planejamento de midia", 
max_length=200)
s_desc_midea = models.CharField("Descrição", max_length=200)
#FOREIGN KEY "Projetos"
i_id_projetos = models.ForeignKey(Projetos)

###
###  TABELAS FATO   ###
###

"""
# Relaciona Projeto com Tipo de Servico
class Rel_Proj_Tipo_Servico(models.Model):
#PRIMARY KEY
i_id = models.AutoField(primary_key=True)
#FOREIGN KEY "Projetos" && "Motivo_Oferta"
i_id_projetos = models.ForeignKey(Projetos)
i_id_tipo_servico = models.ForeignKey(Tipo_Servico)
"""

# Relaciona Projeto com motivo da oferta
class Rel_Proj_Motivo(models.Model):
#PRIMARY KEY
i_id = models.AutoField(primary_key=True)
#FOREIGN KEY "Projetos" && "Motivo_Oferta"
i_id_projetos = models.ForeignKey(Projetos)
i_id_motivo_oferta = models.ForeignKey(Motivo_Oferta)

###
  RELAÇÕES N -> 1  COM  Rel_Proj_Motivo   #
###

class Motivo_Ofert

Re: Major Trouble Understanding Sessions Documentation

2012-08-02 Thread Larry Martell
On Thu, Aug 2, 2012 at 7:06 AM, Gregory Thompson Jr.
 wrote:
> I'd like to pass form data from one view to another.
>
> Here's my attempt:
>
> #Models.py
> from django import forms
>
> class Textizer(forms.Form):
> to_textize = forms.CharField(max_length=100)
>
> def __unicode__(self):
> return self.to_textize
>
> #views.py
> from textize.models import Textizer
> from django.http import HttpResponseRedirect
> from django.shortcuts import render_to_response
> from django.core.context_processors import csrf
>
> def index(request):
> if request.method == 'POST':
> form = Textizer(request.POST)
>
> if form.is_valid():
> request.session['text'] = form.cleaned_data['to_textize']
> return HttpResponseRedirect('/results')
>
> else:
> form = Textizer()
>
> c = {'form': form}
> c.update(csrf(request))
> return render_to_response('C:/Documents and
> Settings/quansai/projects/textsite/templates/index.html', c)
>
> def results(request):
> text = request.session.get('text', None)
> c = {'text' : text}
> return render_to_response('C:/Documents and
> Settings/quansai/projects/textsite/templates/results.html', c)
>
>
> I really don't understand the following, and I've read the documentation
> over and over.  I've been on this for two days:
>
> How to initiate a session
> How sessions are checked
> How to retrieve form data from one page to handle the data on another.

In your template you can access the session variables as request.session.text.

-- 
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: Major Trouble Understanding Sessions Documentation

2012-08-02 Thread Gregory Thompson Jr.
Okay. What?

Can you explain any of the key points I was trying to understand?  I don't 
know what I'm doing.  

On Thursday, August 2, 2012 9:22:40 AM UTC-4, larry@gmail.com wrote:
>
> On Thu, Aug 2, 2012 at 7:06 AM, Gregory Thompson Jr. 
>  wrote: 
> > I'd like to pass form data from one view to another. 
> > 
> > Here's my attempt: 
> > 
> > #Models.py 
> > from django import forms 
> > 
> > class Textizer(forms.Form): 
> > to_textize = forms.CharField(max_length=100) 
> > 
> > def __unicode__(self): 
> > return self.to_textize 
> > 
> > #views.py 
> > from textize.models import Textizer 
> > from django.http import HttpResponseRedirect 
> > from django.shortcuts import render_to_response 
> > from django.core.context_processors import csrf 
> > 
> > def index(request): 
> > if request.method == 'POST': 
> > form = Textizer(request.POST) 
> > 
> > if form.is_valid(): 
> > request.session['text'] = form.cleaned_data['to_textize'] 
> > return HttpResponseRedirect('/results') 
> > 
> > else: 
> > form = Textizer() 
> > 
> > c = {'form': form} 
> > c.update(csrf(request)) 
> > return render_to_response('C:/Documents and 
> > Settings/quansai/projects/textsite/templates/index.html', c) 
> > 
> > def results(request): 
> > text = request.session.get('text', None) 
> > c = {'text' : text} 
> > return render_to_response('C:/Documents and 
> > Settings/quansai/projects/textsite/templates/results.html', c) 
> > 
> > 
> > I really don't understand the following, and I've read the documentation 
> > over and over.  I've been on this for two days: 
> > 
> > How to initiate a session 
> > How sessions are checked 
> > How to retrieve form data from one page to handle the data on another. 
>
> In your template you can access the session variables as 
> request.session.text. 
>

-- 
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/-/Mmx185GY9X4J.
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: Major Trouble Understanding Sessions Documentation

2012-08-02 Thread Daniel Roseman
On Thursday, 2 August 2012 14:06:04 UTC+1, Gregory Thompson Jr. wrote:
>
> 
>
> I really don't understand the following, and I've read the documentation over 
> and over.  I've been on this for two days:
>
>
>- How to initiate a session
>- How sessions are checked
>- How to retrieve form data from one page to handle the data on another.
>
> Again, I've read through the documentation.  I've asked on IRC but everyone 
> pretty much just says "RTFM" even when I tell them I have.  This is 
> absolutely frustrating as an extreme beginner.
>
> I'd also like to add that I DO understand the core Python language.  Please, 
> unless it's absolutely necessary, don't try explaining to me what a 
> dictionary, tuple, list, etc... is.  I've already had my intelligence 
> insulted by the users on IRC in this regard.  I really just don't understand 
> the sessions documentation. 
>
>

So, you didn't understand the documentation, but you also don't want to be 
told what dictionaries/lists/tuples are.  How about you tell us which bit 
of the examples under "Using sessions in views" (which I'm not linking to 
because you've said you've read it) you didn't understand?
--
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/-/CAgoMSjdTVgJ.
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: Detecting browser type after login

2012-08-02 Thread Kurtis Mullins
Hey Larry,

Okay, let me make sure I understand this correctly. This is, essentially,
the flow of control you'd like to implement:

1. User signs in successfully
2. User is prompted to some other (any other) page
3. User is presented with a one-time only popup

The simple way to implement something *similar* to this would be using the
Django Messaging Framework. Of course, this framework will not (without a
huge hack) do exactly what you want. However, you could most likely take
the basis of the Messaging Framework and implement similar functionality,
yourself.

Without looking myself, I imagine you'd have a data structure that would be
stored in the user's session and a custom template tag which would look for
this particular data. If that custom template tag finds the data, it does
*something* (display popup, or whatever logic you may need specialized
there). Then, simply put this custom template tag (or possibly variants of
this tag) on your templates which may need to provide this functionality.

Here's a link for the messaging framework, just in case your not familiar
with it:  https://docs.djangoproject.com/en/dev/ref/contrib/messages/  --
Again, that's not the proper use of the messages framework but at an
abstract level I picture it following a similar path.

To try and clear up some of the questions/issues you mentioned
specifically, read below.

On Wed, Aug 1, 2012 at 9:44 PM, Larry Martell wrote:
>
> >>
> >> Another issue with this is that I only want to display the pop up
> >> once, immediately after they login. I don't think I can tell if that's
> >> the case in the view, only in the code that is called after login().
>

Using the technique described above, this would
happen programmatically because the template tag would simply "pop" or
delete your data after it is used. The next time the template tag looks for
that same data, it won't be there; unless the user logs in again.


> >
> > So what I ended up doing was to add a session-cookie with the
> > popup-information. I can then access in the base template, but the
> > issue I am having now is that they want the popup to be on top of the
> > login screen, and it's displaying on a blank screen, after the login
> > screen is cleared. ARHG!
>

Sorry but I'm not quite following you here. Can you give us more
information about your "blank screen"? Also, could you clarify what you
mean by "the login screen is cleared"?


>
> So it would appear there is no way to send data from django to the
> browser that updates the page without first clearing it. Is that true?
>

I'm a bit vague on this one, as well. However, there is no way to send data
from django to the browser after the page has loaded. I'm not sure what you
mean by "without first clearing it". You could always use AJAX but I don't
think that's the problem at hand, 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: Detecting browser type after login

2012-08-02 Thread Kurtis Mullins
Whoops, quick fix in my message (Item #2):


> 1. User signs in successfully
> 2. User is *redirected* to some other (any other) page
> 3. User is presented with a one-time-only popup
>
>

-- 
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: Noob question

2012-08-02 Thread Demian Brecht
What, exactly are you confused about? What is your question?

2012/8/2 Robert 

> Hi all, I´ve developed that model, but i´m quite confused about the
> sintax, looks a bit freaky... Hers my code:
>
> from django.db import models
>
> ##
>  PROJETOS 
> ##
>
> class Projetos(models.Model):
>
> #PRIMARY KEY
> i_id = models.AutoField(primary_key=True)
>
> #FIELDS
> i_motivo_oferta = models.IntegerField()
> s_nome_projeto = models.CharField("Projeto",max_length=100)
> s_integrador = models.CharField("Integrador",max_length=100)
> s_contend_provider = models.CharField("Contend
> Provider",max_length=100)
> s_marca_servico = models.CharField("Marca do
> Serviço",max_length=100)
>
> ABRANGENCIA = (('R', 'Regional'),('N', 'Nacional'),)
> s_abrangencia = models.CharField("Abrangência",max_length=2,
> choices=ABRANGENCIA)
>
> TIPO_SERVICO = (('C', 'Cross'),('W', 'White Label'),)
> i_id_tipo_servico =  models.CharField("Tipo de
> Serviço",max_length=2, choices=TIPO_SERVICO)
>
> i_valor_retry = models.IntegerField("Valor de retry")
> i_la =  models.IntegerField("Large account")
> d_lanc_comercial = models.DateField("Lançamento comercial")
> d_term_projeto = models.DateField("Término do projeto")
>
> ???
> ??? PLANOS_DE_MIDIA = (('I', 'Internet'), ('T', 'TV'), ('R',
> 'Radio'), ('R', 'Revista'), ('R', 'Midia Exterior'), ('R', 'Outros'),)
> ??? i_plan_midia = models.CharField("Plano de midia",max_length=2,
> choices=PLANOS_DE_MIDIA)
> ???
>
> d_data_acordo = models.DateField("Data de Acordo")
> d_data_revisao = models.DateField("Data de Revisão")
> i_ura_id =  models.IntegerField("URA ID")
> s_ura_desc = models.CharField("Descição URA",max_length=200)
>
> #FOREIGN KEY "Perfil_Servico"
> i_id_perfil_servico = models.ForeignKey(Perfil_Servico)
>
>
>
> ###
>   RELAÇÕES N -> 1  COM A TABELA PROJETOS  #
> ###
>
> # Para cada "PROJETO" eu tenho varios Header Enrichment #
> class Header_Enrich(models.Model):
> #PRIMARY KEY
> i_id = models.AutoField(primary_key=True)
> #FIELDS
> s_url = models.URLField("Url")
> b_wap = models.BooleanField("Wap")
> b_web = models.BooleanField("Web")
> #FOREIGN KEY "Projetos"
> i_id_projetos = models.ForeignKey(Projetos)
>
> # Para cada "PROJETO" eu tenho varias estimativas de trafego/receita
> para cada mes do ano. #
> class Traf_Receita(models.Model):
> #PRIMARY KEY
> i_id = models.AutoField(primary_key=True)
> #FIELDS
> i_mes = models.IntegerField("Mês")
> i_ano = models.IntegerField("Ano")
> i_trafego = models.IntegerField("Trafego")
> i_receita = models.IntegerField("Receita")
> #FOREIGN KEY "Projetos"
> i_id_projetos = models.ForeignKey(Projetos)
>
> # Para cada "PROJETO" eu tenho varias tarifas e descrições. #
> class Tarifar_Proj(models.Model):
> #PRIMARY KEY
> i_id = models.AutoField(primary_key=True)
> #FIELDS
> i_tarifa_proj = models.IntegerField("Tarifa")
> s_desc_tarifa = models.CharField("Descrição da tarifa",
> max_length=200)
> #FOREIGN KEY "Projetos"
> i_id_projetos = models.ForeignKey(Projetos)
>
> # Para cada "PROJETO" eu tenho varios planejamentos de midia. #
> class Planej_Midia(models.Model):
> #PRIMARY KEY
> i_id = models.AutoField(primary_key=True)
> #FIELDS
> s_planej_midea = models.CharField("Planejamento de midia",
> max_length=200)
> s_desc_midea = models.CharField("Descrição", max_length=200)
> #FOREIGN KEY "Projetos"
> i_id_projetos = models.ForeignKey(Projetos)
>
> ###
> ###  TABELAS FATO   ###
> ###
>
> """
> # Relaciona Projeto com Tipo de Servico
> class Rel_Proj_Tipo_Servico(models.Model):
> #PRIMARY KEY
> i_id = models.AutoField(primary_key=True)
> #FOREIGN KEY "Projetos" && "Motivo_Oferta"
> i_id_projetos = models.ForeignKey(Projetos)
> i_id_tipo_servico = models.ForeignKey(Tipo_Servico)
> """
>
> # Relaciona Projeto com motivo da oferta
> class Rel_Proj_Motivo(models.Model):
> #PRIMARY KEY
> i_id = models.AutoField(primary_key=True)
> #FOREIGN KEY "Projetos" && "Motivo_Oferta"
> i_id_projetos = models.ForeignKey(Projetos)
> i_id_motivo_oferta = models.ForeignKey(Motivo_Oferta)
>
> ###
> #

Re: Major Trouble Understanding Sessions Documentation

2012-08-02 Thread Gregory Thompson Jr.

   
   1. def login(request):
   2. m = Member.objects.get(username=request.POST['username'])
   3. if m.password == request.POST['password']:
   4. request.session['member_id'] = m.id
   5. return HttpResponse("You're logged in.")
   6. else:
   7. return HttpResponse("Your username and password didn't match."
   )
   
How about that for starters?

The documentation goes from that to explaining how to set cookies.  How do 
they expect me to understand what's going on?
There's absolutely NO explanation of what's going on in that code.  

request.session['member_id'] = m.id 

How the hell does that work?  

They don't tell you where the session is started, how, what the scope of 
the session declaration is, etc...  

http://www.youtube.com/watch?v=YFd9NLZFmvo&playnext=1&list=PL6CB0A9FA1D9C736A&feature=results_video
  
 

See that video?  The video shows you how to use sessions very quickly.  How 
did the person in the video get ALL of that code from just the 
documentation? 

If all readers in this thread and kindly tackle each point I made, I 
promise you your own KFC when I start my empire.  Until then, I really just 
need someone to give me the step-by-step on this one.  I'm completely new 
to the framework and the documentation thus far has not been helpful.  I've 
mainly gotten by with the help of StackOverflow, IRC, and random code 
snippets online -- and occasionally, some outdated books.  

If you don't want to explain or aren't going to ask me progressive 
questions with regards to my confusion, please just skip over my plight.

Thank you all.

On Thursday, August 2, 2012 9:54:21 AM UTC-4, Daniel Roseman wrote:
>
> On Thursday, 2 August 2012 14:06:04 UTC+1, Gregory Thompson Jr. wrote:
>>
>> 
>>
>> I really don't understand the following, and I've read the documentation 
>> over and over.  I've been on this for two days:
>>
>>
>>- How to initiate a session
>>- How sessions are checked
>>- How to retrieve form data from one page to handle the data on another.
>>
>> Again, I've read through the documentation.  I've asked on IRC but everyone 
>> pretty much just says "RTFM" even when I tell them I have.  This is 
>> absolutely frustrating as an extreme beginner.
>>
>> I'd also like to add that I DO understand the core Python language.  Please, 
>> unless it's absolutely necessary, don't try explaining to me what a 
>> dictionary, tuple, list, etc... is.  I've already had my intelligence 
>> insulted by the users on IRC in this regard.  I really just don't understand 
>> the sessions documentation. 
>>
>>
>
> So, you didn't understand the documentation, but you also don't want to be 
> told what dictionaries/lists/tuples are.  How about you tell us which bit 
> of the examples under "Using sessions in views" (which I'm not linking to 
> because you've said you've read it) you didn't understand?
> --
> 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/-/0czW05_b8q8J.
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: Major Trouble Understanding Sessions Documentation

2012-08-02 Thread Marcin Tustin
What's confusing about this? You don't explicitly create sessions, and they
last as long as they are configured to last, which by default is until the
session cookie is cleared.

On Thu, Aug 2, 2012 at 10:31 AM, Gregory Thompson Jr. <
spockthompso...@gmail.com> wrote:

>
>1. def login(request):
>2. m = Member.objects.get(username=request.POST['username'])
>3. if m.password == request.POST['password']:
>4. request.session['member_id'] = m.id
>5. return HttpResponse("You're logged in.")
>6. else:
>7. return HttpResponse("Your username and password didn't
>match.")
>
> How about that for starters?
>
> The documentation goes from that to explaining how to set cookies.  How do
> they expect me to understand what's going on?
> There's absolutely NO explanation of what's going on in that code.
>
> request.session['member_id'] = m.id
>
> How the hell does that work?
>
> They don't tell you where the session is started, how, what the scope of
> the session declaration is, etc...
>
>
> http://www.youtube.com/watch?v=YFd9NLZFmvo&playnext=1&list=PL6CB0A9FA1D9C736A&feature=results_video
>
>
> See that video?  The video shows you how to use sessions very quickly.
>  How did the person in the video get ALL of that code from just the
> documentation?
>
> If all readers in this thread and kindly tackle each point I made, I
> promise you your own KFC when I start my empire.  Until then, I really just
> need someone to give me the step-by-step on this one.  I'm completely new
> to the framework and the documentation thus far has not been helpful.  I've
> mainly gotten by with the help of StackOverflow, IRC, and random code
> snippets online -- and occasionally, some outdated books.
>
> If you don't want to explain or aren't going to ask me progressive
> questions with regards to my confusion, please just skip over my plight.
>
> Thank you all.
>
> On Thursday, August 2, 2012 9:54:21 AM UTC-4, Daniel Roseman wrote:
>>
>> On Thursday, 2 August 2012 14:06:04 UTC+1, Gregory Thompson Jr. wrote:
>>>
>>> 
>>>
>>> I really don't understand the following, and I've read the documentation 
>>> over and over.  I've been on this for two days:
>>>
>>>
>>>- How to initiate a session
>>>- How sessions are checked
>>>- How to retrieve form data from one page to handle the data on another.
>>>
>>> Again, I've read through the documentation.  I've asked on IRC but everyone 
>>> pretty much just says "RTFM" even when I tell them I have.  This is 
>>> absolutely frustrating as an extreme beginner.
>>>
>>> I'd also like to add that I DO understand the core Python language.  
>>> Please, unless it's absolutely necessary, don't try explaining to me what a 
>>> dictionary, tuple, list, etc... is.  I've already had my intelligence 
>>> insulted by the users on IRC in this regard.  I really just don't 
>>> understand the sessions documentation.
>>>
>>>
>>
>> So, you didn't understand the documentation, but you also don't want to
>> be told what dictionaries/lists/tuples are.  How about you tell us which
>> bit of the examples under "Using sessions in views" (which I'm not linking
>> to because you've said you've read it) you didn't understand?
>> --
>> 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/-/0czW05_b8q8J.
>
> 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.
>



-- 
Marcin Tustin
Tel: 07773 787 105

-- 
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: Major Trouble Understanding Sessions Documentation

2012-08-02 Thread Gregory Thompson Jr.
Then how do I use the session to pass data between views?  What's wrong 
with my code?

If it counts for anything, *'text'* returns *'None'* in my debug statements 
(in the results() view).  

On Thursday, August 2, 2012 10:38:40 AM UTC-4, Marcin wrote:
>
> What's confusing about this? You don't explicitly create sessions, and 
> they last as long as they are configured to last, which by default is until 
> the session cookie is cleared.
>
> On Thu, Aug 2, 2012 at 10:31 AM, Gregory Thompson Jr. <
> spockthompso...@gmail.com> wrote:
>
>>
>>1. def login(request):
>>2. m = Member.objects.get(username=request.POST['username'])
>>3. if m.password == request.POST['password']:
>>4. request.session['member_id'] = m.id
>>5. return HttpResponse("You're logged in.")
>>6. else:
>>7. return HttpResponse("Your username and password didn't 
>>match.")
>>
>> How about that for starters?
>>
>> The documentation goes from that to explaining how to set cookies.  How 
>> do they expect me to understand what's going on?
>> There's absolutely NO explanation of what's going on in that code.  
>>
>> request.session['member_id'] = m.id 
>>
>> How the hell does that work?  
>>
>> They don't tell you where the session is started, how, what the scope of 
>> the session declaration is, etc...  
>>
>>
>> http://www.youtube.com/watch?v=YFd9NLZFmvo&playnext=1&list=PL6CB0A9FA1D9C736A&feature=results_video
>>   
>>  
>>
>> See that video?  The video shows you how to use sessions very quickly. 
>>  How did the person in the video get ALL of that code from just the 
>> documentation? 
>>
>> If all readers in this thread and kindly tackle each point I made, I 
>> promise you your own KFC when I start my empire.  Until then, I really just 
>> need someone to give me the step-by-step on this one.  I'm completely new 
>> to the framework and the documentation thus far has not been helpful.  I've 
>> mainly gotten by with the help of StackOverflow, IRC, and random code 
>> snippets online -- and occasionally, some outdated books.  
>>
>> If you don't want to explain or aren't going to ask me progressive 
>> questions with regards to my confusion, please just skip over my plight.
>>
>> Thank you all.
>>
>> On Thursday, August 2, 2012 9:54:21 AM UTC-4, Daniel Roseman wrote:
>>>
>>> On Thursday, 2 August 2012 14:06:04 UTC+1, Gregory Thompson Jr. wrote:

 

 I really don't understand the following, and I've read the documentation 
 over and over.  I've been on this for two days:


- How to initiate a session
- How sessions are checked
- How to retrieve form data from one page to handle the data on another.

 Again, I've read through the documentation.  I've asked on IRC but 
 everyone pretty much just says "RTFM" even when I tell them I have.  This 
 is absolutely frustrating as an extreme beginner.

 I'd also like to add that I DO understand the core Python language.  
 Please, unless it's absolutely necessary, don't try explaining to me what 
 a dictionary, tuple, list, etc... is.  I've already had my intelligence 
 insulted by the users on IRC in this regard.  I really just don't 
 understand the sessions documentation. 


>>>
>>> So, you didn't understand the documentation, but you also don't want to 
>>> be told what dictionaries/lists/tuples are.  How about you tell us which 
>>> bit of the examples under "Using sessions in views" (which I'm not linking 
>>> to because you've said you've read it) you didn't understand?
>>> --
>>> 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/-/0czW05_b8q8J.
>>
>> 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.
>>
>
>
>
> -- 
> Marcin Tustin
> Tel: 07773 787 105
>
>

-- 
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/-/GIPMRuHoti8J.
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: Major Trouble Understanding Sessions Documentation

2012-08-02 Thread Kurtis Mullins
Hey Gregory,

On Thu, Aug 2, 2012 at 9:06 AM, Gregory Thompson Jr. <
spockthompso...@gmail.com> wrote:

> I'd like to pass form data from one view to another.
>
> Here's my attempt:
>
> *#Models.py*
> from django import forms
> class Textizer(forms.Form):
> to_textize = forms.CharField(max_length=100)
>
> def __unicode__(self):
> return self.to_textize
> *#views.py*
> from textize.models import Textizer
> from django.http import HttpResponseRedirect
> from django.shortcuts import render_to_response
> from django.core.context_processors import csrf
> def index(request):
> if request.method == 'POST':
> form = Textizer(request.POST)
>
> if form.is_valid():
> request.session['text'] = form.cleaned_data['to_textize']
> return HttpResponseRedirect('/results')
>
> else:
> form = Textizer()
>
> c = {'form': form}
> c.update(csrf(request))
> return render_to_response('C:/Documents and 
> Settings/quansai/projects/textsite/templates/index.html', c)
> def results(request):
> text = request.session.get('text', None)
> c = {'text' : text}
> return render_to_response('C:/Documents and 
> Settings/quansai/projects/textsite/templates/results.html', c)
>
>
> I really don't understand the following, and I've read the documentation over 
> and over.  I've been on this for two days:
>
>
No problem! I'll try to clear things up for you.


>
>- How to initiate a session
>
> Sessions are initiated automatically in Django using the "Session
Middleware". Basically, on each request, a session is either started or
continued (in simple terms, there's probably more to it than that but I
haven't inspected Django's session code too deeply)

The only thing you need to do to make sure the session middleware is
properly configure it. It needs some sort of a storage (such as database,
file, cookies which are limited, etc...). You'll also need to make sure the
session middleware is included in your middleware configuration. This
configuration would exist under your settings.py and I believe is enabled
by default when creating new projects; at least that's been my experience
with Django 1.3+.

Keep in mind that these do use cookies, no matter what, so you will need
them enabled in whatever HTTP Client (browser, or what-not) you use.

Two links for enabling and configuring sessions (both on the same page,
these are anchor links).

Enabling Sessions:
https://docs.djangoproject.com/en/dev/topics/http/sessions/?from=olddocs/#enabling-sessions
Configuring Sessions:
https://docs.djangoproject.com/en/dev/topics/http/sessions/?from=olddocs/#configuring-the-session-engine


>- How sessions are checked
>
> I'm not quite sure what you mean, here. Sessions are checked to be valid
by Django by signing them, but this is done by the middleware. If you want
to check whether a session exists, you might be asking more along the lines
of checking to see whether a user is authenticated. Or, you may be asking
how to check whether a certain variable is available from the session.
Since I'm not sure which part your looking for information on, I'll give
you information on both:

To check if a particular object exists within the current session, follow
the example under __contains__(key) which actually does not call "contains"
but instead uses "if x in request.session":
https://docs.djangoproject.com/en/dev/topics/http/sessions/?from=olddocs/#using-sessions-in-views

To check whether a current user is authenticated (logged in), you could use
this example:
https://docs.djangoproject.com/en/dev/topics/auth/#authentication-in-web-requests


>
>- How to retrieve form data from one page to handle the data on another.
>
>
Retrieving Form Data is actually one of Django's extremely strong points
(in my opinion) although it does require a bit of a learning curve. Once
you get it down, it takes off a huge burden; especially when coming from
other frameworks that don't offer as much validation built in. Basically,
you subclass a Form, create an instance of your form in the view while
passing it the POST data, and it will validate that data. Then, you can
simply do some flow-control based upon "if form.is_valid()".

Handling the data on another view is sort of a vague question. I'm not
quite sure what you mean by this one but please feel free to elaborate and
I'll see if I can give you some more info here.


> Again, I've read through the documentation.  I've asked on IRC but everyone 
> pretty much just says "RTFM" even when I tell them I have.  This is 
> absolutely frustrating as an extreme beginner.
>
>
Weird. Most people just suggest reading the Tutorial. Have you given that a
shot? It really does help with diving into the functionality and doesn't
take too long considering the large amount of knowledge you gain about
Django from it.


>
> I'd also like to add that I DO understand the core Python language.  Please, 
> unless it's absolutely necessary, don't try ex

Re: Noob question

2012-08-02 Thread Kurtis Mullins
Syntax looks good -- but I didn't look at it too closely or try to execute
it. Run it and see if it complains :) (python manage.py sqlall)

I would recommend dropping your explicit primary keys. These are generated
automatically by Django.

On Thu, Aug 2, 2012 at 10:27 AM, Demian Brecht wrote:

> What, exactly are you confused about? What is your question?
>
> 2012/8/2 Robert 
>
>> Hi all, I´ve developed that model, but i´m quite confused about the
>> sintax, looks a bit freaky... Hers my code:
>>
>> from django.db import models
>>
>> ##
>>  PROJETOS 
>> ##
>>
>> class Projetos(models.Model):
>>
>> #PRIMARY KEY
>> i_id = models.AutoField(primary_key=True)
>>
>> #FIELDS
>> i_motivo_oferta = models.IntegerField()
>> s_nome_projeto = models.CharField("Projeto",max_length=100)
>> s_integrador = models.CharField("Integrador",max_length=100)
>> s_contend_provider = models.CharField("Contend
>> Provider",max_length=100)
>> s_marca_servico = models.CharField("Marca do
>> Serviço",max_length=100)
>>
>> ABRANGENCIA = (('R', 'Regional'),('N', 'Nacional'),)
>> s_abrangencia = models.CharField("Abrangência",max_length=2,
>> choices=ABRANGENCIA)
>>
>> TIPO_SERVICO = (('C', 'Cross'),('W', 'White Label'),)
>> i_id_tipo_servico =  models.CharField("Tipo de
>> Serviço",max_length=2, choices=TIPO_SERVICO)
>>
>> i_valor_retry = models.IntegerField("Valor de retry")
>> i_la =  models.IntegerField("Large account")
>> d_lanc_comercial = models.DateField("Lançamento comercial")
>> d_term_projeto = models.DateField("Término do projeto")
>>
>> ???
>> ??? PLANOS_DE_MIDIA = (('I', 'Internet'), ('T', 'TV'), ('R',
>> 'Radio'), ('R', 'Revista'), ('R', 'Midia Exterior'), ('R', 'Outros'),)
>> ??? i_plan_midia = models.CharField("Plano de
>> midia",max_length=2, choices=PLANOS_DE_MIDIA)
>> ???
>>
>> d_data_acordo = models.DateField("Data de Acordo")
>> d_data_revisao = models.DateField("Data de Revisão")
>> i_ura_id =  models.IntegerField("URA ID")
>> s_ura_desc = models.CharField("Descição URA",max_length=200)
>>
>> #FOREIGN KEY "Perfil_Servico"
>> i_id_perfil_servico = models.ForeignKey(Perfil_Servico)
>>
>>
>>
>> ###
>>   RELAÇÕES N -> 1  COM A TABELA PROJETOS  #
>> ###
>>
>> # Para cada "PROJETO" eu tenho varios Header Enrichment #
>> class Header_Enrich(models.Model):
>> #PRIMARY KEY
>> i_id = models.AutoField(primary_key=True)
>> #FIELDS
>> s_url = models.URLField("Url")
>> b_wap = models.BooleanField("Wap")
>> b_web = models.BooleanField("Web")
>> #FOREIGN KEY "Projetos"
>> i_id_projetos = models.ForeignKey(Projetos)
>>
>> # Para cada "PROJETO" eu tenho varias estimativas de trafego/receita
>> para cada mes do ano. #
>> class Traf_Receita(models.Model):
>> #PRIMARY KEY
>> i_id = models.AutoField(primary_key=True)
>> #FIELDS
>> i_mes = models.IntegerField("Mês")
>> i_ano = models.IntegerField("Ano")
>> i_trafego = models.IntegerField("Trafego")
>> i_receita = models.IntegerField("Receita")
>> #FOREIGN KEY "Projetos"
>> i_id_projetos = models.ForeignKey(Projetos)
>>
>> # Para cada "PROJETO" eu tenho varias tarifas e descrições. #
>> class Tarifar_Proj(models.Model):
>> #PRIMARY KEY
>> i_id = models.AutoField(primary_key=True)
>> #FIELDS
>> i_tarifa_proj = models.IntegerField("Tarifa")
>> s_desc_tarifa = models.CharField("Descrição da tarifa",
>> max_length=200)
>> #FOREIGN KEY "Projetos"
>> i_id_projetos = models.ForeignKey(Projetos)
>>
>> # Para cada "PROJETO" eu tenho varios planejamentos de midia. #
>> class Planej_Midia(models.Model):
>> #PRIMARY KEY
>> i_id = models.AutoField(primary_key=True)
>> #FIELDS
>> s_planej_midea = models.CharField("Planejamento de midia",
>> max_length=200)
>> s_desc_midea = models.CharField("Descrição", max_length=200)
>> #FOREIGN KEY "Projetos"
>> i_id_projetos = models.ForeignKey(Projetos)
>>
>> ###
>> ###  TABELAS FATO   ###
>> ###
>>
>> """
>> # Relaciona Projeto com Tipo de Servico
>> class Rel_Proj_Tipo_Servico(models.Model):
>> #PRIMARY KEY
>> i_id = models.AutoField(primary_key=True)
>> #FOREIGN KEY "Projetos" && "Motivo_Oferta"
>> i_id_projetos = models.ForeignKey(Projetos)
>> i_id_tipo_servico = models.ForeignKey(Tipo_Servico

Re: Major Trouble Understanding Sessions Documentation

2012-08-02 Thread Daniel Roseman
On Thursday, 2 August 2012 15:31:54 UTC+1, Gregory Thompson Jr. wrote:
>
>
>1. def login(request):
>2. m = Member.objects.get(username=request.POST['username'])
>3. if m.password == request.POST['password']:
>4. request.session['member_id'] = m.id
>5. return HttpResponse("You're logged in.")
>6. else:
>7. return HttpResponse("Your username and password didn't 
>match.")
>
> How about that for starters?
>
> The documentation goes from that to explaining how to set cookies.  How do 
> they expect me to understand what's going on?
> There's absolutely NO explanation of what's going on in that code.  
>
> request.session['member_id'] = m.id 
>
> How the hell does that work?  
>
> They don't tell you where the session is started, how, what the scope of 
> the session declaration is, etc...  
>
>
> http://www.youtube.com/watch?v=YFd9NLZFmvo&playnext=1&list=PL6CB0A9FA1D9C736A&feature=results_video
>   
>  
>
> See that video?  The video shows you how to use sessions very quickly. 
>  How did the person in the video get ALL of that code from just the 
> documentation? 
>
> If all readers in this thread and kindly tackle each point I made, I 
> promise you your own KFC when I start my empire.  Until then, I really just 
> need someone to give me the step-by-step on this one.  I'm completely new 
> to the framework and the documentation thus far has not been helpful.  I've 
> mainly gotten by with the help of StackOverflow, IRC, and random code 
> snippets online -- and occasionally, some outdated books.  
>
> If you don't want to explain or aren't going to ask me progressive 
> questions with regards to my confusion, please just skip over my plight.
>
> Thank you all.
>


I don't understand why you think you need to know these things in order to 
use sessions. If you want to understand how assigning to a session is 
implemented, you're free to dive into the code itself. But that's literally 
*all you need to do* in order to use the session in the view (assuming 
you've followed the rest of the instructions on that page, eg added the 
middleware).
--
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/-/iyInVbiR_XoJ.
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: Major Trouble Understanding Sessions Documentation

2012-08-02 Thread Marcin Tustin
This is how you store data:
 request.session['member_id'] = m.id
This is how you read it:
 request.session['member_id']

Your view code looks fine, in respect of how you use sessions. I can't see
that you have explained what problem you are having: what is going wrong?

Finally, you do have to do some minimal configuration to enable sessions.
Are you sure you have done that?

On Thu, Aug 2, 2012 at 10:42 AM, Gregory Thompson Jr. <
spockthompso...@gmail.com> wrote:

> Then how do I use the session to pass data between views?  What's wrong
> with my code?
>
> If it counts for anything, *'text'* returns *'None'* in my debug
> statements (in the results() view).
>
>
> On Thursday, August 2, 2012 10:38:40 AM UTC-4, Marcin wrote:
>>
>> What's confusing about this? You don't explicitly create sessions, and
>> they last as long as they are configured to last, which by default is until
>> the session cookie is cleared.
>>
>> On Thu, Aug 2, 2012 at 10:31 AM, Gregory Thompson Jr. <
>> spockthompso...@gmail.com> wrote:
>>
>>>
>>>1. def login(request):
>>>2. m = Member.objects.get(username=**request.POST['username'])
>>>3. if m.password == request.POST['password']:
>>>4. request.session['member_id'] = m.id
>>>5. return HttpResponse("You're logged in.")
>>>6. else:
>>>7. return HttpResponse("Your username and password didn't
>>>match.")
>>>
>>> How about that for starters?
>>>
>>> The documentation goes from that to explaining how to set cookies.  How
>>> do they expect me to understand what's going on?
>>> There's absolutely NO explanation of what's going on in that code.
>>>
>>> request.session['member_id'] = m.id
>>>
>>> How the hell does that work?
>>>
>>> They don't tell you where the session is started, how, what the scope of
>>> the session declaration is, etc...
>>>
>>> http://www.youtube.com/watch?**v=YFd9NLZFmvo&playnext=1&list=**
>>> PL6CB0A9FA1D9C736A&feature=**results_video
>>>
>>>
>>> See that video?  The video shows you how to use sessions very quickly.
>>>  How did the person in the video get ALL of that code from just the
>>> documentation?
>>>
>>> If all readers in this thread and kindly tackle each point I made, I
>>> promise you your own KFC when I start my empire.  Until then, I really just
>>> need someone to give me the step-by-step on this one.  I'm completely new
>>> to the framework and the documentation thus far has not been helpful.  I've
>>> mainly gotten by with the help of StackOverflow, IRC, and random code
>>> snippets online -- and occasionally, some outdated books.
>>>
>>> If you don't want to explain or aren't going to ask me progressive
>>> questions with regards to my confusion, please just skip over my plight.
>>>
>>> Thank you all.
>>>
>>> On Thursday, August 2, 2012 9:54:21 AM UTC-4, Daniel Roseman wrote:

 On Thursday, 2 August 2012 14:06:04 UTC+1, Gregory Thompson Jr. wrote:
>
> 
>
> I really don't understand the following, and I've read the documentation 
> over and over.  I've been on this for two days:
>
>
>- How to initiate a session
>- How sessions are checked
>- How to retrieve form data from one page to handle the data on 
> another.
>
> Again, I've read through the documentation.  I've asked on IRC but 
> everyone pretty much just says "RTFM" even when I tell them I have.  This 
> is absolutely frustrating as an extreme beginner.
>
> I'd also like to add that I DO understand the core Python language.  
> Please, unless it's absolutely necessary, don't try explaining to me what 
> a dictionary, tuple, list, etc... is.  I've already had my intelligence 
> insulted by the users on IRC in this regard.  I really just don't 
> understand the sessions documentation.
>
>

 So, you didn't understand the documentation, but you also don't want to
 be told what dictionaries/lists/tuples are.  How about you tell us which
 bit of the examples under "Using sessions in views" (which I'm not linking
 to because you've said you've read it) you didn't understand?
 --
 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/-/0czW05_**b8q8J
>>> .
>>>
>>> To post to this group, send email to django-users@googlegroups.com.
>>> To unsubscribe from this group, send email to django-users+unsubscribe@*
>>> *googlegroups.com .
>>> For more options, visit this group at http://groups.google.com/**
>>> group/django-users?hl=en
>>> .
>>>
>>
>>
>>
>> --
>> Marcin Tustin
>> Tel: 07773 787 105
>>
>>  --
> You received this 

Re: Major Trouble Understanding Sessions Documentation

2012-08-02 Thread Gregory Thompson Jr.
Thanks a load!  You've cleared up a lot!

Yes, I have read through the tutorial.  I even wrote a shortened version of 
it to act as notes as I learn:  http://polydoo.com/code/?p=48  (my blog)

Thanks again!

On Thursday, August 2, 2012 10:42:59 AM UTC-4, Kurtis wrote:
>
> Hey Gregory,
>
> On Thu, Aug 2, 2012 at 9:06 AM, Gregory Thompson Jr. <
> spockthompso...@gmail.com> wrote:
>
>> I'd like to pass form data from one view to another.  
>>
>> Here's my attempt: 
>>
>> *#Models.py*
>> from django import forms
>> class Textizer(forms.Form):
>> to_textize = forms.CharField(max_length=100)
>> 
>> def __unicode__(self):
>> return self.to_textize
>> *#views.py*
>> from textize.models import Textizer
>> from django.http import HttpResponseRedirect
>> from django.shortcuts import render_to_response
>> from django.core.context_processors import csrf
>> def index(request):
>> if request.method == 'POST':
>> form = Textizer(request.POST)
>> 
>> if form.is_valid():
>> request.session['text'] = form.cleaned_data['to_textize']
>> return HttpResponseRedirect('/results')
>> 
>> else:
>> form = Textizer()
>> 
>> c = {'form': form}
>> c.update(csrf(request))
>> return render_to_response('C:/Documents and 
>> Settings/quansai/projects/textsite/templates/index.html', c)
>> def results(request):
>> text = request.session.get('text', None)
>> c = {'text' : text}
>> return render_to_response('C:/Documents and 
>> Settings/quansai/projects/textsite/templates/results.html', c)
>>
>>
>> I really don't understand the following, and I've read the documentation 
>> over and over.  I've been on this for two days:
>>
>>
> No problem! I'll try to clear things up for you.
>  
>
>>
>>- How to initiate a session
>>
>> Sessions are initiated automatically in Django using the "Session 
> Middleware". Basically, on each request, a session is either started or 
> continued (in simple terms, there's probably more to it than that but I 
> haven't inspected Django's session code too deeply)
>
> The only thing you need to do to make sure the session middleware is 
> properly configure it. It needs some sort of a storage (such as database, 
> file, cookies which are limited, etc...). You'll also need to make sure the 
> session middleware is included in your middleware configuration. This 
> configuration would exist under your settings.py and I believe is enabled 
> by default when creating new projects; at least that's been my experience 
> with Django 1.3+.
>
> Keep in mind that these do use cookies, no matter what, so you will need 
> them enabled in whatever HTTP Client (browser, or what-not) you use.
>
> Two links for enabling and configuring sessions (both on the same page, 
> these are anchor links).
>
> Enabling Sessions: 
> https://docs.djangoproject.com/en/dev/topics/http/sessions/?from=olddocs/#enabling-sessions
> Configuring Sessions: 
> https://docs.djangoproject.com/en/dev/topics/http/sessions/?from=olddocs/#configuring-the-session-engine
>
>
>>- How sessions are checked
>>
>> I'm not quite sure what you mean, here. Sessions are checked to be valid 
> by Django by signing them, but this is done by the middleware. If you want 
> to check whether a session exists, you might be asking more along the lines 
> of checking to see whether a user is authenticated. Or, you may be asking 
> how to check whether a certain variable is available from the session. 
> Since I'm not sure which part your looking for information on, I'll give 
> you information on both:
>
> To check if a particular object exists within the current session, follow 
> the example under __contains__(key) which actually does not call "contains" 
> but instead uses "if x in request.session": 
> https://docs.djangoproject.com/en/dev/topics/http/sessions/?from=olddocs/#using-sessions-in-views
>
> To check whether a current user is authenticated (logged in), you could 
> use this example: 
> https://docs.djangoproject.com/en/dev/topics/auth/#authentication-in-web-requests
>  
>
>>
>>- How to retrieve form data from one page to handle the data on another.
>>
>>
> Retrieving Form Data is actually one of Django's extremely strong points 
> (in my opinion) although it does require a bit of a learning curve. Once 
> you get it down, it takes off a huge burden; especially when coming from 
> other frameworks that don't offer as much validation built in. Basically, 
> you subclass a Form, create an instance of your form in the view while 
> passing it the POST data, and it will validate that data. Then, you can 
> simply do some flow-control based upon "if form.is_valid()".
>
> Handling the data on another view is sort of a vague question. I'm not 
> quite sure what you mean by this one but please feel free to elaborate and 
> I'll see if I can give you some more info here.
>  
>
>> Again, I've read through the documentation.  I've asked on IRC b

Re: Detecting browser type after login

2012-08-02 Thread Andreas Schosser
Hi Larry

> They want the dialog to pop up on top of the login screen before the
> redirect. I don't know where the code that does this would live or how
> it would get invoked.
> 
> As far as to why they want this, it doesn't really support IE, and
> they want to alert the user to that if that's what they're using. It's
> a custom app, not for public use.

So why don't you catch the form.submit event with JavaScript and notify
the user about any issues with his browser.
Then you could either prevent them from proceeding or call the
form.submit within your JavaScript code.

No server side logic is necessary but of course it only works with
JavaScript enabled.

Greetings
Andreas

-- 
state of mind ()

http://www.state-of-mind.de

Franziskanerstraße 15  Telefon +49 89 3090 4664
81669 München  Telefax +49 89 3090 4666

Amtsgericht MünchenPartnerschaftsregister PR 563

-- 
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: Major Trouble Understanding Sessions Documentation

2012-08-02 Thread Kurtis Mullins
On Thu, Aug 2, 2012 at 10:57 AM, Gregory Thompson Jr. <
spockthompso...@gmail.com> wrote:

> Thanks a load!  You've cleared up a lot!
>
> Yes, I have read through the tutorial.  I even wrote a shortened version
> of it to act as notes as I learn:  http://polydoo.com/code/?p=48  (my
> blog)
>
> Thanks again!
>

No problem! Have fun and let us know if you have any more questions!

-- 
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: Detecting browser type after login

2012-08-02 Thread Kurtis Mullins
Sorry I didn't catch this part. You could modify your "Login" view to check
the user agent and if it's an incompatible browser, and simply return a
template that tells them their browser is unsupported. I'd do this before
they even hit the Login Form just to be courteous to the user. But this
modification would to be done in the Login view or whichever view(s)
present the Login Form.

If you want to implement this site-wide, simply make your own custom
middleware that looks for this user agent and display
the fore-mentioned template.

The JavaScript idea mentioned by Andreas would be a great solution as well.

On Thu, Aug 2, 2012 at 11:13 AM, Andreas Schosser wrote:

> Hi Larry
>
> > They want the dialog to pop up on top of the login screen before the
> > redirect. I don't know where the code that does this would live or how
> > it would get invoked.
> >
> > As far as to why they want this, it doesn't really support IE, and
> > they want to alert the user to that if that's what they're using. It's
> > a custom app, not for public use.
>
> So why don't you catch the form.submit event with JavaScript and notify
> the user about any issues with his browser.
> Then you could either prevent them from proceeding or call the
> form.submit within your JavaScript code.
>
> No server side logic is necessary but of course it only works with
> JavaScript enabled.
>
> Greetings
> Andreas
>
> --
> state of mind ()
>
> http://www.state-of-mind.de
>
> Franziskanerstraße 15  Telefon +49 89 3090 4664
> 81669 München  Telefax +49 89 3090 4666
>
> Amtsgericht MünchenPartnerschaftsregister PR 563
>
> --
> 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: Issue Deploying Django

2012-08-02 Thread Kurtis Mullins
I'd recommend another host. There's many issues you may run into with using
a shared hosting provider that doesn't explicitly support Django. The best
option (in my opinion) is to just get a cheap Cloud Server if you're up for
the task of managing them ($10/month at Rackspace or Free for one year at
Amazon). Sorry for the bad news :/ Maybe someone else can chime in and give
you better information? I've just had extremely bad luck with trying to do
anything other than run PHP on "traditional" shared hosts.

On Wed, Aug 1, 2012 at 8:31 PM, JJ Zolper  wrote:

> I'm trying to install GEOS and on my bluehost account under my django_src
> folder and what happened in the image happened.
>
> it said cannot create directory permission denied so i tired sudo make
> install after what I had just done ( "make" ).
>
> and then it said whats in the second image.
>
> When I tried to run:
>
> ./manage.py runfcgi [options]
>
> I got an error about GEOS so that's why I was doing that.
>
> Thanks for the help.
>
> JJ
>
> On Wednesday, August 1, 2012 1:03:21 PM UTC-4, JJ Zolper wrote:
>>
>> Thanks so much for the reply!
>>
>> I had a feeling I would need it but I just like to be sure before I act.
>>
>> Another thing. On Ubuntu there were additional packages I had to install.
>> I believe one was called "psycopg2-python-dev" or something like that.
>>
>> If I install psycopg2-python at:
>>
>> http://www.initd.org/psycopg/
>>
>> Are there any additional packges that I might need?
>>
>> I apologize for not being able to remember the additional ones I added
>> before on Ubuntu but I'm at work and couldn't find in my installation
>> history what they might have been or in my django google group discussions.
>>
>> I feel like one was called "libpq-dev" actually.
>>
>> Thanks for the help.
>>
>> JJ
>>
>> On Wednesday, August 1, 2012 2:07:54 AM UTC-4, lawgon wrote:
>>>
>>> On Tue, 2012-07-31 at 20:52 -0700, JJ Zolper wrote:
>>> > Do I need to go through and install the python like adapters is that
>>> > what it's complaining about? I don't think this has to do with my
>>> > Django code on the server it's just a file missing right?
>>>
>>> you need to install pycopg - and it is nothing to do with your code
>>> --
>>> regards
>>> Kenneth Gonsalves
>>>
>>>  --
> 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/-/0Jx03fySUVUJ.
>
> 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: Detecting browser type after login

2012-08-02 Thread Larry Martell
On Thu, Aug 2, 2012 at 8:18 AM, Kurtis Mullins  wrote:
> Hey Larry,

Thanks for the reply Kurtis.

> Okay, let me make sure I understand this correctly. This is, essentially,
> the flow of control you'd like to implement:
>
> 1. User signs in successfully
> 2. User is redirected to some other (any other) page
> 3. User is presented with a one-time only popup

Yes, that is correct. The popup would be displayed only if they are running IE.

> The simple way to implement something *similar* to this would be using the
> Django Messaging Framework. Of course, this framework will not (without a
> huge hack) do exactly what you want. However, you could most likely take the
> basis of the Messaging Framework and implement similar functionality,
> yourself.
>
> Without looking myself, I imagine you'd have a data structure that would be
> stored in the user's session and a custom template tag which would look for
> this particular data. If that custom template tag finds the data, it does
> *something* (display popup, or whatever logic you may need specialized
> there). Then, simply put this custom template tag (or possibly variants of
> this tag) on your templates which may need to provide this functionality.
>
> Here's a link for the messaging framework, just in case your not familiar
> with it:  https://docs.djangoproject.com/en/dev/ref/contrib/messages/  --
> Again, that's not the proper use of the messages framework but at an
> abstract level I picture it following a similar path.

Thanks. I'm not familiar with the messaging framework. I'll look into that.

> To try and clear up some of the questions/issues you mentioned specifically,
> read below.
>
> On Wed, Aug 1, 2012 at 9:44 PM, Larry Martell 
> wrote:
>>
>> >>
>> >> Another issue with this is that I only want to display the pop up
>> >> once, immediately after they login. I don't think I can tell if that's
>> >> the case in the view, only in the code that is called after login().
>
>
> Using the technique described above, this would happen programmatically
> because the template tag would simply "pop" or delete your data after it is
> used. The next time the template tag looks for that same data, it won't be
> there; unless the user logs in again.
>
>>
>> >
>> > So what I ended up doing was to add a session-cookie with the
>> > popup-information. I can then access in the base template, but the
>> > issue I am having now is that they want the popup to be on top of the
>> > login screen, and it's displaying on a blank screen, after the login
>> > screen is cleared. ARHG!
>
>
> Sorry but I'm not quite following you here. Can you give us more information
> about your "blank screen"? Also, could you clarify what you mean by "the
> login screen is cleared"?


When the user is redirected to a page, and that code sends a response
to the browser, it clears the page, and renders the new content. I
have this working using the session data to pass the browser type from
the code that does the redirect to the template, but when the popup is
displayed the login screen is gone. It displays between when the page
is cleared and the new content is rendered.

>
>>
>>
>> So it would appear there is no way to send data from django to the
>> browser that updates the page without first clearing it. Is that true?
>
>
> I'm a bit vague on this one, as well. However, there is no way to send data
> from django to the browser after the page has loaded. I'm not sure what you
> mean by "without first clearing it". You could always use AJAX but I don't
> think that's the problem at hand, 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.

-- 
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: Detecting browser type after login

2012-08-02 Thread Larry Martell
On Thu, Aug 2, 2012 at 9:13 AM, Andreas Schosser  wrote:
> Hi Larry
>
>> They want the dialog to pop up on top of the login screen before the
>> redirect. I don't know where the code that does this would live or how
>> it would get invoked.
>>
>> As far as to why they want this, it doesn't really support IE, and
>> they want to alert the user to that if that's what they're using. It's
>> a custom app, not for public use.
>
> So why don't you catch the form.submit event with JavaScript and notify
> the user about any issues with his browser.
> Then you could either prevent them from proceeding or call the
> form.submit within your JavaScript code.

They want the popup displayed after the user has successfully logged
in. That requires a trip to the server.

-- 
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: Detecting browser type after login

2012-08-02 Thread Larry Martell
On Thu, Aug 2, 2012 at 9:24 AM, Kurtis Mullins  wrote:
> Sorry I didn't catch this part. You could modify your "Login" view to check
> the user agent and if it's an incompatible browser, and simply return a
> template that tells them their browser is unsupported. I'd do this before
> they even hit the Login Form just to be courteous to the user. But this
> modification would to be done in the Login view or whichever view(s) present
> the Login Form.
>
> If you want to implement this site-wide, simply make your own custom
> middleware that looks for this user agent and display the fore-mentioned
> template.
>
> The JavaScript idea mentioned by Andreas would be a great solution as well.

The want the user to be able to continue to use the app. The popup is
just to advise them that some features may not work. So I have to
still pass them through to whatever they're getting redirected to, and
not just stop.

>
>
> On Thu, Aug 2, 2012 at 11:13 AM, Andreas Schosser 
> wrote:
>>
>> Hi Larry
>>
>> > They want the dialog to pop up on top of the login screen before the
>> > redirect. I don't know where the code that does this would live or how
>> > it would get invoked.
>> >
>> > As far as to why they want this, it doesn't really support IE, and
>> > they want to alert the user to that if that's what they're using. It's
>> > a custom app, not for public use.
>>
>> So why don't you catch the form.submit event with JavaScript and notify
>> the user about any issues with his browser.
>> Then you could either prevent them from proceeding or call the
>> form.submit within your JavaScript code.
>>
>> No server side logic is necessary but of course it only works with
>> JavaScript enabled.
>>
>> Greetings
>> Andreas
>>
>> --
>> state of mind ()
>>
>> http://www.state-of-mind.de
>>
>> Franziskanerstraße 15  Telefon +49 89 3090 4664
>> 81669 München  Telefax +49 89 3090 4666
>>
>> Amtsgericht MünchenPartnerschaftsregister PR 563
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To post to this group, send email to django-users@googlegroups.com.
>> To unsubscribe from this group, send email to
>> django-users+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/django-users?hl=en.
>>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.

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



Re: Detecting browser type after login

2012-08-02 Thread Kurtis Mullins
Ahh okay, Then yeah,  something similar to the messages framework may work
well for you in this case. You could even use the messages framework
directly in a "hackish" sort of way just by putting some code in your
template that looks for a Messages Warning and spits out javascript
accordingly. Shouldn't take but 15 minutes to implement.

On Thu, Aug 2, 2012 at 12:17 PM, Larry Martell wrote:

> On Thu, Aug 2, 2012 at 9:24 AM, Kurtis Mullins 
> wrote:
> > Sorry I didn't catch this part. You could modify your "Login" view to
> check
> > the user agent and if it's an incompatible browser, and simply return a
> > template that tells them their browser is unsupported. I'd do this before
> > they even hit the Login Form just to be courteous to the user. But this
> > modification would to be done in the Login view or whichever view(s)
> present
> > the Login Form.
> >
> > If you want to implement this site-wide, simply make your own custom
> > middleware that looks for this user agent and display the fore-mentioned
> > template.
> >
> > The JavaScript idea mentioned by Andreas would be a great solution as
> well.
>
> The want the user to be able to continue to use the app. The popup is
> just to advise them that some features may not work. So I have to
> still pass them through to whatever they're getting redirected to, and
> not just stop.
>
> >
> >
> > On Thu, Aug 2, 2012 at 11:13 AM, Andreas Schosser 
> > wrote:
> >>
> >> Hi Larry
> >>
> >> > They want the dialog to pop up on top of the login screen before the
> >> > redirect. I don't know where the code that does this would live or how
> >> > it would get invoked.
> >> >
> >> > As far as to why they want this, it doesn't really support IE, and
> >> > they want to alert the user to that if that's what they're using. It's
> >> > a custom app, not for public use.
> >>
> >> So why don't you catch the form.submit event with JavaScript and notify
> >> the user about any issues with his browser.
> >> Then you could either prevent them from proceeding or call the
> >> form.submit within your JavaScript code.
> >>
> >> No server side logic is necessary but of course it only works with
> >> JavaScript enabled.
> >>
> >> Greetings
> >> Andreas
> >>
> >> --
> >> state of mind ()
> >>
> >> http://www.state-of-mind.de
> >>
> >> Franziskanerstraße 15  Telefon +49 89 3090 4664
> >> 81669 München  Telefax +49 89 3090 4666
> >>
> >> Amtsgericht MünchenPartnerschaftsregister PR 563
> >>
> >> --
> >> 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.
>
>

-- 
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: Noob question

2012-08-02 Thread Tomas Neme
as Kurtis says, drop the explicit Primary Keys, and drop the hungarian
notation as well (don't declare the variable type on it's name): I
don't need to be reminded that the name of a project will be a string,
it's pretty obvious. Also, python standards talk against using
underscore in class names, so standard naming would be HeaderEnrich
instead of Header_Enrich. Underscores for field names are good. I'd
also use less abbreviations.

also, I'd name the FK on that model just "projeto", since what you'll
get when you do `headerenrichobject.projeto` will be a Projeto object,
not it's ID

Try to forget the underlying database, the ORM is there to abstract you from it.

But all these are style things, the syntax looks good, so it's all
your call, but getting used to standardized style will make your life
easier, as well as the life of people who try to help you in mailing
lists and IRC channels

-- 
"The whole of Japan is pure invention. There is no such country, there
are no such people" --Oscar Wilde

|_|0|_|
|_|_|0|
|0|0|0|

(\__/)
(='.'=)This is Bunny. Copy and paste bunny
(")_(") to help him gain world domination.

-- 
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: Issue Deploying Django

2012-08-02 Thread Alex Strickland

On 2012/08/02 05:42 PM, Kurtis Mullins wrote:


I'd recommend another host. There's many issues you may run into with
using a shared hosting provider that doesn't explicitly support Django.
The best option (in my opinion) is to just get a cheap Cloud Server if
you're up for the task of managing them ($10/month at Rackspace or Free
for one year at Amazon). Sorry for the bad news :/ Maybe someone else
can chime in and give you better information? I've just had extremely
bad luck with trying to do anything other than run PHP on "traditional"
shared hosts.


Glad to hear you say that, as I have just opted for AWS (using the 
Bitnami Django stack), and it's nice to hear that I might have done the 
right thing.


--
Regards
Alex

--
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: Noob question

2012-08-02 Thread Roberto Ferreira Junior
Thanks guys for all replies, an especial thanks to Kurtis, I followed all
your tips and my code looks very clean and objective, agree to leave the
underscore from classes name! Although I really appreciate hungarian
notation, without them my vars is so much objective! :)

Cheers

On Thu, Aug 2, 2012 at 3:34 PM, Tomas Neme  wrote:

> as Kurtis says, drop the explicit Primary Keys, and drop the hungarian
> notation as well (don't declare the variable type on it's name): I
> don't need to be reminded that the name of a project will be a string,
> it's pretty obvious. Also, python standards talk against using
> underscore in class names, so standard naming would be HeaderEnrich
> instead of Header_Enrich. Underscores for field names are good. I'd
> also use less abbreviations.
>
> also, I'd name the FK on that model just "projeto", since what you'll
> get when you do `headerenrichobject.projeto` will be a Projeto object,
> not it's ID
>
> Try to forget the underlying database, the ORM is there to abstract you
> from it.
>
> But all these are style things, the syntax looks good, so it's all
> your call, but getting used to standardized style will make your life
> easier, as well as the life of people who try to help you in mailing
> lists and IRC channels
>
> --
> "The whole of Japan is pure invention. There is no such country, there
> are no such people" --Oscar Wilde
>
> |_|0|_|
> |_|_|0|
> |0|0|0|
>
> (\__/)
> (='.'=)This is Bunny. Copy and paste bunny
> (")_(") to help him gain world domination.
>
> --
> 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.
>
>


-- 
--
Roberto Ferreira Junior
+5511-98009942
robefe...@gmail.com

-- 
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: Returning data belonging to a model (FK)

2012-08-02 Thread Melvyn Sopacua
On 27-7-2012 14:47, David wrote:

> I am using the above code to isolate any fields in self._meta.fields that 
> are foreign keys. I need to get data from these foreignkey relations to 
> other models.
> 
> Is this possible please?

Depends what you need to do with it. I'm doing something similar for my
JSONResponseMixin and recursively visit foreign keys. However, since
models are converted to dictionaries by this method, I just tack on the
result as a another dict, so for a city model you'd get:
{
'name': 'Amsterdam',
'country': { 'name': 'Netherlands', 'code': 'NL' }
}

The principle applies though, you can fetch the fields you want and tack
on the result on whatever object instance you want to tack it on that
you have access to. You can't however tack it on to classes, or at least
I'm not seeing an easy way to do 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: django-allauth and signup or login via twitter?

2012-08-02 Thread Carlos Leite
I've never used allauth.

 I build an app with login via twitter using  django-social-auth instead.
I just follow the doc steps.

If you'd like to see the code  [1]

[1] - 
https://github.com/znc-sistemas/python-people/commit/caf37acc0be9530de1c3a43aa5a525ccba266519

git it a try : pythonpeople.znc.com.br


On Tue, Jul 31, 2012 at 11:22 PM, HL  wrote:
> I am trying to work with django-allauth. I followed the instructions at
> github page and done following:
>
> 1. Added allauth urls into urls.py
>
>> urlpatterns += patterns ('',
>> url('^accounts/', include('allauth.urls')),
>> url('^accounts/profile/$', ProfileView.as_view(), name='ProfileView'),
>> url('^login/$', login, name='account_login'),
>> url('^logout/$', logout, name='account_logout'),
>> url('^login/cancelled/$', login_cancelled,
>> name='socialaccount_login_cancelled'),
>> url('^login/error/$', login_error, name='socialaccount_login_error'),
>> )
>
>
> 2. Updated TEMPLATE_CONTEXT_DIRS, TEMPLATE_CONTEXT_PROCESSORS,
> AUTHENTICATION_BACKENDS and INSTALLED_APPS. Also added
> ACCOUNT_AUTHENTICATION_METHOD = "username_email"
>
> 3. Added Key and Secret for twitter in the Social apps table.
>
> 4. Copied django-allauth templates to my app's directory and modified it. I
> can see all the templates working fine like /accounts/signup/ and
> /accounts/social/connections/.
>
> Now, from connections or signup when I click Twitter link
> /accounts/twitter/login/ I ended up with the following error:
>
>> Social Network Login Failure
>> An error occured while attempting to login via your social network
>> account.
>
>
> Am I missing something? Did anybody ever try to login or sign up using
> twitter? I tried to search for all solution on the web but was not able to
> find any. If this thing doesn't work then I would like to try
> django-social-auth.
>
> Thanks in advance.
>
> --
> 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/-/t2PaUkNqN4QJ.
> 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.



-- 

Cadu Leite
http://pythonpeople.znc.com.br/

-- 
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: Adding more data to Generic Views

2012-08-02 Thread Melvyn Sopacua
On 31-7-2012 22:45, Lachlan Musicman wrote:

> Yes, I was doing that originally (when there was no Compensation objects),
> but I was struggling with only rendering when a set existed - for example,
> in my person_detail.html I was rendering from the wrong direction - via the
> non-Person object via "related name" fields on the FK.
> 
> {% if person.jobs %}

{% if person.jobs.count %}

person.jobs always exists as it is the related manager. If count is zero
the if statement resolves to false.

> Ok, thanks. I'm still confused about the usefulness of subclassing, given
> that object_set exists? I presuming it's to have the actual objects in the
> context, not just a reference to them?

No, it's primarily useful to provide data that have no relation to the
model you're presenting. Like "today's shoe discounts" displayed on the
"blue women pants" page are unrelated models (from a technical
perspective ;) ).
Another example is if you want to pass some parameters by query string
to only a few pages, but otherwise in the site don't use the request
context processor [1]:

def get_context_data(self, **kwargs) :
context = super(MyView, self).get_context_data(**kwargs)
context['qs'] = self.request.GET
return context

[1]

-- 
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: Weird test-behaviour in combination with localization

2012-08-02 Thread Melvyn Sopacua
On 31-7-2012 21:21, Andre Schemschat wrote:

> Now, if i run all tests, not just for that specific view, the test fails, 
> because the view returnes {'fielda':'This field is required.'} instead of 
> the german localization. I checked the settings.LANGUAGE_CODE-value in the 
> view and in the test, in both cases it is de-de.
> Any ideas, why my test is fine if it runs alone and fails when all tests of 
> the project (including the django-ones) are run? Im fresh out of ideas and 
> a little bit puzzled :D

On a hunch, I suspect the LOCALE_PATHS setting to be the culprit.

-- 
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: ContentType and multiple database

2012-08-02 Thread Melvyn Sopacua
On 1-8-2012 17:27, Àlex Pérez wrote:
> Hello,
> 
> I want to take objects of another project that i don't have installed.
> I can have the contenttype of the external object but I can't take the
> object I understand that, take the object remotly  of a model thah you
> dosen't have have the class is not possible (I think...) but if i want only
> a value i think that could be reasonable...
> 
> I want to tho something like that:
> 
>  c = ContentType.objects.using("site").get(pk=self.ext_content_id)
>  obj = c.get_object_for_this_type(pk=self.ext_object_id).values("nombre")

Rather then fighting the project separation, the easiest solution by far
is to make the data available by webrequest in a format you can read,
like json or XML and use python's httplib to fetch it.

-- 
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: TinyMCE config

2012-08-02 Thread Jonathan Baker
Thanks for the responses, but I'm still stuck. For now, I'm just trying to
add TinyMCE to FlatPages within the Django admin app. When I visit
http://127.0.0.1:8000/admin/flatpages/flatpage/add/ the 'content' textarea
is rendered without the WYSiWYG, and I don't see any 404s in the terminal
looking for JS files.

Here is the current setup:
*myapp/forms.py *http://pastebin.com/C1xNzNES
*urls.py *http://pastebin.com/JWC3SVka
*settings.py *http://pastebin.com/eC8NkMER
*local_settings.py *http://pastebin.com/m78ZC2Z7

As you'll see, I installed the app, included the URLs, configured static
and media for local development and then followed the instructions on
https://github.com/jondbaker/django-tinymce/blob/master/docs/usage.rst to
use the TinyMCE widget on the 'content' field of the FlatPages form in the
admin.


On Thu, Aug 2, 2012 at 1:11 AM, Aljoša Mohorović  wrote:

> On Thu, Aug 2, 2012 at 3:19 AM, jondbaker 
> wrote:
> > TINYMCE_JS_URL = os.path.join(PROJECT_ROOT,
> > 'templates/static/js/tiny_mce/tiny_mce.js')
> > TINYMCE_JS_ROOT = os.path.join(PROJECT_ROOT,
> 'templates/static/js/tiny_mce')
>
> You don't need to set TINYMCE_JS_URL/TINYMCE_JS_ROOT because it is set
> automatically based on staticfiles settings.
> It's available as configuration option if you need to override default
> setup.
> When you "pip install django-tinymce" all required files are copied so
> you can skip step 4 as described in docs, you just need to set
> STATIC_ROOT/STATIC_URL.
>
> basically, if you have tinymce in INSTALLED_APPS and urlpatterns and
> django has staticfiles properly configured it will work as expected.
>
> let me know if you're still having issues w/ setup and feel free to
> contact me if you have any questions.
>
> Aljosa
> --
> https://twitter.com/maljosa
> https://github.com/aljosa
>
> --
> 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.
>
>


-- 
Jonathan D. Baker
Developer
http://jonathandbaker.com

-- 
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: Issue Deploying Django

2012-08-02 Thread JJ Zolper
Yes it seems that way. Thats because its shared hosting and i dont have root 
privleges. bluehost has hindered what I can do with Django.

But does a cloud server at rackspace have root privleges like a vps? because i 
think i need to install these geospatial libraries to be able to really make 
forward progress with my site.

I bought this hosting at bluehost a while ago but i didnt know as much as i do 
know about django and what i need etc so im thinking a new host. Either 
slicehost, maybe a cloud server, something like that with full control like 
root.

JJ

-- 
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/-/jLF6C23y1pEJ.
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: Issue Deploying Django

2012-08-02 Thread william ratcliff
I will say that I've had pretty good luck hosting with webfaction and
installing packages locally.  They also have really good support--I'd tell
them your use case and ask them if it would work with them.   Even though
it's shared hosting, I do have ssh--though not root

William

On Thu, Aug 2, 2012 at 6:03 PM, JJ Zolper  wrote:

> Yes it seems that way. Thats because its shared hosting and i dont have
> root privleges. bluehost has hindered what I can do with Django.
>
> But does a cloud server at rackspace have root privleges like a vps?
> because i think i need to install these geospatial libraries to be able to
> really make forward progress with my site.
>
> I bought this hosting at bluehost a while ago but i didnt know as much as
> i do know about django and what i need etc so im thinking a new host.
> Either slicehost, maybe a cloud server, something like that with full
> control like root.
>
> JJ
>
> --
> 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/-/jLF6C23y1pEJ.
> 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: Return SQL calculation within queryset

2012-08-02 Thread Melvyn Sopacua
On 25-7-2012 2:03, jondbaker wrote:
> I've implemented the spherical law of cosines to aid in proximity-based 
> searching.

Is there a specific reason you're not using GeoDjango?
Specifically:

-- 
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: Url regex keeps django busy/crashing

2012-08-02 Thread Melvyn Sopacua
On 26-7-2012 16:45, Joe wrote:
> Hey, I have a url regex like this which is keeping django extremely busy 
> (20secs to 1min to handle a request). On some urls it even crashes.
> 
> my regex:
> 
> url(r'^(?P(\w+-?)*)/$', 'detail'),

Turn the * into a + and you'll see great improvements and I also think
you don't want to match '//' as a valid URL part.
Also, I think this example will satisfy your requirements in practice:

url(r'^(?P\w[\w-]+-/$', 'detail')

The only difference is that dashes are allowed to follow each other. I
can only think of one valid reason to not use the above URL and that is
if "multiple dashes" are captured in another URL.
Remember that URL patterns are not your validators. It's nice if you can
prevent a view from being called by carefully constructing your URL
patterns, but if parsing the regex takes longer then calling the view
you loose performance instead.
Also, validating if a URL contains two or more consecutive dashes is
easily done in a view and does not even need regular expressions:
def detail(request, item_url) :
if '--' in item_url :
raise 404

Even more improvements if you keep the urls lower case (or uppercase,
but not mixed case) and use [a-z0-9_] instead of \w.
-- 
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: Url regex keeps django busy/crashing

2012-08-02 Thread Melvyn Sopacua
On 3-8-2012 2:34, Melvyn Sopacua wrote:

Correction:
> url(r'^(?P\w[\w-]+-/$', 'detail')
insert question mark here -->  ?

-- 
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: Return SQL calculation within queryset

2012-08-02 Thread Jonathan Baker
No, nott particularly. I'm working on my second Django project, so I
suppose I'm still taking the hard road in a few places until I feel more
comfortable. I'll keep Geo on my shortlist of apps/frameworks/etc. to check
out soon.

On Thu, Aug 2, 2012 at 6:01 PM, Melvyn Sopacua wrote:

> On 25-7-2012 2:03, jondbaker wrote:
> > I've implemented the spherical law of cosines to aid in proximity-based
> > searching.
>
> Is there a specific reason you're not using GeoDjango?
> Specifically:
> <
> https://docs.djangoproject.com/en/1.4/ref/contrib/gis/geoquerysets/#distance-lookups
> >
> --
> 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.
>
>


-- 
Jonathan D. Baker
Developer
http://jonathandbaker.com

-- 
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 Userena Problem

2012-08-02 Thread Melvyn Sopacua
On 28-7-2012 19:43, Subhodip Biswas wrote:

> However now, once past sign in or signup forms, when it comes to fetch
> the profile using get_profiles(). I am getting a
> SiteProfileNotAvailable error for already existing accounts but no
> profile

And this is covered a bit later in the fine manual:
"The method get_profile() does not create a profile if one does not
exist. You need to register a handler for the User model's
django.db.models.signals.post_save signal and, in the handler, if
created is True, create the associated user profile"

However, this does not cover existing accounts that did not have a
profile. They're easily created though, even in a small script by
catching the UserProfile.DoesNotExist exception.
-- 
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: Detecting browser type after login

2012-08-02 Thread Melvyn Sopacua
On 1-8-2012 21:52, Larry Martell wrote:
> On Wed, Aug 1, 2012 at 1:38 PM, Kurtis Mullins  
> wrote:
>> Sorry for the double-message. Anyways, if you do want to do what that other
>> person recommended, simply find the View that the user is redirected to
>> after logging in. Then, modify the "context data" of that view to dump
>> whatever data to the template. And then do some magic in the template based
>> upon that context data. In short, put this logic in the view the user is
>> sent to after they've logged in.
> 
> What view they are redirected to is not consistent. It depends on what
> the user is permissioned for and what features the customer has paid
> for. But I may be able to do this in some common part of the code.

Add a UserProfile field "just_logged_in", type Boolean.
The only place that field gets set to True is in the login view. Don't
forget to save the profile in that view.
Create a small that sets the field back to False and saves the profile
that can be invoked by an AJAX call.
In your base_site.html template use:
 {% if user.get_user_profile.just_logged_in %}
to include a javascript bit, that generates the popup /and/ calls the
view that resets the just_logged_in field.

-- 
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: TinyMCE config

2012-08-02 Thread Melvyn Sopacua
On 2-8-2012 23:53, Jonathan Baker wrote:
> Thanks for the responses, but I'm still stuck. For now, I'm just trying to
> add TinyMCE to FlatPages within the Django admin app.

Yet another victim of formfield_overrides?
Remember that the Django admin overrides form fields based on their base
class.
-- 
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: Issue Deploying Django

2012-08-02 Thread Trevor Joynson
You are trying to install packages system-wide when you don't have
credentials to do so.

You can install everything you need without cluttering the system itself.

For instance, use a virtualenv and set your PREFIX.

Either way, happy hacking!
On Aug 1, 2012 8:32 PM, "JJ Zolper"  wrote:

> I'm trying to install GEOS and on my bluehost account under my django_src
> folder and what happened in the image happened.
>
> it said cannot create directory permission denied so i tired sudo make
> install after what I had just done ( "make" ).
>
> and then it said whats in the second image.
>
> When I tried to run:
>
> ./manage.py runfcgi [options]
>
> I got an error about GEOS so that's why I was doing that.
>
> Thanks for the help.
>
> JJ
>
> On Wednesday, August 1, 2012 1:03:21 PM UTC-4, JJ Zolper wrote:
>>
>> Thanks so much for the reply!
>>
>> I had a feeling I would need it but I just like to be sure before I act.
>>
>> Another thing. On Ubuntu there were additional packages I had to install.
>> I believe one was called "psycopg2-python-dev" or something like that.
>>
>> If I install psycopg2-python at:
>>
>> http://www.initd.org/psycopg/
>>
>> Are there any additional packges that I might need?
>>
>> I apologize for not being able to remember the additional ones I added
>> before on Ubuntu but I'm at work and couldn't find in my installation
>> history what they might have been or in my django google group discussions.
>>
>> I feel like one was called "libpq-dev" actually.
>>
>> Thanks for the help.
>>
>> JJ
>>
>> On Wednesday, August 1, 2012 2:07:54 AM UTC-4, lawgon wrote:
>>>
>>> On Tue, 2012-07-31 at 20:52 -0700, JJ Zolper wrote:
>>> > Do I need to go through and install the python like adapters is that
>>> > what it's complaining about? I don't think this has to do with my
>>> > Django code on the server it's just a file missing right?
>>>
>>> you need to install pycopg - and it is nothing to do with your code
>>> --
>>> regards
>>> Kenneth Gonsalves
>>>
>>>  --
> 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/-/0Jx03fySUVUJ.
> 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: TinyMCE config

2012-08-02 Thread Jonathan Baker
"Remember that the Django admin overrides form fields based on their base"
I'm not following what you're saying here. I'm pretty new to Django and
just followed the example in the app's documentation. Any tips?

On Thu, Aug 2, 2012 at 8:21 PM, Melvyn Sopacua wrote:

> On 2-8-2012 23:53, Jonathan Baker wrote:
> > Thanks for the responses, but I'm still stuck. For now, I'm just trying
> to
> > add TinyMCE to FlatPages within the Django admin app.
>
> Yet another victim of formfield_overrides?
> Remember that the Django admin overrides form fields based on their base
> class.
> --
> 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.
>
>


-- 
Jonathan D. Baker
Developer
http://jonathandbaker.com

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