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 Ba

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 try

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

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 "contex

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:

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

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@googl

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 t

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

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,

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 fo

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

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 i

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

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 vi

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

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 f

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, 201

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 th

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,

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

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

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 s

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

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 a

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 modif

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) > > Than

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 w

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, A

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 s

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

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

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_leng

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 ex

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

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 HttpR

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

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 t

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

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 for

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

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

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

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 Textize

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 automa