Re: Extending User model with Inheritance - Attribute Error

2011-07-11 Thread Andre Terra
This is done in your view: https://docs.djangoproject.com/en/dev/ref/templates/api/#subclassing-context-requestcontext Cheers On Mon, Jul 11, 2011 at 3:12 PM, Brent wrote: > Is this done in urls.py? > > On Jul 11, 10:55 am, Andre Terra wrote: > > Pass user.get_profile(

Re: Extending User model with Inheritance - Attribute Error

2011-07-11 Thread Andre Terra
ews > until later. > > On Jul 11, 1:08 pm, Brent wrote: > > So I need to create a custom view? (I can't use an existing view)? I > > was hoping to avoid diving into templates until later, after I've > > become a little more familiar with the python/html code. > &g

Re: Adding errors to form after successful validation

2011-07-11 Thread Andre Terra
I feel your pain, validating forms can be a PITA... Try reading through this last bit of the form validation docs: https://docs.djangoproject.com/en/dev/ref/forms/validation/#cleaning-and-validating-fields-that-depend-on-each-other Cheers, André Terra On Mon, Jul 11, 2011 at 6:02 PM, Brian McKe

Re: speeding up iterating over query set

2011-07-12 Thread Andre Terra
Have you looked at haystack? http://haystacksearch.org/ Cheers, André On Tue, Jul 12, 2011 at 10:49 AM, Michel30 wrote: > I have tried and I think I have it mostly working: it returns ALL > unique docid's. > > What is left is that my code is part of a search function. Originally > I got norma

Re: Django form validation.. does anyone else find it awkward??

2011-07-12 Thread Andre Terra
> > May I ask if you are managing to do this (and, if so, how) without > writing duplicate logic? > This, to me, is a key area for improvement. Aside from the development challenge the idea imposes, an extra issue with writing DRY validation for django and javascript is that the project doesn't of

Re: Django form validation.. does anyone else find it awkward??

2011-07-12 Thread Andre Terra
On Tue, Jul 12, 2011 at 2:25 PM, Venkatraman S wrote: > > > On Tue, Jul 12, 2011 at 9:12 PM, Andre Terra wrote: > >> May I ask if you are managing to do this (and, if so, how) without >>> writing duplicate logic? >>> >> >> This, to me, is a key

Re: Simple example of custom user profile fields?

2011-07-12 Thread Andre Terra
On Tue, Jul 12, 2011 at 2:51 PM, Brent wrote: > Hi, > > Does anyone know of a simple, working example of custom user profile > fields? > > I want to have a custom field, say, "favorite color," which is unique > to each user. Then I want users to be able to login, and be taken to a > page called "

Re: Inspecting objects

2011-07-12 Thread Andre Terra
Useful, if the code is well documented: http://www.java2s.com/Code/Python/Utility/CheapandsimpleAPIhelper.htm IIRC, use it like: from apihelper import info info(object, spacing=20) Cheers, André On Tue, Jul 12, 2011 at 2:44 PM, Cal Leeming [Simplicity Media Ltd] < cal.leem...@simplicitymedial

Re: Inspecting objects

2011-07-12 Thread Andre Terra
You should actually use dir() or vars() rather than __dict__. Here's a thorough explanation, along with an example serializer which might need to access an object's attributes: http://blog.enterthefoo.com/2008/08/pythons-vars.html Regards, André Terra On Tue, Jul 12, 2011 at 4:52 PM, Marc Aym

Re: Simple example of custom user profile fields?

2011-07-12 Thread Andre Terra
Instead of using get or create, why not setting up a post_save signal for the User model so that users always have a profile associated with them? Cheers, Andre On 7/12/11, Brent wrote: > Thanks for the help guys. > > Micky, that tutorial looks very good. I think I almost have it

Re: Simple example of custom user profile fields?

2011-07-12 Thread Andre Terra
E+in+your+project+settings check out the first result. Cheers, André On Tue, Jul 12, 2011 at 8:09 PM, Brent wrote: > Good idea. Unfortunately, I tried that, but it results in a > SiteProfileNotAvailable error: > > http://dpaste.com/567421/ > > On Jul 12, 3:15 pm, Andre Terra

Re: problem submitting form data to database (django)

2011-07-12 Thread Andre Terra
Also try different ports and opening the server for external IPs to make sure this isn't a network issue C:\>manage.py runserver 0.0.0.0:11010 and then http://localhost:11010 Cheers, André Terra On Tue, Jul 12, 2011 at 10:16 PM, Issac Kelly wrote: > A few things to check: > > Is runserver

Re: Possible interest in a webcast/presentation about Django site with 40mil+ rows of data??

2011-07-13 Thread Andre Terra
Unfortunately, I'm on GMT-0300 and none of those timezones work for me. Looking forward to the recorded version, though! Cheers, André On Tue, Jul 12, 2011 at 10:48 AM, Cal Leeming [Simplicity Media Ltd] < cal.leem...@simplicitymedialtd.co.uk> wrote: > Hi all, > > Great response to this, 45 regi

Re: Duplicate Key Error in Cache

2011-07-13 Thread Andre Terra
And memcached isn't hard to setup at all! Cheers, André On Tue, Jul 12, 2011 at 10:29 PM, Issac Kelly wrote: > I would guess your quickest way forward is to change backends, as it > appears that this is a larger issue with database transactions between > threads, which is a couple of years old.

Re: Trouble overriding registration templates

2011-07-13 Thread Andre Terra
Or render() which is the recommended shortcut since 1.3. https://docs.djangoproject.com/en/1.3/topics/http/shortcuts/#render Cheers, André On Wed, Jul 13, 2011 at 3:28 AM, Szabo, Patrick (LNG-VIE) < patrick.sz...@lexisnexis.at> wrote: > Did you write your own view for that purpose ?! > >

Re: Add attributes (css-class) to formfield

2011-07-13 Thread Andre Terra
Write a wrapper function and make it even shorter (ok, go ahead and call it syntax sugar): def css(field, **kwargs): field.attrs.update(**kwargs) use as: css(self.fields['release_date'], div_css="test") DISCLAIMER: not tested on a real Field, but I tested it on a simple class in a python sh

Re: Add attributes (css-class) to formfield

2011-07-13 Thread Andre Terra
Shawn, He wants the form attribute to be applied to the div, not the field. Andreas, You can't pass an attribute to a field and expect it to show up in a different object altogether. I assume your div isn't handled by django, so you need to fix that first in order to be able to pass extra attri

Re: Some more curious performance issues between MySQL and Django ORM

2011-07-13 Thread Andre Terra
On Wed, Jul 13, 2011 at 4:37 PM, Cal Leeming [Simplicity Media Ltd] < cal.leem...@simplicitymedialtd.co.uk> wrote: (...) > ** > *This original query took 4 seconds to complete:* > > # return sessions for all subscriptions under this username > _users = Members.objects.filter( >

Re: Some more curious performance issues between MySQL and Django ORM

2011-07-13 Thread Andre Terra
PostgreSQL or bust. On Wed, Jul 13, 2011 at 9:24 PM, Cal Leeming [Simplicity Media Ltd] < cal.leem...@simplicitymedialtd.co.uk> wrote: > > On 14 Jul 2011 00:13, "bruno desthuilliers" > wrote: > > > > On 13 juil, 21:37, "Cal Leeming [Simplicity Media Ltd]" > > wrote: > > > > > _users =

Re: Managing objects spred among several tables/databases.

2011-07-14 Thread Andre Terra
> far better is to do what was suggested to you long ago: do the tutorial. > > before you finish it, you'll see why your questions are unanswerable, > and if you like Django or not. > > This cannot be stressed enough. And do read the wiki guide on posting to the mailing list, as most of your posts

Re: Class-Based Generic Views (CreateView) - field exclusions and defaults

2011-07-15 Thread Andre Terra
Paul, Your form logic will go on your Form (or ModelForm) definition, not on the view. As the docs [1] say, CreateView is a combination of ModelFormMixin and ProcessFormView. Please read the docs on those two mixins to understand what methods your CampaignCreate class can override, but do move the

Re: Class-Based Generic Views (CreateView) - field exclusions and defaults

2011-07-15 Thread Andre Terra
On Fri, Jul 15, 2011 at 7:37 AM, Kenneth Gonsalves wrote: > > caveat - I have never used generic views, class based or otherwise, but > I was under the impression that if one wants customised forms or views, > generic is not the way to go. > > These views are classes and they exist precisely so th

Re: auto_now, auto_now add -- good or bad?

2011-07-15 Thread Andre Terra
Shawn, Chalk one up for option A. I never, ever, ever, use them and they can get dropped for all I care, considering how easy they are to implement "manually". They are also my go-to example for teaching new users how to modify their model's save method and I believe the shortcuts only add "mag

Re: auto_now, auto_now add -- good or bad?

2011-07-15 Thread Andre Terra
> I'll give a weak vote for C: They can be, and presumabley have been, made > to > work correctly, in a peer reviewed setting, by folks with significant > experience, > so having the less experienced noob implement his own is a little like > saying > that you should implement your own encryption sc

Re: installing django

2011-07-15 Thread Andre Terra
Do you have a strong reason for running windows on your host? Developing/deploying django on linux is about a billion times easier. Cheers, André On Fri, Jul 15, 2011 at 5:35 PM, Charles wrote: > I have a windows account on Hostgator.com and would like to install and > django. Hostagator is a

Re: trouble going from django on Windows to Ubuntu using Eclipse & Aptana Studio

2011-07-18 Thread Andre Terra
> Well, i would recommend that you use a simple editor(like vim in linux) or > Programmer's Notepad(in windows) for development in django/python. > It is much easier to develop and also helps you keep your development > environment 'lightweight'. > > An IDE is required only for languages like Java,

Re: trouble going from django on Windows to Ubuntu using Eclipse & Aptana Studio

2011-07-18 Thread Andre Terra
On Mon, Jul 18, 2011 at 4:01 AM, Fatrix wrote: > > -V, before using PyCharm I was also developing with a simple editor > (vi). > Aptana wasn't a good choice, because the support for Django isn't > built-in. > PyCharm doesn't face you with these kind of problems, because PyCharm > is very well > p

Re: syntax

2011-07-18 Thread Andre Terra
There is an error because you are concatenating the function _() and the string '%s: %s \n' You also don't need the space before \n and don't add unnecessary spaces: (the_waybill, str(errorObj.code)) is the right way to write the last part of the code[1]. [1] http://www.python.org/dev/peps/pep-

Re: Multiple Databases || External Databases

2011-07-18 Thread Andre Terra
Or maybe you want to authenticate using a remote resource? Authentication using REMOTE_USER https://docs.djangoproject.com/en/dev/howto/auth-remote-user/ Cheers, AT On Mon, Jul 18, 2011 at 6:08 AM, Uros Trebec wrote: > > > On Jul 17, 10:36 pm, Lycan wrote: > > I am building a Django User pro

Accounting app - design decisions needed

2011-07-18 Thread Andre Terra
Hello, django-users. I'm in need of some serious help on deciding how to design my next project. Below is my attempt to describe the use case: *USE CASE* I'm writing an accounting app that will be generating unique monthly reports of the revenue results for a list of Accounts (model) in the compa

Re: Django site broken after Debian upgrade

2011-07-18 Thread Andre Terra
Django has a policy of warning about deprecations for two versions and finally dropping support on the third dot release. Installing the python-django package is not the canonical way of using django, let alone running production servers. Perhaps you have a replica of the old admin templates on y

Re: Accounting app - design decisions needed

2011-07-18 Thread Andre Terra
Marc, First of all, thank you for your insights. I'll try to clarify things as best as I can. On Mon, Jul 18, 2011 at 7:21 PM, Marc Aymerich wrote: > > > On Mon, Jul 18, 2011 at 10:54 PM, Andre Terra wrote: > >> Hello, django-users. >> >> I'm in need

Re: Django site broken after Debian upgrade

2011-07-18 Thread Andre Terra
> > On Tue, Jul 19, 2011 at 9:48 AM, bkline wrote: > > On Jul 18, 5:25 pm, Andre Terra wrote: > > > > Really? It would be better if I went back to the days where we all > > built everything from the source? Do all Django users running on > > Linux (wh

It is possible to list data from a database view in Django?

2011-07-19 Thread Andre Lopes
Hi, I'm new to Django. I'm in the process of test the features of Django to move a site from PHP to Python/Django. I have a database view that is the result of many joints between tables, I only do SELECTs to this view, the data is inserted via a Script that will populate the various tables. I on

Re: Accounting app - design decisions needed

2011-07-19 Thread Andre Terra
On Mon, Jul 18, 2011 at 10:16 PM, Mike Dewhirst wrote: > On 19/07/2011 9:13am, Andre Terra wrote: > >> >> The problem is I'm supposed to have millions of entries; all with the same >> date, thousands for the same Account, hundreds with the same description and &g

Re: Django site broken after Debian upgrade

2011-07-19 Thread Andre Terra
Sincerely, André Terra On Tue, Jul 19, 2011 at 10:24 AM, bkline wrote: > On Jul 19, 8:33 am, bkline wrote: > > > Thanks for the tip, Andre. I'll keep digging and see if I can > > extricate myself from this mess. > > Bingo! That was the problem. After clearing out t

Manually ordering items in relation to siblings

2011-07-19 Thread Andre Terra
Hello, everyone Assume the following models (dpaste.com [1]): class Account(models.Model): """ Account model for categorizing entries from each SAP import, and eventually sorting, grouping, filtering data. """ code = models.CharField(max_length=255, primary_key=True) gro

Django + nginx + windows

2011-07-19 Thread Andre Terra
Hello, guys I just wanted to share: Setting up django + flup + fcgi + nginx on windows couldn't be any easier. Talk about "it just works"!! Honestly, it took me about 5 minutes to set everything up, including downloading the files. I merged the suggested .conf file from https://code.djangoprojec

Re: Pasta root

2011-07-19 Thread Andre Terra
, but also so that others might learn from the answers as well. Best regards, Andre Terra On 7/19/11, Jussiê Vieira Toledo wrote: > E ae galera! > > Estou tentando carregar um css para uma página, mas no caminho não > estou acertando. > Como vejo qual é a minha pasta root? > &

Re: Proper way to strip whitespace from Charfields in a form in current version of Django?

2011-07-19 Thread Andre Terra
Why not add a custom clean_fieldname method to your class? Perhaps you could dig into the original BaseModelForm and see how it constructs validation, and override whatever is needed. I'm on my phone atm, so I'll let you do the footwork alone, at least for now. Cheers, AT On 7/19/11, br wrote:

Re: Json and django.contrib.auth.views.login

2011-07-19 Thread Andre Terra
Kevin, Please open your views.py module located inside the rchip module and you will see there is no view named json_send_command. Please refer to that app's documentation to find more about the correct setup for your urls. Cheers, AT On 7/19/11, Kevin Anthony wrote: > i'm trying to use JSON o

Re: Json and django.contrib.auth.views.login

2011-07-19 Thread Andre Terra
You're trying to call json_command when the view is actually named json_send_command. Cheers, AT On 7/19/11, Kevin Anthony wrote: > i'm trying to use JSON on a website that also has a HTML frontend, but > when i enable this line in urls.py > url(r'^json/sendcommand/','rchip.views.json_send_comm

Re: Pasta root

2011-07-20 Thread Andre Terra
.net <http://odig.net/> > Siga a @MundoOdiG <http://twitter.com/MundoOdiG> > Curta a OdiG no > Facebook<http://www.facebook.com/pages/OdiG-Agencia-Digital/169820953056812?v=wall> > Conecte-se no > LinkedIn<http://www.linkedin.com/company/odig-solu-es-digitais-ltda>

Re: DeprecationWarning displayed in test, not in dev

2011-07-20 Thread Andre Terra
Great! Thank you Tom and Russ for the heads up. Cheers, AT On 7/20/11, Tom Evans wrote: > On Wed, Jul 20, 2011 at 3:24 AM, Russell Keith-Magee > wrote: >> The problem here actually lies with Python. >> >> For some reason, Python 2.7 changed the reporting behavior of Warnings >> so that Depreca

Re: Pasta root

2011-07-20 Thread Andre Terra
Oh, I didn't know that. Has that always been the case or was that feature added in a recent version? Anyway, thanks, Tom! Cheers, AT On Wed, Jul 20, 2011 at 9:44 AM, Tom Evans wrote: > On Wed, Jul 20, 2011 at 1:01 PM, Andre Terra wrote: > > From what I'm seeing, you haven

Re: Manually ordering items in relation to siblings

2011-07-21 Thread Andre Terra
Shameless bump. Althought the original post is long, I assure you it's easy to understand. Any suggestions? Cheers, André Terra On Tue, Jul 19, 2011 at 2:58 PM, Andre Terra wrote: > Hello, everyone > > Assume the following models (dpaste.com [1]): > > class

Re: Manually ordering items in relation to siblings

2011-07-21 Thread Andre Terra
using it. I'll give mptt a whirl, thanks a billion. Cheers, AT On Thu, Jul 21, 2011 at 10:12 AM, Daniel Roseman wrote: > On Tue, Jul 19, 2011 at 2:58 PM, Andre Terra wrote: >> >>> Hello, everyone >>> >>> Assume the following models (dpaste.com [1]): >

Re: import django models without runing the server

2011-07-21 Thread Andre Terra
> > On Jul 21, 4:53 pm, Jonas Geiregat wrote: > > > > This is a good read on the subject , it presents an elegant solution. > > > > http://superjared.com/entry/django-and-crontab-best-friends/ > > > With the problem that it will use the first module named "settings" in > sys.path, which may *or no

Re: import django models without runing the server

2011-07-21 Thread Andre Terra
Nevermind, I thought you were referring to the previously sys.path.append() method. Regards, AT On Thu, Jul 21, 2011 at 1:13 PM, Andre Terra wrote: > On Jul 21, 4:53 pm, Jonas Geiregat wrote: >> > >> > This is a good read on the subject , it presents an elegant sol

Re: Some thoughts on a 'backwards incompatible change' (bug!!) found in latest DDT.. wtf?

2011-07-21 Thread Andre Terra
Totally agreed. I expect DDT to only be displayed for INTERNAL_IPS and only during DEBUG mode, it shouldn't be an OR clause. But why not go ahead and fork it? ;) Cheers, AT On Thu, Jul 21, 2011 at 8:01 PM, Cal Leeming [Simplicity Media Ltd] < cal.leem...@simplicitymedialtd.co.uk> wrote: > htt

Re: Setting LOGIN_URL dynamically, for different users, based on app?

2011-07-21 Thread Andre Terra
Why not make custom user profiles and write permission checks on your views? Cheers, AT On Thu, Jul 21, 2011 at 10:15 PM, dpapathanasiou < denis.papathanas...@gmail.com> wrote: > I'd like to be able to support two different types of authenticated > users within a single django project site. > >

Re: Setting LOGIN_URL dynamically, for different users, based on app?

2011-07-22 Thread Andre Terra
27;^login/$', >'django.contrib.auth.views.login', >{'template_name': 'dashboard/login.html', LOGIN_URL='/dashboard/ > accounts/'}), > > [etc] > } > > and: > > urlpatterns = patterns('', > (r'^logi

Re: Setting LOGIN_URL dynamically, for different users, based on app?

2011-07-22 Thread Andre Terra
.e., writing a custom login/ > authentication routine for one app, but that defeats the purpose of > using a framework in the first place. > The good think about frameworks is that the heavy lifting has already been done for you. https://docs.djangoproject.com/en/dev/topics/auth/#writing

Re: a little help with the urls.py and views.py

2011-07-22 Thread Andre Terra
https://code.djangoproject.com/wiki/UsingTheMailingList On Fri, Jul 22, 2011 at 11:23 AM, Derick Felsman < derick.fels...@cbsinteractive.com> wrote: > bump > > On Jul 22, 12:15 am, Derick Felsman > wrote: > > extending from the example found here > > > > https://docs.djangoproject.com/en/dev/top

Re: django-admin inspectdb does not detect NULL columns for PostgreSQL database

2011-07-22 Thread Andre Terra
Didn't read the original question, so excuse me for not replying. And thanks/congrats on the new patch =) Cheers, AT On 7/22/11, Ricardo L. Dani wrote: > FYI i fixed that and post a patch in the ticket. > > Regards > > On Thu, Jul 21, 2011 at 9:21 AM, Ricardo L. Dani > wrote: >> Hi everyone, >

Re: Custom Manager

2011-07-22 Thread Andre Terra
Managers operate on your model, so their methods usually call sgl queries on a model's database. As an example, assume a blog app with a Post model which, among other things has a BooleanField called 'draft'. You could then write a custom manager called PublishedManager that subclasses the defaul

Re: Is there a way to insert data from a csv file into my database?

2011-07-25 Thread Andre Terra
This hasn't been tested, but so far I really like what I wrote: http://dpaste.com/hold/577295/ http://dpaste.com/hold/577299/ The code might be missing a few imports, as I copy-pasted and removed a few tidbits for the sake of simplicity. I'm thinking of packaging into an app one of these days, o

Re: TimeField with minute-resolution in forms

2011-07-25 Thread Andre Terra
I'm mostly guessing, but you can try defining a custom widget for the field. I'm not sure how much of the behavior of datetime fields depends on the javascript that gets slapped to them. So instead, maybe you could override the field's to_python method to append/replace the seconds as needed, or ba

Re: USE_I18N vs. USE_L10N

2011-07-26 Thread Andre Terra
On Tue, Jul 26, 2011 at 5:17 AM, Lucy Brennan wrote: > > (...) > > For both the USE_L10N and USE_I18N their effect is not obvious from > their naming. I suggest, that the description of these parameters in > https://docs.djangoproject.com/en/dev/ref/settings/?from=olddocs are > made more precise.

Re: Django, Apache, MySQL on Windows in Production

2011-07-26 Thread Andre Terra
Hello, Dimitry You can take a look at using something like nginx for serving small static files, which can otherwise keep Apache busy and therefore delay its response for more important tasks. At the risk of flaming, I should note that I have never heard of anything that MySQL does better than Po

Re: Django, Apache, MySQL on Windows in Production

2011-07-26 Thread Andre Terra
I recently compiled nginx with an additional module on windows and so far, so good. I'm probably skipping Apache altogether for this small website. As far as PostgreSQL goes, from what I've seen, it works flawlessly on Windows. Never heard of anyone complaining about that. Cheers, AT On Tue, Ju

Re: Geographic Data on Django

2011-07-26 Thread Andre Terra
http://geodjango.org/ GL! Cheers, AT On Tue, Jul 26, 2011 at 5:00 PM, Dan H wrote: > Hey I am building a website similar to Yelp. I want users to be able > to submit data on their interface with a particular establishment. I > want a user to be able to find this establishment either by searchi

Re: Include Django form in PHP based website

2011-07-27 Thread Andre Terra
Why? On Wed, Jul 27, 2011 at 10:34 AM, brian wrote: > I'm learning Django and was hoping to get some advice on an > application I want to try. > > I'm trying to create a Django form that is included in a php based > website. > > I'm working on a php based website that has a 'contact us' form that

Re: Pain on OSX

2011-07-28 Thread Andre Terra
Not to mention SQLite's 'Database is locked' issue.. I too recommend postgres. Cheers, AT On Thu, Jul 28, 2011 at 11:55 AM, william ratcliff < william.ratcl...@gmail.com> wrote: > I also recommend the enterprisedb distribution. I don't recall rebuilding > python for snow lion, but it's been aw

Re: No modelue name localeurl ( ">_<)

2011-07-31 Thread Andre Terra
Then install them on your system's python environment, rather than a virtual one. Tip: site-packages On 7/31/11, Kase wrote: > oh, im estupid, i put the rosetta and transmeta in my site path but > not localeurl... > > but, i like to put in a generic path and not duplicate in every > proyect =/

Re: Django for a front end designer

2011-08-03 Thread Andre Lopes
If you want to start with a PHP Framework, consider CodeIgniter. It is the easier Framework for a starter. On Tue, Aug 2, 2011 at 3:46 PM, paulo couto wrote: > Ok thanks for the clarifications : > I guess i'll go to PHP for now and when i have more prog. experience i'll > try python and django t

Re: Django for a front end designer

2011-08-04 Thread Andre Terra
some kind of mental block about PHP and > I know for sure that if I have to learn it I will hate every second of > it...hence my choice on python/django. > > 2011/8/4 kenneth gonsalves > >> On Thu, 2011-08-04 at 11:45 +0100, Cal Leeming wrote: >> > On Wed, Aug 3, 2011 a

Re: django-php 0.1

2011-08-08 Thread Andre Terra
hahahahah amazing description and page. I accidentally the entire coke reading the FAQ. Should be interesting for migrating old projects (not that I have any). Cheers, AT On Mon, Aug 8, 2011 at 11:47 AM, francescortiz wrote: > The FAQ section is awesome! > > On Aug 5, 5:51 pm, rei wrote: > >

How to order "links" in the Admin?

2011-08-09 Thread Andre Lopes
Hi, I'm testing Django for my first project using it. I have a model like this: from django.db import models import datetime class Directory(models.Model): website_name = models.CharField(max_length=200) website_url = models.CharField(max_length=200) website_position = models.IntegerFi

Re: How to order "links" in the Admin?

2011-08-10 Thread Andre Lopes
ased on to order these urls. > > i use time stamp to order them. > > > 2011/8/10 Andre Lopes >> >> Hi, >> >> I'm testing Django for my first project using it. >> >> I have a model like this: >> >> from django.db import models &

Re: django and extjs: works well together?

2011-08-10 Thread Andre Terra
You've now successfully whetted my appetite http://dev.sencha.com/deploy/ext-4.0.2a/examples/grid/group-summary-grid.html I'll try to use that some time in the future. Cheers, AT On Wed, Aug 10, 2011 at 12:32 PM, william ratcliff < william.ratcl...@gmail.com> wrote: > We've used it--it's real

Re: Installation Problem cant extract tar.gz file

2011-08-10 Thread Andre Terra
Possible solutions: 1) Try downloading the file again 2) Checkout from the svn repository. 3) Use a different archive manager. I'd go with options #2, personally. Cheers, AT On Wed, Aug 10, 2011 at 1:08 PM, danielvanvane wrote: > Hello, > > I want to start with Django, but i got serval pro

Re: How to order "links" in the Admin?

2011-08-11 Thread Andre Lopes
 ordering=['website_position'] > > > see: https://docs.djangoproject.com/en/1.3/ref/models/options/#ordering > > On Aug 10, 4:25 am, Andre Lopes wrote: >> Hi, >> >> Thanks for the reply. >> >> I use the field "website_position" to control

Re: making history

2011-08-11 Thread Andre Terra
I have played around with django-audit-log for a while, and so far it works great. However, I do need to work on saving the records to a separate db, as Shawn suggested. Fwiw, there's a page on the wiki about audit trail/logs, which, albeit outdated, should prove helpful. Cheers, AT On 8/10/11,

Re: Displaying results in Template in a Table ? What is the proper way ?Any app?

2011-08-11 Thread Andre Terra
I'm personally considering serializing my objects and using ExtJS for powerful data grids. Their subtotal grouping mode looks just like what I want. Check out their example page and read through the .js file to see and example of the serialized data. Cheers, AT On 8/10/11, Adam Zedan wrote: >

Re: Django-sms

2011-08-11 Thread Andre Terra
http://djangopackages.com/grids/g/sms/ On Thu, Aug 11, 2011 at 12:01 PM, damola oyeniyi wrote: > Hi all, > > Please can someone tell me where the django-sms app is? I cannot find it on > the google code repository. > > Regards > > -- > You received this message because you are subscribed to the

Re: MySQL data export to Excel sheet

2011-08-11 Thread Andre Terra
Take a look at the builtin enumerate() function. Cheers, AT On Thu, Aug 11, 2011 at 11:33 AM, Dipo Elegbede wrote: > Hello All, > > I have a little problem, I,d like to share with you for possible solution. > > I have a models like this: > > class MyBuddyt(models.Model): > > location = model

Authentication App to use?

2011-08-15 Thread Andre Lopes
Hi, I am new to Django, and I have been reading about authentication and authorization in Django. Due to the complexity of this subject I was thinking to use a 3rd party developed App for this. I have found this App: https://github.com/pennersr/django-allauth My question. There are others Apps I

Re: Authentication App to use?

2011-08-15 Thread Andre Lopes
Thanks for the reply. Django-Registration (http://djangopackages.com/packages/p/django-registration/) have the Social Auth (Google, Yahoo, OpenId, etc)? Best Regards, On Mon, Aug 15, 2011 at 10:11 AM, Reinout van Rees wrote: > On 15-08-11 11:01, Andre Lopes wrote: >> >> My

3rd party Apps in Django

2011-08-15 Thread Andre Lopes
Hi, I have put this question in StackOverflow, but no response untill now... This is an important question to me to understand how Django works I am new to Django. I have some doubts about installing 3rd party Apps in Django. A specific example. The "django-registration" App in https://bitbucket

Re: 3rd party Apps in Django

2011-08-15 Thread Andre Lopes
g pip will take care of requirements the package might have and >> install it in the right python lib folder so several projects can use >> it among other things. >> >> Are there good reasons NOT to use pip/easy_install or at least python >> setup.py instal

Django-Registration, How can a beginner work with this 3rd party App?

2011-08-15 Thread Andre Lopes
Hi, another question from a beginner. I am getting some trouble to get Django-Registration working. The on-line documentation(http://readthedocs.org/docs/django-registration/en/latest/) is not for a beginner like me, there are many steps that I don't know how to do them. For example the creation

Re: Django-Registration, How can a beginner work with this 3rd party App?

2011-08-15 Thread Andre Terra
If you haven't you should start > there and not jump directly at a third app. After doing the tutorials > and reading through the djangobook the online documentation of > third-party apps won't be so cryptic. > > Thomas > > On Mon, Aug 15, 2011 at 8:38 PM, Andre Lopes

How to Layout a Django Application?

2011-08-16 Thread Andre Lopes
Hi, another question from a Django beginner. I have played with views and templates a little bit, but now I want to make a real layout(Header, Side Column and Footer). There are any guides on layouts that I should follow? There are Apps that will help me with that task? Please le me know. Best R

Re: Django-Registration, How can a beginner work with this 3rd party App?

2011-08-16 Thread Andre Lopes
Thanks for your reply. I will follow this tutorial. Best Regards, On Tue, Aug 16, 2011 at 4:36 PM, shacker wrote: > See also: > > django-profiles: The Missing Manual > http://birdhouse.org/blog/2009/06/27/django-profiles/ > > (django-profiles and django-registration are close cousins; I always >

Re: Json serialization help

2011-08-16 Thread Andre Terra
Thank you a lot for this snippet! I've wondered about how to export objects to excel in a "more natural way" and this seems to be a great approach, considering all the different gotchas. Thank you for taking the time to write this.. I've been postponing this little bit of research for the longest

Re: How to Layout a Django Application?

2011-08-16 Thread Andre Terra
-inclusion-tags On Tue, Aug 16, 2011 at 2:46 PM, Andre Lopes wrote: > Hi, another question from a Django beginner. > > I have played with views and templates a little bit, but now I want to > make a real layout(Header, Side Column and Footer). There are any > guides on layouts that I

Re: How to Layout a Django Application?

2011-08-17 Thread Andre Lopes
Obrigado André(Thank you André), I have read about the templates. Seems easy. Continue with the learning... Regards, On Tue, Aug 16, 2011 at 2:04 PM, Andre Terra wrote: > There are no particular layouts, but sometimes writing an inclusion tag[1] > can help with abstracting some of the

Re: need help regard to setup a web-hosting environment for Django

2011-08-17 Thread Andre Terra
*Best Right way to install django, python packages:* http://www.saltycrane.com/blog/2009/05/notes-using-pip-and-virtualenv-django/ *Install nginx and serve django apps through fcgi: *https://docs.djangoproject.com/en/dev/howto/deployment/fastcgi/* *https://code.djangoproject.com/wiki/ServerArrange

Re: GeoDjango Use

2011-08-17 Thread Andre Terra
http://geodjango.org/presentations/ On Wed, Aug 17, 2011 at 3:06 PM, Dan H wrote: > how would I use geodjango to store geographic data in just one table > of my database? can you import it as another app in a django project? > or how would that work? > > -- > You received this message because yo

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

2011-08-17 Thread Andre Terra
DB authentication and user authentication are separate things. Users authenticate against Django. Full stop. Django accesses the database using login data you provide on settings.py. If you're talking about permissions, Django ships with a permission module. You can define custom permissions on yo

Re: failed to load dll, what happened?

2011-08-17 Thread Andre Terra
Hello, thinke365, First, please read https://code.djangoproject.com/wiki/UsingTheMailingList Try running manage.py from a shell/prompt, not from the IDE. See also http://www.saltycrane.com/blog/2009/05/notes-using-pip-and-virtualenv-django/ Cheers, AT On Wed, Aug 17, 2011 at 2:03 PM, thinke36

Re: Best approach to handling different types of Users

2011-08-18 Thread Andre Terra
Do create a UserProfile with an FK to user, but add an FK to Group as well. This way you can take advantage of the existing Permissions application which would allow/deny users access to various parts of your application. Just make sure your views take those permissions into consideration! Cheer

Re: m2m assignments lost when saving in admin but not shell

2011-08-18 Thread Andre Terra
Your instance is probably not yet saved to the database, so the m2m-related objects don't know which instance to connect to. There's problem something wrong in your save() method. I often use "assert False, some_var" to check if at some point the variable is already set or not. And I get the same

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

2011-08-18 Thread Andre Terra
You can use the cache framework for pretty much anything you want, including saving serialized results of calculations, querysets and whatnot. Please read: https://docs.djangoproject.com/en/dev/topics/cache/ https://docs.djangoproject.com/en/dev/topics/cache/#the-low-level-cache-api https://docs.d

Re: Getting and modifying url parameters in template: howto?

2011-08-18 Thread Andre Terra
Searching with Django = http://haystacksearch.org/ Behold the power of pluggable apps. Cheers, AT On Thu, Aug 18, 2011 at 11:34 AM, samuele.mattiuzzo wrote: > Hi! > I'm stuck with a problem... more confused than stuck, actually. > > I have a search engine i'm working on, and we're using GET me

Re: Getting and modifying url parameters in template: howto?

2011-08-18 Thread Andre Terra
7; bound to any model (since i don't use any backend DB to > store my data) > > i need something like get_full_path or get_absolute_url, but not > modell-related in this case... > > > > On 18 Ago, 16:37, Andre Terra wrote: > > Searching with Django =http://haysta

Re: GenericIPAddressField validation error not translated

2011-08-18 Thread Andre Terra
https://docs.djangoproject.com/en/dev/internals/contributing/translations/ On Thu, Aug 18, 2011 at 12:28 PM, Federico Capoano wrote: > How can I contribute? > > > On Aug 13, 6:50 am, Karen Tracey wrote: > > On Thu, Aug 11, 2011 at 2:58 PM, Federico Capoano > > wrote: > > > > > Hi all, > > > > >

Re: slightly complicated radio input question

2010-12-14 Thread Andre Terra
e SO questions along with yours. Good luck, keep us posted. Sincerely, Andre Terra (airstrike) On Mon, Dec 13, 2010 at 13:52, yiftah wrote: > thanks Ilian, I used the RadioSelect widget to create a radio list. > but i want to create text/select elements between the radio elements > (

Re: wikileaks cables on a django site

2010-12-17 Thread Andre Terra
Love the idea, but where's the magic? It's really lacking a django pony! On Fri, Dec 17, 2010 at 12:25, ahppub wrote: > Check this out, WikiLeaks cables hosted on a Django site :) > http://www.dazzlepod.com/cable/ > > -- > You received this message because you are subscribed to the Google Group

<    1   2   3   4   5   6   >