Re: 1.4 on git

2012-05-07 Thread Andre Terra
add "django==1.4" to a requirements.txt file (no quotes!) $ pip install -R requirements.txt On Mon, May 7, 2012 at 1:00 AM, Rivsen wrote: > Hi Larry, > > I cloned django and django-old from github, and I found the git index of > yours. > > It's in django-old repo, not in django. > > So you nee

Re: i need to place my django site on a server, i dont know how to do it! help!!!

2012-05-10 Thread Andre Terra
Or just deploy on heroku http://heroku.com Cheers, AT On Thu, May 10, 2012 at 11:13 AM, eihli wrote: > This won't be a complete list but it's what I can remember off the top of > my head. > Things to do: > Install Python > Install Django > Install database software (I chose Postgres. I guess

Re: New Release of IBM_DB_DJANGO (1.0.4)

2012-05-16 Thread Andre Terra
I don't even use IBM databases, but I just wanted to say thank you and great job! I'm always happy to see Django being embraced all across the IT industry and to see IBM developing and maintaining an part of this great framework is always heart warming. Keep up the good work! Cheers, AT On We

Re: import error: no model named .....

2012-05-17 Thread Andre Terra
Everyone, please follow these guidelines before asking other questions: https://code.djangoproject.com/wiki/UsingTheMailingList Cheers, AT On Thu, May 17, 2012 at 4:14 PM, Tanveer Ali Sha wrote: > even am getting *page not found* error > > 1.^notes/ > the current URL,didnt match any of these

Re: Getting Started-Introduction

2012-05-22 Thread Andre Terra
https://docs.djangoproject.com/en/dev/internals/contributing/ On Tue, May 22, 2012 at 11:17 AM, vishrut mehta wrote: > Thank you a lo..! But i tld u im a bit new to all this...Can u > please explain how to solve bugs and submit the patches,means the procedure > ??I am just new to this...

Re: Generic views create_object and prefill form data?

2012-05-23 Thread Andre Terra
For the record, you could go even further (and you may already have), and make the get_initial part of a WebsiteMixin so that you can reuse it in other views without having to repeat yourself. Cheers, AT -- Forwarded message -- From: Paul Date: Wed, May 23, 2012 at 5:09 PM Subje

Re: track change

2012-05-23 Thread Andre Terra
Google for Django Audit Log and/or Audit Trail. While some of the packages might not be under active development, they may be able to point you in the right direction. Cheers, AT -- Sent from my phone, please excuse any typos. -- On May 23, 2012 5:45 PM, "Carsten Jantzen" wrote: > Hi > > I am l

Re: GeoIP install failure, advice needed

2012-05-24 Thread Andre Terra
sudo brew link geoip? Total guess, btw. Cheers, AT On Thu, May 24, 2012 at 6:39 PM, DF wrote: > Several hours of frustration here and looking to see if anyone has any > advice. > > I'm trying to install GeoIP vie Homebrew and receive the following error > just prior to the install finishing: >

Re: Python IDLE

2012-05-28 Thread Andre Terra
For one thing, I don't know of anybody who uses IDLE as their editor for writing complex code like when developing a website with Django. You can always type 'python manage.py runserver' instead of just 'manage.py runserver' to make sure python is the program that's opening your .py file. It seem

Re: OpenSource IDE with debugger capabilities of PyCharm

2012-05-31 Thread Andre Terra
No IDE recommendations, please! There are many threads regarding that, so please search around, OP. As for template debugging, this is currently a limitation in Django itself AFAIK, but efforts are being made to improve the situation. Sincerely, Andre Terra -- Sent from my phone, please excuse

Re: OpenSource IDE with debugger capabilities of PyCharm

2012-06-01 Thread Andre Terra
31, 2012 at 7:55 PM, Russell Keith-Magee < russ...@keith-magee.com> wrote: > On Thu, May 31, 2012 at 6:54 PM, Andre Terra wrote: > > No IDE recommendations, please! > > > > There are many threads regarding that, so please search around, OP. > > > > As for t

Re: about_dajngo

2012-06-06 Thread Andre Terra
You can also use the Google Chart Tools, if you only need low to moderate complexity charts. https://developers.google.com/chart/ Cheers, AT On Wed, Jun 6, 2012 at 4:11 AM, Pierre de LESPINAY wrote: > If you only need to draw HTML charts, I would suggest to use jQPlot > Le 6 juin 2012 09:06, "

Re: Filter by today

2012-06-12 Thread Andre Terra
You're missing result in your queries because your timestamp DateTimeField includes time information (otherwise it would be a DateField). Cheers, AT -- Sent from my phone, please excuse any typos. -- On Jun 12, 2012 7:55 AM, "Simon Pickles" wrote: > Hi, if my model has a timestamp field, > > c

Re: from future url -- argh

2012-06-14 Thread Andre Terra
I was having the same problem, but with the development version (that is, 1.4+, or soon to be 1.5). Just remove the {% load url from future %} because the future is NOW! :O The old {% url %} tag has apparently been deprecated, but I can't find any notes on this change after 2 mins of googling. L

Re: from future url -- argh

2012-06-14 Thread Andre Terra
Ah, here it is: https://docs.djangoproject.com/en/dev/internals/deprecation/#id2 Cheers, AT On Thu, Jun 14, 2012 at 8:54 PM, Andre Terra wrote: > I was having the same problem, but with the development version (that is, > 1.4+, or soon to be 1.5). > > Just remove the {% load url

configure apache and mod_python

2012-07-11 Thread Carlos Andre
Hi, i'm with a hard problem. also, my apache have a problem he not want be stated, i try use the xamppy and now be sure that problem! As I put apache and mod_python to work? Please help i need this! I've tried a lot for tutorials that do not explain, those who have used it wrong! thanks! -- You r

Catch or raise exception designissue

2012-07-11 Thread Andre Schemschat
xperienced django-devs in here, cause i'm sure im missing some vital point :D Thanks&Grettings, Andre -- 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-

Re: Form 'POST' to a database

2012-07-11 Thread Andre Schemschat
> > Hey, >> > yeah, it basicly is. Just a very, very basic example (And sorry if i could highlight this as code, i didnt find something in the format-menu :/ ). Of course you should validate your input first. And if you just want to edit a Model within a form, you should check on the ModelForm-C

Re: Hierarchy Model

2012-07-15 Thread Andre Terra
-- Sent from my phone, please excuse any typos. -- On Jul 15, 2012 11:02 AM, "Setiaman Lee" wrote: > Hi, > > I want to implement hierarchy data model which is quite common in > Relational Data Model. > > Let's say I have Employee model which has the relation to the boss which > link to the employ

Re: Hierarchy Model

2012-07-15 Thread Andre Terra
I recommend using django-mptt. I can't link to it cause I'm writing on my phone, but it's easy to find it on Google. Also, your foreign key should target self rather than Employee, IIRC. Cheers, AT -- Sent from my phone, please excuse any typos. -- On Jul 15, 2012 11:02 AM, "Setiaman Lee" wrote

Re: Catch or raise exception designissue

2012-07-15 Thread Andre Schemschat
Hey, thanks for your replies. so the general idea is to dont catch the 500's, if there really is an situation which shouldnt happen. Thats was my first thought too, so i think i will stick with that and just code defensivly with exception-raising, when critical situations appear :) On Saturday,

django+apache

2012-07-17 Thread Carlos Andre
hi programers, i'm with troble in apache with django connect! what i can make to connect! i start with mod_python, but have very troble! can Somebory help me? -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to d

activate site django

2012-07-18 Thread Carlos Andre
hi programers! i want to make my project work in web, but i only know how deploy django-mod_python-apache, also the question! i'm keep all install corretc and work correct too, whall i will keep this project in web? process using ftp! thanks! -- You received this message because you are subscrib

Re: Return SQL calculation within queryset

2012-07-25 Thread Andre Terra
Please read the following bits of documentation: https://docs.djangoproject.com/en/dev/topics/db/sql/#performing-raw-sql-queries https://docs.djangoproject.com/en/dev/ref/models/querysets/#django.db.models.query.QuerySet.extra Cheers, AT On Tue, Jul 24, 2012 at 9:03 PM, jondbaker wrote: > I'v

Weird test-behaviour in combination with localization

2012-07-31 Thread Andre Schemschat
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 Greetings & Thanks, Andre -- You received this message becaus

Re: Weird test-behaviour in combination with localization

2012-07-31 Thread Andre Schemschat
within its own tests, which affect my other tests? On Tuesday, July 31, 2012 9:21:28 PM UTC+2, Andre Schemschat wrote: > > Hey together, > I was just writing some tests for my views and i stumbled upon a > localization error, which i cant figure out :/ > I have a test that

DJANGO_DEFAULT_SETTINGS

2012-08-14 Thread Carlos Andre
hi developers i'm with a ptoblem in this date. How work? thanks! -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsu

Re: DJANGO_DEFAULT_SETTINGS

2012-08-14 Thread Carlos Andre
Ok, the quest is relative a how that work with forms of data in settins.py! not relative to date time. in real i'm want insert data in databases athroughl shell and thi error is show! 2012/8/14 Satinderpal Singh > On Tue, Aug 14, 2012 at 9:42 PM, Carlos Andre wrote: > > hi

Re: DJANGO_DEFAULT_SETTINGS

2012-08-14 Thread Carlos Andre
ach you how to set this variable properly. > > HTH > > Jirka > -- > *From: * Carlos Andre > *Sender: * django-users@googlegroups.com > *Date: *Tue, 14 Aug 2012 15:48:18 -0300 > *To: * > *ReplyTo: * django-users@googlegroups.com > *Subject: *R

Re: DJANGO_DEFAULT_SETTINGS

2012-08-14 Thread Carlos Andre
Thanks for all! i'm solving this problem! 2012/8/14 Melvyn Sopacua > On 15-8-2012 1:02, Furbee wrote: > > > DJANGO_SETTINGS_MODULE is an environment variable that must be set. I > > believe this is taken care of for you when you create a project using > > django-admin. You may need to create it

uso do csrf

2012-09-24 Thread Carlos Andre
Olá pessoal, estou com um pequeno problema na implementação de meu projeto. Eu consegui usar no formulário o csrf isto só com o views e templates, mas quando adicionei o forms e usei o csrf não deu certo! implementei do mesmo modo que anterior mas sempre aparece o erro 403! se poderem me ajudar obr

Re: app for kickstarter-like goals

2012-10-03 Thread Andre Santos
You could also search for "gamification". https://www.google.com.br/search?q=gamification+%2B+django&oq=gamification+%2B+django&sugexp=chrome,mod=9&sourceid=chrome&ie=UTF-8 2012/10/3 Matteo Suppo > I just wanted to be sure there wasn't already something. > > So, since I found nothing, I guess I'

How to call a database function from Django?

2012-11-08 Thread Andre Lopes
Hi all, I need to run a script once a day. The script basically will call a postgresql function. I've google and I found a solution just like this. The problem is that does not work. [code] import os os.environ['DJANGO_SETTINGS_MODULE'] = 'settings' from myapp.models import * MyModelClass.object

Best way to show/hide the logout link in a template?

2011-08-18 Thread Andre Lopes
Hi, I am new to Django... I have made a logout link, but now I am in doubt on which the best way to show/hide this template tag: [code] Logout [/code] Which is the best way of show/hide this link? Sorry if it is a basic question. Best Regards, -- You received this message because you are su

Re: Best way to show/hide the logout link in a template?

2011-08-18 Thread Andre Lopes
Thanks Kev, It was exactly what I needed. Regards, On Thu, Aug 18, 2011 at 10:45 PM, Kev Dwyer wrote: > Andre Lopes wrote: > >> Hi, >> >> I am new to Django... I have made a logout link, but now I am in doubt >> on which the best way to show/hide this templa

Re: Best approach to handling different types of Users

2011-08-18 Thread Andre Terra
Until you install some third party app that accesses User.objects.all() and then suddenly nothing works as it's supposed to. You can access the User object from its related UserProfile instance and do everything you say from there instead of breaking the convention. Nobody's stopping you from writ

Re: Work in memory instead of BD, how to?

2011-08-18 Thread Andre Terra
I think a better solution would be to use a store rather than cache (protip: redis) and, if the calculations are lengthy, write a 'publish' function that writes them to the store and let the user choose when to see the changes in the results appear on the website. Additionally, add a 'modified sin

Re: How do I select which user/password to use for DB connection after Django app was started?

2011-08-18 Thread Andre Terra
You can't map python processes to users. It's simply not how it works. This is the web on the 21st century, rethink your concepts instead of trying to fit them on to a completely different paradigm. Change is good. Embrace it. Cheers, AT On 8/18/11, michael kapelko wrote: > I think about 50

Re: Best approach to handling different types of Users

2011-08-19 Thread Andre Terra
Alright, do what you will. Whatever floats your boat.. On Fri, Aug 19, 2011 at 5:12 AM, Matt Schinckel wrote: > > On Friday, August 19, 2011 12:07:44 PM UTC+9:30, Andre Terra (airstrike) > wrote: >> >> Until you install some third party app that accesses >> User.obje

Re: Djangonaut is looking for a job

2011-08-19 Thread Andre Terra
http://djangogigs.com/ https://www.djangoproject.com/rss/community/jobs/ 2011/8/19 Eugeny Belykh > hi)) > i think yes,we should keep trying > > > 2011/8/17 枯藤天涯 > >> hello,I am from China。And I am looking a job about python/django .Just >> same as you .Remote (telecommuting) only.Can we find t

What I am missing is this Django "logout"?

2011-08-20 Thread Andre Lopes
I am new to Django, and I am trying to put the logout to work... I have installed the an App called, Django-Registration. My problem is that I can do the logout, but the page does not get refreshed, I must to press F5 after the logout to see the page for not logged users. What I have done is the

Re: What I am missing is this Django "logout"?

2011-08-21 Thread Andre Lopes
. The actual logout > is done in the first request only. > So, when you refresh the page, you are basically pre-empting your browser > client to break the initial loop, and manually requesting for the new fetch > request. > I hope I was able to clear the reason behind the outcome you wer

Re: What I am missing is this Django "logout"?

2011-08-22 Thread Andre Lopes
elative url path. > But, you are surely using things "the wrong way". :) > > On Sun, Aug 21, 2011 at 4:57 PM, Andre Lopes wrote: >> >> Hi, >> >> Thanks for the reply. >> >> I have discovered that If I use this: >> >> [code] >>

Re: Django Development environment

2011-08-23 Thread Andre Terra
Aptana (aka Eclipse/Pydev) for no reason other than hyperlinks in the code Vim/Notepad++ on occasion virtualenv, git, pip, ack (grep on steroids) nginx (proudly compiled from source with custom modules!) ubuntu 10.04 (will only upgrade to LTS releases) or windows xp. All of these tools are multip

Re: can django be used in destop application?

2011-08-23 Thread Andre Terra
Better yet, http://www.riverbankcomputing.co.uk/software/pyqt/download Cheers, AT On Tue, Aug 23, 2011 at 8:59 PM, Sam Walters wrote: > Seriously why bother? > > http://www.wxpython.org/ > > The whole front end of django is too web-centric. So the only thing > that might be of use is if you h

Re: Delegating a async job from a django view

2011-08-25 Thread Andre Terra
Celery is really all you need. IIRC, you'll have to install celery, django-celery, setup a broker backend (which handles the task dispatching), and a result backend (i.e. where you'll get results from your tasks). This means you'll have to run a celery server and quite possibly a separate server

Re: Combining queries? A "join" in Python?

2011-08-30 Thread Andre Terra
FWIW, I'm using django-mptt to help me traverse my tree of self-referencing models, as well as run complex aggregates based on them. http://django-mptt.github.com/django-mptt/index.html Be aware that the API has changed a lot from 0.3 (which is easily found around the web) to 0.5 (which will requ

Re: django setup.py access denies

2011-09-01 Thread Andre Terra
Email 1000 users directly, see when if you get spam or not. If so, email the first 500 again, rinse and repeat, else proceed to the next batch after 12 hours. Aside from the fact that you will be spamming as well, at least it would be for just one time and for the greater good. Cheers, AT On T

Re: How to group models month by month.

2011-09-06 Thread Andre Terra
http://django.me/aggregation Cheers, AT 2011/9/6 Yaşar Arabacı > > I have a model with datetime field. I want to get a table with three > columns as, year, month and number of items in time span. And I also want to > order them from newest to oldest. What I want to get is something like this:

Re: Binding two views to one url?

2011-09-08 Thread Andre Terra
What you need to do is browse the class-based views docs for how to handle forms with them. https://docs.djangoproject.com/en/dev/ref/class-based-views/#formview Instead of switching from DetailView to FormView, you can just try to add some of the mixins that FormView uses. This way you can merge

Re: How do I render a template variable inside a for loop, when the var is a dict and the key is forloop.counter

2011-09-08 Thread Andre Terra
There is an inflexibility indeed, because the template is meant for designers, not programmers. Try {% for key, value in MyList.items %} instead. A hackier solution would be to write your custom template tag like {% get_from_dict foo bar %} to try to get foo[bar]. But in this case you can just us

Re: How do I render a template variable inside a for loop, when the var is a dict and the key is forloop.counter

2011-09-09 Thread Andre Terra
unter", and > MyDict.loop.counter (2 dots) is too much for the template to be > interpreted correctly. > > > On Sep 8, 12:51 pm, Andre Terra wrote: > > There is an inflexibility indeed, because the template is meant for > > designers, not programmers. > > >

Re: Using gedit for django development

2011-09-13 Thread Andre Terra
Incredible! I'll have to take a look at this over the weekend. Have you given any thought to wrapping hyperlinks around modules, classes and functions for easier browsing? This is the #1 (okay, maybe the only) reason I use Aptana. Cheers, AT On Tue, Sep 13, 2011 at 7:33 AM, Thomas Weholt wrote:

Re: setting the database when using a rawqueryset

2011-09-13 Thread Andre Terra
Not exactly what you want, but https://docs.djangoproject.com/en/dev/topics/db/sql/#executing-custom-sql-directly Cheers, AT On Tue, Sep 13, 2011 at 5:51 PM, Robert wrote: > > I have inherited the support of a Django application and am new to the > language so I would appreciate some advice.

Re: setting the database when using a rawqueryset

2011-09-14 Thread Andre Terra
Take a look at the aggregation docs at http://django.me/aggregation for sum, group by, etc. Cheers, AT On Tue, Sep 13, 2011 at 7:44 PM, Robert wrote: > > I apologize for using AT rather than your name, Andre. > > On Sep 13, 6:42 pm, Robert wrote: > > Thanks, AT. Actually t

Re: setting the database when using a rawqueryset

2011-09-14 Thread Andre Terra
And I apologize for not even saying yours, Robert! Yours, André On Wed, Sep 14, 2011 at 9:32 AM, Andre Terra wrote: > Take a look at the aggregation docs at http://django.me/aggregation for > sum, group by, etc. > > > Cheers, > AT > > > On Tue, Sep 13, 201

Re: Class-based views or "Traditional" Views for Django 1.3?

2011-09-14 Thread Andre Terra
OTOH, getting the hang of it can be hard with the current state of the docs and given that they require a completely different mindset when coding views. Cheers, AT On Wed, Sep 14, 2011 at 10:35 AM, Donald Stufft wrote: > Class Based Views let you override and subclass views to modify their >

Re: SCGI error

2011-09-14 Thread Andre Terra
On Wed, Sep 14, 2011 at 6:10 AM, Tom Evans wrote: I'm not entirely experienced with scgi or uWSGI, but I'm almost > certain that neither of them talk HTTP, which is what Firefox uses to > talk to servers. You need to connect your WSGI/SCGI server to a HTTP > server like Apache, lighttpd, Cherokee

Re: Cannot Connect to Server with Postgresql (9.0)

2011-09-15 Thread Andre Terra
Hello, Eric Welcome to Django! * Can you ping the server? * Are you sure about your username and password? Try creating a new login role through PgAdmin and use that instead to see if the error is in the connection or in the authentication process. * Does your pg_hba.conf file have an entry whi

Re: When is a good time to use db_index? Rule of thumb?

2011-09-16 Thread Andre Terra
Wow, great question and even better answers! Amazing help indeed. Thanks everyone, I learned a bunch from this too. Enjoy the weekend! Cheers, AT On Fri, Sep 16, 2011 at 1:52 PM, Micky Hulse wrote: > Thank you Micah, Donald and Doug! I really appreciate the help! :) > > That really helps to c

Re: Calculated value that depends in related models

2011-09-19 Thread Andre Terra
Have you considered using a cache/store backend like redis[1] instead of saving the result to the database? Using this approach, you can write a custom model method for returning the calculation, which can be called manually every time you need the result. The key difference being that this method

Re: Web Designer

2011-09-26 Thread Andre Terra
Please refer to our recent thread with suggestions for development environments. There's enough there already to get anyone started. On the web: https://groups.google.com/forum/#!msg/django-users/ZwVHa0jBRrY/Fq-jCVxrK7AJ Cheers, AT On Mon, Sep 26, 2011 at 1:25 PM, Sushirod wrote: > > Good s

Re: DJango doesn't work with Oracle 11g on Windows 8

2011-09-26 Thread Andre Terra
Windows 8? On Sat, Sep 24, 2011 at 5:27 AM, Benjamin Welton < benjamin.r.wel...@wmich.edu> wrote: > Hey Alec, > > django.core.exceptions.ImproperlyConfigured: Error loading cx_Oracle > module: DLL load failed: %1 is not a valid Win32 application. > > Do you have the visual c redistributable inst

Re: DJango doesn't work with Oracle 11g on Windows 8

2011-09-26 Thread Andre Terra
ows 8 since the developer preview is > available. If he actually is id be curious to know if everything works ok on > windows 8 with python/django. > > Ben > > > On 09/26/2011 04:10 PM, Andre Terra wrote: > > Windows 8? > > On Sat, Sep 24, 2011 at 5:27 AM, Benj

Re: Extracting the database name from an object

2011-09-27 Thread Andre Terra
It doesn't hurt to remind him that methods that begin with _ are considered unstable API and are subject to change/removal without previous notice. Cheers, AT On Tue, Sep 27, 2011 at 3:51 PM, Willem Romijn wrote: > ob._state.db, according to this article: > > > http://stackoverflow.com/questio

Re: psycopg2 pickling error

2011-09-28 Thread Andre Terra
Thanks for providing this feedback, Tom. I read your original question but I wasn't sure of the answer, so it's good to know how you worked it out! Best regards, AT On Wed, Sep 28, 2011 at 4:51 AM, tom wrote: > Hello, > > I have solved the problem with the support from newrelic, the issue was >

Re: Two django apps (models) using same table

2011-09-29 Thread Andre Terra
Perhaps https://docs.djangoproject.com/en/dev/ref/models/options/#db-table ? But you really shouldn't describe the same table twice, if it's exactly the same thing. Move the models.py to a standalone "app" and have your two apps refer to that instead. Cheers, AT On Thu, Sep 29, 2011 at 2:28 PM,

Re: Simple input forms which show more than one row - easy/possible in django?

2011-10-05 Thread Andre Terra
I've only skimmed this thread, but I recommend django-form-utils[1] if what you want is to write nicely formatted forms with little to no headache at all. [1] https://bitbucket.org/carljm/django-form-utils/overview Cheers, AT On Wed, Oct 5, 2011 at 1:05 PM, Chris G wrote: > On Wed, Oct 05, 20

Re: What is the right way to use S3 as a storage backend?

2011-10-05 Thread Andre Terra
I may be dreaming, but IIRC ADMIN_MEDIA_PREFIX is on its way to deprecation, so some googling might be in order. Cheers, AT On Wed, Oct 5, 2011 at 11:07 AM, Kurtis wrote: > Okay, two things. > > 1. I saw I was potentionally using the wrong URL. I believe it should > be my CDN URL. Correct me i

Re: How to make Django pick new urls immediately

2011-10-07 Thread Andre Terra
That is correct. I believe you could go even further and not even prefix the app's urls, by adding an empty path (r'^', include('api.urls')), I don't quite remember what the raw string should look like, but this would let you apply your app's url patterns to the root of your domain, which in some

Re: Why can't "directly" change array elements of model objects in Django shell?

2011-10-07 Thread Andre Terra
The easiest way would be to slice the list exactly how you were doing with x[3]... It doesn't get much easier than that. I guess if you really need to spare yourself three keystrokes, you can do it like this: >>> x = YourModel.objects.all()[3] >>> x.foo = 'bar' >>> x.save() Cheers, AT On Fri,

Re: Profiling Django

2011-10-12 Thread Andre Terra
A good place to start is using django-debug-toolbar and taking a look at the queries generated for each view, so that you know what's taking long. There are tools for monitoring database performance, but I have no experience with them, so I'll leave it to other members in this list to make the reco

Re: Second coming of Java?

2011-10-13 Thread Andre Terra
On Thu, Oct 13, 2011 at 7:04 AM, Petite Abeille wrote: > (...) > > How To Write Unmaintainable Code. > http://thc.org/root/phun/unmaintain.html > > Tangentially related: > > Big Ball of Mud > http://www.laputan.org/mud/ > > I had read Big Ball of Mud before, but "How to Write Unmaintainable Code"

Re: a django question about "python manage.py syncdb"

2011-10-14 Thread Andre Terra
models should be lowercase, because that's the standard for every single python package. Cheers, AT On Fri, Oct 14, 2011 at 6:23 AM, Chen Xu wrote: > Hi, > I am new to Django. > I have installed Django and go t everything set up correctly, just started > some easy tutorials. > > So when I do >

Re: Automaticall list all fields of generic model in template

2011-10-17 Thread Andre Terra
Even better, use django-form-utils! https://bitbucket.org/carljm/django-form-utils/overview Cheers, AT On Sun, Oct 16, 2011 at 7:57 PM, Mario Gudelj wrote: > I think you need this > https://docs.djangoproject.com/en/dev/topics/forms/modelforms/ > > > On 16 October 2011 18:24, bovender wrote:

Re: Class Based FormView - Initial Logic

2011-10-17 Thread Andre Terra
Maybe some place inside get(), dispatch() or get_form_kwargs()? Cheers, AT On Mon, Oct 17, 2011 at 3:57 PM, Kurtis wrote: > Hey, > > I have a FormView and a Form. I want to put in some logic that will > take place before the Form is even displayed. I know I could throw > this in a decorator an

Re: cannot concatenate 'str' and 'FilterExpression' objects

2011-10-18 Thread Andre Terra
Please post your code again on something like http://dpaste.com and I'll gladly take a look Cheers, AT On Tue, Oct 18, 2011 at 9:43 AM, nav wrote: > If anyone has any pointers as to what might be the problem please > answer. I would greatly appreciate any help you maybe able to provide. > > Th

Re: Getting into professional django development

2011-10-18 Thread Andre Terra
Here's my to-do list for you: * Build a REST API using django-tastypie * Master caching, cache invalidation, etc * Celery (asynchronous tasks!) * Learn to profile django apps, including finding bottlenecks * Write raw SQL * If you have a lot of corporate clients, serialize data and export to excel

Re: cannot concatenate 'str' and 'FilterExpression' objects

2011-10-18 Thread Andre Terra
re.py#L37 On Tue, Oct 18, 2011 at 12:06 PM, nav wrote: > AT, > > Thanks for your email I have posted the custom template tag code and > the traceback at dpaste. The template code is at: > > http://dpaste.com/636570/ > > the traceback is at: > > http://dpaste.com/63

Re: Django admin multiple company accounts

2011-10-19 Thread Andre Terra
Hi Mars, On Wed, Oct 19, 2011 at 8:55 AM, Cal Leeming [Simplicity Media Ltd] < cal.leem...@simplicitymedialtd.co.uk> wrote: > (...) > > To be honest, you're probably (not 100% sure) creating *more* work for > yourself trying to make something like this work in django admin, than just > designing

Re: Django Docs Suggestion - Color Code

2011-10-19 Thread Andre Terra
Agreed. I had the same idea but was a little lazy at the time to write an e-mail. I say old versions (pre 1.3, atm) should be grayed out, trunk should be reddish (or orange to match the canonical palette). Cheers, AT On Wed, Oct 19, 2011 at 5:33 AM, Kurtis wrote: > Hey Guys, > > I know I saw

Re: In a model field (and subsequently in modelforms, modelform field and widgets) what is "rel"

2011-10-19 Thread Andre Terra
Hello, Timmy "rel" is the related manager object that will be used in specific fields, namely those that refer to relationships to other table. These relationships are handled by objects in django.db.models.fields.related[1]. For example, take User and Group from django.contrib.auth.models. Assum

Re: How to set up Apache to serve up django websites?

2011-10-24 Thread Andre Terra
ImportError: Could not import settings 'portal.settings' (Is it on sys.path?): No module named portal.settings I tried to add this to my apache envvars file as: export PATH=/home/roger/projects/playground/feincms_env/bin:/home/roger/projects/portal:$PATH You need to add /home/roger/projects to

Re: Setting default values in a form from DB table

2011-10-24 Thread Andre Terra
You should always populate your form in forms.py. This is done using the 'initial' kwarg and is thoroughly explained in the docs! [1] Borrowing from the tutorial's Poll model [2]: Class PollsForm(forms.Form): def __init__ (self, *args, **kwargs): self.instance = kwargs.pop('instance',

Re: How to handle apps independently in a Wsgi/Apache deployment

2011-10-25 Thread Andre Terra
Assuming I understood your question, here's a wild guess. Use different settings files and set the DJANGO_SETTINGS_MODULE on the fly on your .wsgi script Cheers, AT On 10/25/11, vpetkov wrote: > Hi, > > I have the standard Wsgi/Apache deployment with several apps in a > single project, admin

Re: Field.Choices in Template

2011-10-25 Thread Andre Terra
I remember trying to help you with this on IRC, Kurtis. I've had the same problem before, but I could never remember that BoundFields have a field attribute.. If there isn't a note in the docs (or even better, an example), I'll make sure to write a patch in the next few days. Cheers, AT On 10/25

Re: Custom upload handler in generic view

2011-10-26 Thread Andre Terra
Are you using nginx by any chance? I use nginx and my setup is as follows: A upload.py with the custom handler and a view to yield progress result as json [1], a template with some javascript [2] to fetch the json-formatted progress result, some lines in nginx.conf [3] to tell it to keep track of

Re: Custom upload handler in generic view

2011-10-26 Thread Andre Terra
on but I haven't tried it yet. > > Best, > Kaspar > > On Oct 26, 2:18 pm, Andre Terra wrote: > > Are you using nginx by any chance? I use nginx and my setup is as > follows: > > > > A upload.py with the custom handler and a view to yield progress result >

Re: Long usernames in auth_user?

2011-10-26 Thread Andre Terra
On Wed, Oct 26, 2011 at 6:52 PM, Donald Stufft wrote: > The other method is to create your own auth handler (...) > http://djangosnippets.org/snippets/1001/ Cheers, AT -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, se

Re: Long usernames in auth_user?

2011-10-26 Thread Andre Terra
Then again, you can't assume an email to not have spaces as "John Doe"@example.com is a valid email per the RFC. If you *really* need flexibility, have a UserProfile model with a OneToOne relation to User and your imagination will be the only limit. Cheers, AT On 10/26/11, Kurtis Mullins wrote

Re: New member question about developing in Ubuntu Server

2011-10-26 Thread Andre Terra
Hello Ethan, Welcome to Django, the web framework for people with deadlines and great taste! Django absolutely does not require access to the builtin (or contrib, as we call it on djangoland) admin app in order for you to configure models. A model is a representation of a way to store data, whic

Re: No module named django after upgrade to os x Lion

2011-10-27 Thread Andre Terra
You can run different versions of python using virtualenv [1]. It is hands down the best way to handle multiple python environments. You can use virtualenvwrapper [2] to automate some of the process. I'm not sure how good it is on Mac OS, but you should be fine. I found a link [3] that looks like

Re: No module named django after upgrade to os x Lion

2011-10-27 Thread Andre Terra
IMHO, If you can't understand how imports and sys.path work, it's best to put the Django book aside and read up on the basics of installing and running Python. Cheers, AT On Thu, Oct 27, 2011 at 1:55 PM, creecode wrote: > Angelika may not want to get into virtualenv and virtualenvwrapper at th

Re: Possible to run manage.py sqlall [appname] without db connection?

2011-10-27 Thread Andre Terra
Isn't there a dummy database wrapper? django.db.backends.dummy.base.DatabaseWrapper or something like that You could also setup sqlite (very easy, little overhead) to get started right away Cheers, AT On Thu, Oct 27, 2011 at 2:59 PM, Jason wrote: > Ah, I guess that makes sense - so depending

Re: No module named django after upgrade to os x Lion

2011-10-28 Thread Andre Terra
it. > > At this point I thinking maybe I should just switch to using > PostgreSQL instead, if that would solve the problem. What do you guys > think? > > /Angelika > > On Oct 27, 6:12 pm, Andre Terra wrote: > > IMHO, If you can't understand how imports and sys

Re: Help in adding jQuery to my pages

2011-10-28 Thread Andre Terra
Hello, Leonardo First, which django version are you using? I recommend using the contrib staticfiles app to handle your static files [1]. Once you get the hang of it, it will pay off. Second, see that you aren't getting 404 errors in the js URL. Using the dev server, you can easily read through t

Re: Help in adding jQuery to my pages

2011-10-28 Thread Andre Terra
27;ll try it, but it seems to me strange not being able to load and > use jQuery as other JS scripts. > > Is that jQuery file of mine (tabs.js) wrong? Is there some stupid > error I cannot spot? > > No one is experiencing the problem? > > 2011/10/28 Andre Terra : > >

Re: Help in adding jQuery to my pages

2011-10-28 Thread Andre Terra
eady(function() { > $('li').addClass("active"); > } > > what about some ");" to close statements? > > Thanks > > 2011/10/28 Andre Terra : > > I'm sorry if I'm not understanding you, but regarding 2 and 3, if jQuery > > isn't

Re: "python manage.py runserver" creates not tables (tutorial)

2011-11-03 Thread Andre Terra
$ python manage.py dbshell If you can't reach a database shell through that, then there's something wrong with your database setup. Cheers, AT On Wed, Nov 2, 2011 at 10:55 AM, Martin Chiteri wrote: > What about if you do a > > python manage.py sqlall > > From the settings file, I do not see an

Re: Suggestions on "Loading" for possible long load-times?

2011-11-03 Thread Andre Terra
What Matt meant to say is that Celery is *the* framework for handling background tasks, especially in the Python/Django world. Cheers, AT On Wed, Nov 2, 2011 at 8:55 PM, Matt Schinckel wrote: > Russ mentioned it in passing, but I'll point it out for clarity: Celery is > a great framework for h

<    1   2   3   4   5   6   >