Re: High cpu usage for wsgi apache processes

2012-01-23 Thread Andre Terra
Hello, Unless you tell us what your app is supposed to be doing, there's very little chance any of us can offer any real help. Cheers, AT On Mon, Jan 23, 2012 at 5:47 PM, TINO THOMAS wrote: > Hello, > > I have a Django setup on cpanel server with python 2.7, virtual env and > mod_wsgi. I can

Re: django: creating tag groups

2013-01-18 Thread Andre Terra
I'd just like to emphasize that django-mptt is *the* way to go. It's one great application that make it a breeze to work with hierarchies. Cheers, AT On Fri, Jan 18, 2013 at 4:01 AM, Sammael wrote: > Amirouche, thank you very much. > jQuery solution is quite interesting but it's more complicat

Re: Long url parameter in GET request locks python

2013-01-30 Thread Andre Terra
I posted this answer on SO and thought I should share it here for the benefit of other and future readers: -- The accepted answer is spot on about the regex, but since we're discussing optimization, I thought I should note that

Re: django support for ms SQL

2013-01-31 Thread Andre Terra
http://django-mssql.readthedocs.org/en/latest/ Cheers, AT On Thu, Jan 31, 2013 at 11:34 AM, wrote: > is there any support for MS SQL ? > > thanks > > -- > You received this message because you are subscribed to the Google Groups > "Django users" group. > To unsubscribe from this group and stop

Re: Kindly help for an interview with Google on python django

2013-01-31 Thread Andre Terra
I don't have any experience in interviews for developer positions, but I have general job interview tips that you might like. First, get to know your resumé. This is my #1 advice. Interviewers usually want to know why you made your decisions. What was the reason behind picking this or that school?

Re: IntegrityError when creating a brand new model instance

2013-02-08 Thread Andre Terra
Please post traceback, settings.py, etc. On Fri, Feb 8, 2013 at 5:18 AM, Some Developer wrote: > I have a model for a Tag object with simply has two fields. A title (which > has the unique constraint) and a description. I also have a FormView based > view class which handles the creation of Tag o

Re: Impossible? Django with NTLM SSO auth on windows?

2013-03-04 Thread Andre Terra
FYI, I found a nginx module for Kerberos authentication too: https://github.com/fintler/nginx-mod-auth-kerb http://michaelshadle.com/2010/01/17/spnego-for-nginx-a-start-at-least It hasn't been updated in quite some time, but it is apparenlty working and perhaps one of you will feel like taking a s

Re: What is the difference between instance.title = attrs.get('title', instance.title) vs instance.title = attrs['title'] ?

2013-03-14 Thread Andre Terra
About the asterisks, please checkout this link: http://stackoverflow.com/questions/4306574/python-method-function-arguments-starting-with-asterisk-and-dual-asterisk the difference between dict['key'] and dict.get('key', 'something') is that the second doesn't raise a KeyError exception when 'key'

Re: What is the difference between instance.title = attrs.get('title', instance.title) vs instance.title = attrs['title'] ?

2013-03-14 Thread Andre Terra
This is a much better explanation on the use of *args and **keywordargs (**kwargs) http://www.saltycrane.com/blog/2008/01/how-to-use-args-and-kwargs-in-python/ On Thu, Mar 14, 2013 at 6:22 PM, Andre Terra wrote: > About the asterisks, please checkout this link: > > http://stackove

Re: Using values_list and extra on same queryset

2013-03-26 Thread Andre Terra
Could you provide us any examples or code at all? Cheers, AT On Tue, Mar 26, 2013 at 7:51 PM, Larry Martell wrote: > I have some existing code that calls values_list on a queryset. I need > to add something using extra to this queryset. If I call extra before > values_list the extra stuff is go

Re: Is file based cache is safe for concurrent process?

2013-03-26 Thread Andre Terra
safe or not, it is slow. why not use redis? On Tue, Mar 26, 2013 at 9:57 PM, Ivan Smirnoff wrote: > Hi all. > Can anyone tell, does django.cache locks file for writing by concurrent > process? > > -- > You received this message because you are subscribed to the Google Groups > "Django users" gro

Re: Navigation Bar

2013-03-27 Thread Andre Terra
In my last project I created a template tag that would take an app name as an argument and build the links according to that user's permissions for the links in that app. This made the template easier to read at the cost of having to write the function and learning how it worked. Since I was the on

Re: Admin pagination not digg-style

2013-04-24 Thread Andre Terra
Override the default template and add a for loop with {% forloop.counter %}'s from 0 to max-pages or whatever the variable is called. Assuming you're talking about the change form, please see this: http://stackoverflow.com/a/3729995/447485 Otherwise you can still probably work from the info provi

Re: Dynamic forms and related models.

2013-05-09 Thread Andre Terra
On Wed, May 8, 2013 at 6:43 PM, noodlygod wrote: > > > < > Class Level (Text field)> > Definition.objects.filter(category__label='Skill'))> field)> > Definition.objects.filter(category__label=Attribute'))>< Attribute score > (Text field)> > > I was on my way to creating a fully custom form in

Re: Django with 2 subapps with same name

2013-05-10 Thread Andre Terra
Granted this structure doesn't seem reasonable. Each manufacturer shouldn't be a separate app, but rather "backends" to generic storage or invoice apps. So you only need INSTALLED_APPS = ( # ... 'storage', 'invoice' ) And then work from there. The apps themselves should be able to reg

Re: Django with 2 subapps with same name

2013-05-15 Thread Andre Terra
Despite possibly working with different app_labels, I believe the point still stands that if the storage and invoice apps share a lot of functionality among vendors, they should just be 'invoice' and 'storage' and allow for pluggable companies. Cheers, AT On Mon, May 13, 2013 at 12:02 PM, Tom Ev

Re: warnings.warn("The Databrowse contrib app is deprecated", DeprecationWarning)

2013-06-11 Thread Andre Terra
Hi, Snake The databrowse contrib app has been deprecated since 1.4, but it's still available as an external library[0]. Please read the release notes for that version to know more about that. [1] Cheers, AT [0] https://pypi.python.org/pypi/django-databrowse [1] https://docs.djangoproject.com/

Re: Django Basics

2013-06-14 Thread Andre Terra
You really *should* use a database, even if you use SQLite just for learning. SQLite saves a .db file to your hard drive, but it's a RDBMS like many other, albeit in simpler form. Take a look at the tutorial[1] and if you have any questions, try googling, asking here or on stackoverflow[2] Cheer

Re: A PHP framework with some Django features?

2013-06-28 Thread Andre Terra
I've heard good anecdotes about http://laravel.com/... but I'd never ever leave Django... Cheers, AT On Fri, Jun 28, 2013 at 12:52 PM, Deepak Kumar wrote: > I have used symfony2 quite a bit and as very rightly said by *Tiago > Almeida *in the thread below that SonataAdminBundle (in sf2 contex

Re: rich text editor

2013-07-18 Thread Andre Terra
Impossible is nothing™, but I don't see the benefits of combining rich text with social networking. Things like BBCode[0] usually offer a better trade-off between flexibility/usability/maintenance. Based on a quick google search, it seems there are solutions tailored for use with Django [1][2] [0]

Re: rich text editor

2013-07-18 Thread Andre Terra
else. Please explain. > Liked "Impossible is nothing™" > > > On Thu, Jul 18, 2013 at 10:44 PM, Andre Terra wrote: > >> Impossible is nothing™, but I don't see the benefits of combining rich >> text with social networking. Things like BBCode[0] usually of

Re: rich text editor

2013-07-18 Thread Andre Terra
You're welcome! We're here to help. Glad to be of service. Cheers, AT On Thu, Jul 18, 2013 at 3:59 PM, Kakar Arunachal Service < kakararunachalserv...@gmail.com> wrote: > Thank you so much!!! I will try it for sure! Thanks again! > > > On Fri, Jul 19, 2013 at

Re: Is Celery the best option?

2013-07-19 Thread Andre Terra
I had never heard about Rq before, seems interesting indeed! Thanks for the recommendation. Cheers, AT On Fri, Jul 19, 2013 at 4:04 PM, Doug Ballance wrote: > Celery is a good option, and probably the most used. There are a couple > of other options that may be worth looking into: > > Huey

Re: Django Dashboard

2013-07-30 Thread Andre Terra
On Tue, Jul 30, 2013 at 3:16 PM, Charly Román wrote: > > You can try with pydashie, a python port of ruby version: > https://github.com/evolvedlight/pydashie Except that's Flask, not Django. Cheers, AT -- You received this message because you are subscribed to the Google Groups "Django us

Re: Impossible? Django with NTLM SSO auth on windows?

2013-07-31 Thread Andre Terra
On Sun, Jul 7, 2013 at 5:01 PM, Yves Rausch wrote: > Hello guys, > > we had a similar issue and created a new module on apache 2.4 where you > can use ntlm authentication on a windows machine. > Here is the binary download and some information (including a link to > github repository): http://www

Re: connecting to MS SQL server in addition to default MySQL

2013-08-07 Thread Andre Terra
You can use django-mssql[0] as a backend, and then either use the ORM as usual, write RAW queries with Django[1] or just use SQL directly[2]. Cheers, AT [0] http://django-mssql.readthedocs.org/en/latest/ [1] https://docs.djangoproject.com/en/dev/topics/db/sql/ [2] https://docs.djangoproject.com/

Re: I really about to give up Django

2013-08-22 Thread Andre Terra
For the record, it's considered a good coding practice to keep everything in English, including classes, functions and variables. This way it's easier for people to help you. Secondly, your Filhos model should really just be Filho. Finally, don't use obscure names like Brinq. Instead, prefer the

Re: syncdb issue (begginer stuff)

2013-08-26 Thread Andre Terra
On Mon, Aug 26, 2013 at 1:19 PM, Natko Perko wrote: > @laurent i guess it worked, but now i get the error no module named > wikicamp.wiki.. this is all the code i have so far.. make sure the folder containing wikicamp is inside your PATH so you don't get import errors. make sure there's an __in

Re: JSON or YAML?

2013-08-30 Thread Andre Terra
It depends on where your data is coming from. YAML has less cruft in it, so if you're writing your own serializer you can consider it to have an advantage over JSON. OTOH, many applications can already export to JSON, so you can leverage that if that's the case. Finally, If you're writing anythin

Re: I really about to give up Django

2013-09-02 Thread Andre Terra
*Non sequitur*. Obscure variable names can happen regardless of the coder's language choice, and most definitely do not encourge the use of one's native tongue. As others have said in the thread, if you're writing *in English* to ask for help, you should probably code in English as well. It's not

Re: quick question: RE model relations

2013-09-02 Thread Andre Terra
As per the current docs[0], you need to provide a dotted path to your model in the form app.ModelName when defining a ForeignKey. So try this instead: GalleryId = models.ForeignKey('galleryview.Gallery', verbose_name=_('Gallery Id'), related_name='Gallery_Id',blank=True, null=True, help_text=_("Y

Re: quick question: RE model relations

2013-09-02 Thread Andre Terra
gument to the definition for > 'GalleryId'. > events.event: Reverse query name for field 'GalleryId' clashes with > related field 'Gallery.Gallery_Id'. Add a related_name argument to the > definition for 'GalleryId'. > > > now i'm really lo

Re: Prefork vs threaded when I want to spawn my own threads

2013-09-04 Thread Andre Terra
On Wed, Sep 4, 2013 at 2:36 PM, Javier Guerra Giraldez wrote: > above that, Redis is a clean, fast and very scalable platform for > queues. if you don't have heavy buzzword dependency, i wouldn't > bother checking AMQP systems and stay with Redis. > A thousand times this. You don't need AMQP sys

Re: Using User.add_to_class

2011-05-01 Thread Andre Terra
First of all, I'm a noob. But why not using a custom User model altogether? Such as UserProfile with an FK to auth User and run the checks against that in your app? This seems to be like the solution with less maintenance overhead. Sincerely, André Terra (airstrike) On Fri, Apr 29, 2011 at 12:

Re: ANN: Two-level caching for Django

2011-05-04 Thread Andre Terra
Great work! Thanks a lot, I might need to use this soon. Sincerely, Andre Terra (airstrike) On Wed, May 4, 2011 at 5:31 AM, Malcolm Box wrote: > Hi, > > We recently hit a bottleneck accessing a memcached server from Django on a > big site. To solve it, I created two-level cache

Re: Django password reset modification

2011-05-06 Thread Andre Terra
What you *can* do is e-mail the user with a link to reactivate his password, possibly requesting that he gives the right reply to a secret question. It's a good compromise between ease and security. On Fri, May 6, 2011 at 2:01 PM, DrBloodmoney wrote: > On Fri, May 6, 2011 at 12:36 AM, Phui-Hock

Re: Experiences with virtualenv + Django?

2011-05-24 Thread Andre Terra
Here's my go-to reference guide to using virtualenv and pip for django development[1]. The same steps apply to deployment, to some extent. Additionally, I recommend you checkout virtualenvwrapper[2]. It makes your life incredibly easier and switching virtualenvs becomes as simple as typing 'workon

Re: hi

2011-05-24 Thread Andre Terra
You can define a value for the model's field by using the commit=False "trick". myform.save(commit=False) returns an instance of the model which hasn't yet been saved to the database. So you can manually set the value for any additional fields and then call save on the object to finally write it t

Re: Django app for data management and visualization

2011-06-01 Thread Andre Terra
Hi Alessio, How are you? Your use case is *very* similar to mine, as our department also goes down the SAP-XLS-PPT path weekly and I'm in charge of making this task easier, faster and less error prone. Have you moved forward with this project at all? I'd love to take a look at some code, assuming

Re: Django 1.3 docs PDF

2011-06-02 Thread Andre Terra
I'm going to repeat myself and say +1 on having links to 'official' PDFs available somewhere in djangoproject.com. Sincerely, André Terra On Thu, Jun 2, 2011 at 1:07 AM, Oscar Carballal wrote: > Didn't know that django had a page on readthedocs.org. But even when > the RTD API generates the sa

Re: VERY cheap django hosting?

2011-06-10 Thread Andre Terra
site5.com is a no-brainer when it comes to inexpensive django hosting. Coupons for free domain registration, and plans starting at $4.95/mo with *unlimited *disk space *and *bandwidth. What else could you ask for? And it's got a wide range of server locations

Re: Django admin report

2011-06-14 Thread Andre Terra
If all you need translating is README.rst, here goes: Django Admin Report Django Admin Report is a small django application that allows for easy exporting of PDF reports through the admin interface. Dependencies -Pisa (http://www.xhtml2pdf.com/) Installation 1. Download the application 2

Dynamic Models for CSV Importing

2011-06-20 Thread Andre Terra
Hello, everyone. I'm trying to develop a web app to rid colleagues of mine of the "SAP -> Wordpad -> Excel -> Access -> Excel" workflow by offering them django instead. I'd like to allow them to upload csv-like text files to an app in our intranet that would load the data onto a temporary DB tabl

Re: Dynamic Models for CSV Importing

2011-06-20 Thread Andre Terra
Thanks for the quick reply, Shawn! The reason I wanted to use Django was so that I could leverage the ORM to allow users to do arbitrary SQL filtering/grouping before the data gets saved onto the production DB. Assuming a 1.5 million lines CSV file (which is probably the smallest file users would

Re: UpdateView help

2011-06-20 Thread Andre Terra
To get keywords from your url, take a look at self.kwargs. Remember you are working with a Class now, and keeping that in mind is fundamental to not getting frustrated with the new CBVs. get_object() is a method that can be overridden by subclasses. Browse the source code for the CBVs to and try t

Re: How do I create dynamic django models ?

2011-06-21 Thread Andre Terra
+1 on that link needing some review. Questions about dynamic models pop up often enough to warrant a canonical explanation. Sincerely, Andre Terra / airstrike On 6/21/11, Satyajit Sarangi wrote: > I went through this link , but couldn't really understand where to put > where . A

Re: How to send the class name from one template to another template both in different apps in django ?

2011-06-21 Thread Andre Terra
It seems you have an issue and you are asking for help on making your solution work, when you should be telling us what it is that you want to do. Only then will we be able to advise you. Sincerely, Andre Terra On 6/20/11, Satyajit Sarangi wrote: > Lets say I work on a class in one template

Re: [Forms] Avoiding Repetition

2011-06-21 Thread Andre Terra
I'm reading this on my phone, so I apologize in advice if I missed something crucial, but what's stopping you from subclassing and overriding just the relevant parts? Sincerely, Andre Terra On 6/17/11, Nikhil Somaru wrote: > Hi, > > Is there a way to reduce the repetition in

Re: QuerySet .annotate().extra() issues

2011-06-21 Thread Andre Terra
BIG FAT DISCLAIMER I'm not sure this has anything to do with your issue, but it's easy to miss when reading the docs. https://docs.djangoproject.com/en/dev/topics/db/aggregation/#interaction-with-default-ordering-or-order-by If your model has an 'ordering' attribute defined in Meta, make sure yo

Re: ANN: django-kolibri - a concept for Asynchronous Processors/Workflow management for django.

2011-06-21 Thread Andre Terra
I only got as far as reading the project overview, but it looks incredibly sweet. Will have to give it a try over the weekend. Keep up the good work! Sincerely, André Terra On Tue, Jun 21, 2011 at 6:29 PM, Thomas Weholt wrote: > On Tue, Jun 21, 2011 at 11:16 PM, Calvin Spealman > wrote: > > I

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

2011-06-22 Thread Andre Terra
Hello, Cal First of all, congrats on the newborn! The Django community will surely benefit from having yet another success story, especially considering how big this project sounds. Is there any chance you could open-source some of your custom made improvements so that they could eventually be mer

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

2011-06-22 Thread Andre Terra
On Wed, Jun 22, 2011 at 11:47 AM, Cal Leeming [Simplicity Media Ltd] < cal.leem...@simplicitymedialtd.co.uk> wrote: > > > On Wed, Jun 22, 2011 at 3:25 PM, Andre Terra wrote: > >> Hello, Cal >> >> First of all, congrats on the newborn! The Django community wi

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

2011-06-29 Thread Andre Terra
Can't access google spreadsheets through my corporate proxy (go figure), but I will vote later today. Really interested in watching this! Andre On Tue, Jun 28, 2011 at 12:30 PM, Cal Leeming [Simplicity Media Ltd] < cal.leem...@simplicitymedialtd.co.uk> wrote: > Second call for anyone who wants

Re: unable to import Modules Present in subdirectores

2011-06-29 Thread Andre Terra
This can't be stressed enough. Please read http://www.python.org/dev/peps/pep-0008/ and try to follow it as best as you can. Sincerely, André Terra On Wed, Jun 29, 2011 at 12:26 PM, bruno desthuilliers < bruno.desthuilli...@gmail.com> wrote: > > > On Jun 29, 3:41 pm, Bill Freeman wrote: > >

Re: Global generic files? Best practice(s)?

2011-06-29 Thread Andre Terra
If you're using it for multiple apps, but just one project and the apps are project-specific, then this code could very well lie in your project's utils.py or any other module. If you're writing code that's meant to be reused by third-parties, then the picture is rather different. I recently had a

Re: ImportError: No module named site

2011-06-29 Thread Andre Terra
As you can see from your urls.py, there is a reference to admin.site and that is probably what's not working on your setup. Try this: $ ./manage.py shell >>> import django >>> django.get_version() >>> from django.contrib import admin >>> admin.site ..and see how far you can go before the first ex

Re: Comparing ManyToManyFields

2011-06-29 Thread Andre Terra
You'll first have to explain what you mean by 'reading from a file' and 'comparing'. Are we comparing against serialized model exports? Is the user importing data from a csv file? What column(s) is(are) you using as keys for matching db objects against the file? Give us a little more details and

Re: Global generic files? Best practice(s)?

2011-06-30 Thread Andre Terra
incerely, André Terra On 6/29/11, Micky Hulse wrote: > Hi Andre! > > Thanks so much for the reply, I really appreciate the help! :) > > On Wed, Jun 29, 2011 at 9:51 AM, Andre Terra wrote: >> If you're using it for multiple apps, but just one project and the apps >>

Re: Global generic files? Best practice(s)?

2011-07-01 Thread Andre Terra
On Fri, Jul 1, 2011 at 3:32 AM, Micky Hulse wrote: Hello Andre! Thanks so much for your help, I really appreciate the pro > advice!!! :) > I'm not sure it's pro, but I'm glad to help :) > On Thu, Jun 30, 2011 at 6:01 AM, Andre Terra > wrote: > > __init_

Re: How to use the django-users mailing list properly and doing your homework..

2011-07-01 Thread Andre Terra
To be honest, I often think about how an e-mail list is actually one of the worst media to help with coding. Here's some food for thought: wouldn't it be better if we had a django-help project that combined django snippets, a stack overflow-like ratings system (an incentive to both good questions

Re: Implementing a User Search Feature

2011-07-02 Thread Andre Terra
You can use Alex Gaynor's great app called django-filter available at https://github.com/alex/django-filter It's the best app for the job, hands down. Sincerely, André Terra On 7/2/11, raj wrote: > Thanks, when I get back to my production comp, ill give this a try. > Did know about this query

Re: error on django-admin.py startproject

2011-07-02 Thread Andre Terra
As always, please post the full traceback. Do you get different results if you add/remove "python" to the start of the command? Cheers, André Terra On 7/2/11, Phil wrote: > Hi, > > I recently installed the latest development version of Django from > subversion. I followed all steps on site, go

Re: create open office docs with django - best way to format text?

2011-07-02 Thread Andre Terra
This is a python question, really. Whether you are running a cli script or coding logic for your django form, the code will most likely use a python library to do the doc writing, much like xlwt is used for writing excel spreadsheets. Try not including django as a keyword for your google search.

Re: JQuery .load() works in production but fails in development

2011-07-03 Thread Andre Terra
trough the official tutorial? It seems to me there are a few concepts you should be aware of. Cheers, Andre Terra On 7/1/11, Joe Linoff wrote: > Hi Folks: > > I figured it out. The idea is NOT to use CGI. It is not needed. Simply use a > Django WSGI URL to access the python module (in a v

Re: complex query

2011-07-04 Thread Andre Terra
ggregation Sincerely, Andre Terra On 7/3/11, Jonas Geiregat wrote: > Hello, > > I have the following models > > class Book(models.Model): > author = models.ManyToManyField(Author) > pub_date = models.DateTimeField() > ... > > class Author(models.Model):

Re: change values in "select list"

2011-07-04 Thread Andre Terra
Hi, Patrick. Here are a couple of hints that will hopefully guide you in the right direction. It seems you are calling return from your class definition, when it is actually supposed to be used in a function. What happened to the label_from_instance function? Where it is supposed to go? I'll le

Re: change values in "select list"

2011-07-04 Thread Andre Terra
adable for those of us who can only speak a language or two. Cheers, Andre Terra On 7/4/11, Andre Terra wrote: > Hi, Patrick. > > Here are a couple of hints that will hopefully guide you in the right > direction. > > It seems you are calling return from your class definition

Re: change values in "select list"

2011-07-04 Thread Andre Terra
loper > LexisNexis > Marxergasse 25, 1030 Wien > > mailto:patrick.sz...@lexisnexis.at > Tel.: 00431 534521573 > Fax: +43 (1) 534 52 - 146 > > > -Ursprüngliche Nachricht- > > Von: django-users@googlegroups.com [mailto:django-users@googlegroups.com] > Im Auftrag von Andre

Re: change values in "select list"

2011-07-05 Thread Andre Terra
us references online that talk about this issue, so for the sake of everyone in the list I'll refrain from extending the matter any further. Sincerely, Andre Terra On 7/5/11, Geoff Kuenning wrote: > > > On Jul 5, 2:00 am, Andre Terra wrote: >> For what it's worth, it

Re: ANN : Kolibri v.0.2.0 - framework for background processing built on celery

2011-07-06 Thread Andre Terra
Hi, Thomas I may have said this before, but this sounds absolutely amazing. Together with DSE, you have built two great apps that I'm looking forward to use in production. Thanks a lot and keep up the good work! Cheers, André Terra (airstrike) On Wed, Jul 6, 2011 at 3:53 PM, Thomas Weholt wro

Re: How to use the django-users mailing list properly and doing your homework..

2011-07-06 Thread Andre Terra
It happens to the best of us... I still believe we could offer a better solution than a simple mailing list, specially considering the possibility of moderating messages and closing open questions. Cheers, André On Wed, Jul 6, 2011 at 5:55 PM, Cal Leeming [Simplicity Media Ltd] < cal.leem...@si

Re: Django installation error: Cannot install Django in Python site-package

2011-07-06 Thread Andre Terra
Hello, Ed A few tips to get you going on the right track: 1) If *Python can't find Django*, it's because it's *not on your PYTHONPATH*. If you have multiple Python installs, it gets even more complex as *> manage.py* can yield different results from* > python manage.py*, depending on how your fi

Re: Issue with saving user information during django_registration

2011-07-06 Thread Andre Terra
Start by pasting relevant code. Views, forms and possibly the backend logic. Use dpaste.com And quit bumping or you'll never get an answer, not from most of us. Regards, André Terra On 7/6/11, CareerDhaba tech wrote: > Bumping once more. Can anyone shine some light on this issue? Would be > ext

Re: Generic ModelAdmin class

2011-07-06 Thread Andre Terra
And if you were planning on hard coding a mapping of your model classes, use get_model() instead. www.b-list.org/weblog/2007/nov/03/working-models/ Cheers, Andre Terra On 7/6/11, gontran wrote: > >> Do you mean, "in a ModelAdmin subclass instance, how do I get the >> model

Re: How to use the django-users mailing list properly and doing your homework..

2011-07-06 Thread Andre Terra
ven any serious thought to the matter. At this point all I wonder is if anybody else feels the same. Cheers, André On 7/6/11, Cal Leeming [Simplicity Media Ltd] wrote: > On Wed, Jul 6, 2011 at 10:35 PM, Andre Terra wrote: >> It happens to the best of us... >> >> I still beli

Re: How to use the django-users mailing list properly and doing your homework..

2011-07-06 Thread Andre Terra
would benefit. If we could bring in the veteran devs, even better. Cheers, Andre On 7/6/11, Javier Guerra Giraldez wrote: > On Wed, Jul 6, 2011 at 5:55 PM, Andre Terra wrote: >> Maybe it's just a matter of endorsing SO more adamantly. When compared >> to the other solution

Re: Some thoughts on a package/stack compile system for easy distribution of webapps..

2011-07-07 Thread Andre Terra
THIS. IS. SPARTA!!! On 7/7/11, Cal Leeming [Simplicity Media Ltd] wrote: > Hydra is already a used package name in Pypi, and a few other code > related projects (would prefer to use a name which isn't already used > in a similar area). :/ > > On Thu, Jul 7, 2011 at 5:28 AM, Venkatraman S wrote:

Re: Issue with saving user information during django_registration

2011-07-07 Thread Andre Terra
ration_form view: > > http://dpaste.com/564165/ > > my views.py file directly from the django_registration app code: > > http://dpaste.com/564166/ > > Here is my form class: > > http://dpaste.com/564167/ > > - Harshil > > > On Thu, Jul 7, 2011 at 3:52 AM

Re: Dreamhost Virtualenv Question

2011-07-07 Thread Andre Terra
A few more important things to note: Your projects shouldn't live within your virtualenv directory. You can create projects and virtualenvs with the same name (I often do), but it's not mandatory. So here's an example setup ~/virtual/djangotrunk ~/virtual/socialwebzone ~/projects/socialwebzone

Re: Django Knowledge Strorehouse

2011-07-07 Thread Andre Terra
This is what I was talking about. We *definitely* need something like this as the docs don't cover a lot of gotchas that impose a steeper learning curve for newcomers. I'm willing to write articles and contribute with some useful snippets, as well as testing the code. +1 on having per-release ver

Re: How to use the django-users mailing list properly and doing your homework..

2011-07-07 Thread Andre Terra
So basically, if SO emailed you new questions tagged as 'django' and your replies were posted as answers, you would be okay? Cheers, André On 7/7/11, Shawn Milochik wrote: > On Thu, Jul 7, 2011 at 10:41 AM, Kevin Monceaux > wrote: >> On Wed, Jul 06, 2011 at 08:38:42PM -0

Re: KeyError in UnitTests

2011-07-07 Thread Andre Terra
My guess is that the input for the country field in the test is not the same as when a user POSTs the form. This is probably because you're passing a Country instance rather than country.name in your 'values' variable. Furthermore, if country can be blank, you should use if cleaned_data.get('cou

Re: RegistrationForm subclass not showing up

2011-07-08 Thread Andre Terra
If I remember this correctly, there's a variable somewhere in django-registration that defines the form to be used. grep (or ack!) the source for RegistrationForm and see if you can find it Cheers, Andre On 7/8/11, katstevens wrote: > Thanks for your answer, but unfortunately that hasn't helped

Re: What is an "application instance"

2011-07-08 Thread Andre Terra
For the record, there is a plan to refactor the concept of 'app' completely, granted any recent development on that front seems to be mostly restricted to discussions in django-developers. I believe the proposed changes draw from the way the admin encapsulates itself in an App class. https://githu

Re: Can't get /admin/ or any page to load

2011-07-08 Thread Andre Terra
Hello, Brent As always, please post full the traceback and urls.py. Use dpaste.com. Cheers, André On Fri, Jul 8, 2011 at 4:33 PM, Brent wrote: > When I go to 127.0.0.1:8000/admin/ I receive this error: > > Caught ViewDoesNotExist while rendering: Tried base in module > django.views.generic.

Re: (UsingTheMailingList) Pre-requisites for newcomers on Django

2011-07-10 Thread Andre Terra
Now that sounds much better! Cheers, André On Sun, Jul 10, 2011 at 12:44 PM, Cal Leeming [Simplicity Media Ltd] < cal.leem...@simplicitymedialtd.co.uk> wrote: > How about this.. > > --- > Asking question about Python related subjects is fine as long as; > > * You follow the same guidelines as th

Re: RegistrationForm subclass not showing up

2011-07-11 Thread Andre Terra
My guess is that there's another module somewhere in your PYTHONPATH from which django is importing these forms. Also, don't edit registration.forms, subclass the form instead. You can also try {{ form.as_p }} to make sure the problem isn't in the template. You can raise an exception somewhere i

Re: FormMixin missing method

2011-07-11 Thread Andre Terra
Hey, Lior Would you mind giving us an example of what you mean by setting up the instance, and why that part of the code should live in the view? It doesn't have to be production-quality code, just an example of the concept you have in mind. Cheers, André On Sat, Jul 9, 2011 at 5:18 PM, Lior Sio

Re: speeding up iterating over query set

2011-07-11 Thread Andre Terra
You seem to be hauling the same data from one side to the other, and I can't see why. Try: MyModel.objects.values_list('id', flat=True) You can use that to build a dictionary if you add a second field, or using list comprehensions which I believe are faster than for loops, dict(MyModel.objects.

Re: RegistrationForm subclass not showing up

2011-07-11 Thread Andre Terra
u can leave that part of the code for them to worry and just work on your project-specific stuff. (I'm not sure how clear that paragraph is, so feel free to ask questions!) Cheers, André Terra > > On Jul 11, 2:13 pm, Andre Terra wrote: > > My guess is that there's anoth

Re: Extending User model with Inheritance - Attribute Error

2011-07-11 Thread Andre Terra
Wherever you would reference a user instance, reference UserProfile.user instead If you need to find out a profile from request.user, you can use request.user.get_profile() or the longer UserProfile.objects.get(user_id= request.user.id) Cheers, André On Mon, Jul 11, 2011 at 1:48 PM, Brent wrot

Re: Extending User model with Inheritance - Attribute Error

2011-07-11 Thread Andre Terra
All you have to do is add the following code to your models.py (or any other module that gets loaded by django, for that matter): # models.py from django.db.models import signals def create_user_profile(sender, instance, created, **kwargs): if created: UserProfile.objects.create(user

Re: Extending User model with Inheritance - Attribute Error

2011-07-11 Thread Andre Terra
though. Here is my stack trace: > > http://dpaste.com/566583/ > > I tried calling get_profile without the (), which got rid of the > error, but no data showed up. > > On Jul 11, 10:15 am, Andre Terra wrote: > > All you have to do is add the following code to your models.

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 "

<    1   2   3   4   5   >