Re: Taggit fragmentation (open letter)

2012-06-16 Thread Alex Gaynor
2 pull requests. > There are 114 forks, 17 of which had commits within the last month. > > Shortly, it is a big mess. I'm sure some of the forks have important > bugfixes while other just add features required for a certain project. But > it is really necessary that either Alex Gaynor o

Re: QuerySet cache

2009-09-06 Thread Alex Gaynor
On Sun, Sep 6, 2009 at 10:14 AM, Thierry wrote: > > QuerySet cache is usually quite great. > However when you are looping through a very large result set it would > be great if I could turn it off. > So here the question, how do I turn off the queryset cache? > > >

Re: name error not defined in models

2009-09-01 Thread Alex Gaynor
On Tue, Sep 1, 2009 at 11:19 AM, Joru wrote: > > Hi > > I got name error in my models when using models.ManyToManyField > Here are my models > > class Ank(models.Model): >    route = models.ManyToManyField(Dek) >    intercity = models.BooleanField() > > class

Re: How do you remove fields from a subclassed form?

2009-08-31 Thread Alex Gaynor
On Mon, Aug 31, 2009 at 12:13 AM, buttman wrote: > > class MyForm(ModelForm): >    field1 = CustomField(custom_option="sdsdsd") >    field2 = CustomField(custom_option="sdsdsd") >    field3 = CustomField(custom_option="sdsdsd") >    # > >    class Meta: >        model =

Re: Getting all unique values of a field with Django ORM

2009-08-30 Thread Alex Gaynor
On Sun, Aug 30, 2009 at 9:37 PM, stevedegrace wrote: > > Hi guys, > > I'm making a refback type linkback app for my hobby CMS. I want to > find all the unique page targets. I am thinking broadly of a couple of > ways to do it. One with the ORM sort of line this: > > targets =

Re: Django searching for admin template in admindocs directory

2009-08-30 Thread Alex Gaynor
On Sun, Aug 30, 2009 at 4:33 PM, Jeff wrote: > > Hi, > > I'm a Django newbie and have run into a Template Not Found error when > setting up the admin interface on a site I'm building. > > Here's the error: >

Re: Advice on Subclassing a TextField

2009-08-30 Thread Alex Gaynor
On Sun, Aug 30, 2009 at 1:53 AM, Mark Anderson wrote: > Hello, > > I wanted a field that would render in a rich text editor and store the data > in a TextField so I created a field type of HtmlField and custom HtmlWidge. > It works but I was wondering is anyone would be

Re: QuerySet without result_cache?

2009-08-27 Thread Alex Gaynor
On Thu, Aug 27, 2009 at 5:56 PM, Sam Tregar<s...@tregar.com> wrote: > On Thu, Aug 27, 2009 at 5:47 PM, Alex Gaynor <alex.gay...@gmail.com> wrote: >> >> Instead of iterating over the QuerySet itself, use >> QuerySet.iterator(), this will avoid populating the resu

Re: QuerySet without result_cache?

2009-08-27 Thread Alex Gaynor
On Thu, Aug 27, 2009 at 5:34 PM, Sam Tregar wrote: > Hey all.  So, I figured out how to run my QuerySet through MySQLdb's > SSCursor!  Woo! > > Bad news: it's still using a ton of memory.  As far as I can tell it's being > used by QuerySet's internal _result_cache which is

Re: show user and date in change_list

2009-08-27 Thread Alex Gaynor
On Thu, Aug 27, 2009 at 12:18 PM, Sandra Django wrote: > Hi, I want display in change_list view, user who added an object and date. I > did that: > - models.py --- >> >> class One(models.Model): >>     .. >> def user(self): >>    

Re: Creating forms

2009-08-25 Thread Alex Gaynor
On Tue, Aug 25, 2009 at 2:40 PM, tom wrote: > Hi all, > > i want to create a form with django. the form should look like a matrix > (or like an excel/oocalc sheet). i attached a screenshot how the form > should look like. > can anybody tell me how to do this with django? >

Re: Trouble getting doctests to execute in app with no model...

2009-08-25 Thread Alex Gaynor
On Tue, Aug 25, 2009 at 2:12 PM, Joseph (Driftwood Cove Designs) wrote: > > We use a custom authentication backend, and I'm trying to develop a > test suite for it.  The app has no model, since it uses the model from > contrib.auth  So, I put my tests in tests.py, but the

Re: How to validate image dimensions?

2009-08-21 Thread Alex Gaynor
On Fri, Aug 21, 2009 at 3:50 AM, TiNo wrote: > On Fri, Aug 21, 2009 at 10:40, Léon Dignòn wrote: >> >> Hello, >> >> in my ModelForm I try to allow only images (for avatar) smaller than >> 64*64 pixels. I've done this by overriding clean_avatar(). But how

Re: How to get an object knowing its content_type and id?

2009-08-20 Thread Alex Gaynor
On Thu, Aug 20, 2009 at 3:01 PM, joe.kon...@gmail.com wrote: > > Hello, > > I've got a model that can be linked to any other via GenericForeignKey > (), similar to the tagging example. The problem I'm having is that the > module I'm forced to use is passing the parameters in

Re: Bulk data insert

2009-08-20 Thread Alex Gaynor
On Thu, Aug 20, 2009 at 1:46 PM, Abiel wrote: > > Is there an efficient way to use Django models to load a large number > of records into a database without falling back on raw SQL? Creating a > large number of model objects and then saving each one individually is > very slow

Re: save a form

2009-08-19 Thread Alex Gaynor
On Wed, Aug 19, 2009 at 11:22 AM, luca72 wrote: > > how i can get the value of the fields? > > On 19 Ago, 17:45, Daniel Roseman wrote: >> On Aug 19, 3:40 pm, luca72 wrote: >> >> > Iis but form.save don't work >> >> That's true. >>

Re: Why using ForeignKey and not OneToOne to extend the user profile?

2009-08-18 Thread Alex Gaynor
On Tue, Aug 18, 2009 at 8:57 AM, Léon Dignòn wrote: > > Hello, > > in the authentication documentation is written that the user profile > should be extended with a foreign key. > > - >

Re: Problem installing Django 1.1 on XP

2009-08-18 Thread Alex Gaynor
2009/8/18 Nikola Smiljanić : > > I installed Django 1.1 on my Windows 7 machine with 64bit Python 2.6.2 > without any problems, but now I tried to install it on Windows XP with > Python 2.6.2 and here is what I get: > > D:\Django-1.1>python setup.py install > Traceback (most

Re: Django model register for admin section

2009-08-18 Thread Alex Gaynor
On Tue, Aug 18, 2009 at 3:28 AM, ajay wrote: > > Hi , >   To register model in admin section we need to Register individual > class >   Example: >      admin.site.register(Poll) >      admin.site.register(Choice) >     admin.site.register(Vote) > > Is there other way to

Re: Possible to use Django & MySQL with Python 2.6?

2009-08-16 Thread Alex Gaynor
On Sun, Aug 16, 2009 at 11:32 PM, Continuation wrote: > > According to the site of the python MySQL driver it only supports > Python 2.3 - 2.5: > http://sourceforge.net/projects/mysql-python/ > > So is it possible to use Django & MySQL with Python 2.6? Is there any >

Re: QuerySet's cache

2009-08-16 Thread Alex Gaynor
On Sun, Aug 16, 2009 at 8:42 AM, David wrote: > > Hi all, > > I'm a bit puzzled by the caching behaviour of QuerySets, when used in > iteration and when called with repr(). According to the documentation, > when a QuerySet is evaluated for the first time, the results

Re: mass-updating question

2009-08-13 Thread Alex Gaynor
On Thu, Aug 13, 2009 at 2:51 PM, Jonas Obrist wrote: > > Hi django-users > > I try to do as much as I can in ORM without python looping etc. So I > wonder if the following code could be done in one update: > > for parent in thread.forum.allparents.all(): >    parent.postcount

Re: Need help with filter, limit and order_by query

2009-08-12 Thread Alex Gaynor
On Wed, Aug 12, 2009 at 11:49 AM, cerberos wrote: > > Say there are 10 records, I want records 3 & 4 in descending order. > > q1 = ModelName.objects.order_by('id').filter(id__gte=3)[:2] # gives > the records I want but in ascending order > q2 =

Re: Django aggregates and having

2009-08-12 Thread Alex Gaynor
On Wed, Aug 12, 2009 at 1:34 AM, lfrodrigues wrote: > > Sorry I didn't explain my self properly. > > I want this query: > SELECT (date_format(date, '%%U')) AS `d`, SUM > (`profile_scorehistory`.`points`) AS `l` FROM `profile_scorehistory` > GROUP BY date_format(date, '%%U')

Re: unique_together with None

2009-08-11 Thread Alex Gaynor
On Tue, Aug 11, 2009 at 8:25 AM, gentlestone wrote: > > On 11. Aug, 15:01 h., Gustavo Henrique wrote: >> Try also: null=True, blank=True >> >> -- >> Gustavo Henriquehttp://www.gustavohenrique.nethttp://blog.gustavohenrique.net > > blank=True ... I

Re: Dumping Large Databases

2009-08-11 Thread Alex Gaynor
On Tue, Aug 11, 2009 at 5:37 AM, Chris Spencer wrote: > > I guess I should have prefixed that by saying my goal is to migrate > from MySQL to PostgreSQL. However, I'm having trouble finding a tool > to do this, so I thought I'd try Django's backend neutral > dumpdata/loaddata

Re: Custom model field and Django-admin -- error

2009-08-10 Thread Alex Gaynor
On Mon, Aug 10, 2009 at 8:45 AM, BenW wrote: > > Hello, > > I'm working with a legacy database that stores datetimes as unsigned > ints.  Rather than do the conversion with properties on the model I've > written a custom Field 'UnixDateTimeField': > > class

Re: My ModelAdmin customizations don't work

2009-08-08 Thread Alex Gaynor
On Sat, Aug 8, 2009 at 8:37 PM, Chao Xu wrote: > > I want't to add search in admin site and followed the instructions of > official guide of The Django admin site. But nothing on admin site > changed, nor errors appeared after I changed my code. > > following is my code,

Re: DeprecationWarning - How can I fix this?

2009-08-08 Thread Alex Gaynor
On Sat, Aug 8, 2009 at 6:41 PM, dmpeters63 wrote: > > I get the following error when accessing my MySQL database with Django > on my localhost: > >    /var/lib/python-support/python2.6/MySQLdb/__init__.py:34: > DeprecationWarning: the sets module is deprecated from sets

Re: Sum for each day? aggregate / annotate

2009-08-08 Thread Alex Gaynor
On Sat, Aug 8, 2009 at 6:12 PM, tm wrote: > > Hello, > > I have been trying all sorts of things with aggregate and annotate and > can't seem to get the right combination.  Is there a way to get the > sum of one or multiple columns for each day?  Similar to: > > SELECT

Re: Bug with model get_*_display() methods?

2009-08-08 Thread Alex Gaynor
On Sat, Aug 8, 2009 at 2:09 PM, Margie wrote: > > Ok, still slightly confused.  First - a high level description.  I > have a field that contains choices, but when I display the select, I > want to display some extra html below the select box, so I am creating > a custom

Re: python md5

2009-08-06 Thread Alex Gaynor
On Thu, Aug 6, 2009 at 12:55 PM, Asinox wrote: > > Hi guys, please i need to know why md5 return this: > > > > > the way that im using: > > def encriptar(): >    toEncode = pickle.dumps(datetime.now) >    encoded = md5.new(toEncode) > >    return encoded > > > Thanks > > > You

Re: Have I found a bug? Deletion and rolled back transactions

2009-08-05 Thread Alex Gaynor
On Wed, Aug 5, 2009 at 11:31 AM, Peter Bengtsson wrote: > > I have found that when running this as a normal server, the rollback > DOES work. It's just in tests it doesn't work. > > On 5 Aug, 17:27, Peter Bengtsson wrote: >> Here's the models: >> >> #

Re: Searchform with pagination and GET parameters - easy solution needed

2009-08-05 Thread Alex Gaynor
On Wed, Aug 5, 2009 at 10:03 AM, tom wrote: > > Hi folks, > > i want to build a searchform (with GET parameters) and also want to > use pagination. But i can't find an easy solution for this common > case. > My solution has a searchform, a view and a template. Can anybody

Re: Can i rise 404 from my middleware ?

2009-08-04 Thread Alex Gaynor
On Tue, Aug 4, 2009 at 4:45 PM, Mirat Can Bayrak wrote: > > Question is simple. i tried to use raise Http404 from middleware and that is > not working. > > My middleware is : > > import urlparse > from django.contrib.sites.models import Site > from django.http import

Re: Intermediate Table question

2009-08-04 Thread Alex Gaynor
On Tue, Aug 4, 2009 at 3:06 PM, LeeRisq wrote: > >> I don't believe it would work, but even if it did, what would this do? >>  What's the expecected behavior? > > > class A defines an consumer order > > class B and C both define different lines of product > > I'd like to store

Re: model upload_to

2009-08-04 Thread Alex Gaynor
On Tue, Aug 4, 2009 at 2:53 PM, caliman wrote: > > Hi! > > I'm trying to change upload_to dynamically. > > My model: > class File(models.Model): >    type = models.CharField(max_length=10) >    the_file = models.FileField(upload_to="folder") > def __unicode__(self): >    

Re: 'RelatedManager' object is not iterable

2009-08-04 Thread Alex Gaynor
On Tue, Aug 4, 2009 at 1:16 PM, british.assassin wrote: > > Hi, > > In the views.py for my app I have the following: > > def index(request): >    categories = models.Category.objects.all() >    return render_to_response("forum/index.html", > {'categories':categories})

Re: Intermediate Table question

2009-08-04 Thread Alex Gaynor
On Tue, Aug 4, 2009 at 11:58 AM, LeeRisq wrote: > > Does anyone know if an intermediate table can be specified on more > than two models? For instance: > > class A(m.Model): >       B = ManyToManyField(B, through='D') >       C = ManyToManyField(C, through='D') > > Will this

Re: Unit test failing with 302 instead of 200, using Django's TestCase class

2009-08-04 Thread Alex Gaynor
On Tue, Aug 4, 2009 at 11:26 AM, palmeida wrote: > > Hi, > > I'm running a test that fails when using Django's TestCase class, but > not when running TestCase from unittest. This is my test class: > > class LoggedInUser(TestCase): >    fixtures = ['myflow'] >    def

Re: Adding errors

2009-08-04 Thread Alex Gaynor
On Tue, Aug 4, 2009 at 11:17 AM, CrabbyPete wrote: > > I want to return an error that a user was not found. I wanted to add > the error and have it formatted using errorlist as happens with a > required field. So I did the following > > lform._errors['username']  =

Re: Date/time field styling?

2009-08-03 Thread Alex Gaynor
On Mon, Aug 3, 2009 at 6:18 PM, Malcolm Tredinnick wrote: > > On Mon, 2009-08-03 at 11:29 -0700, mhulse wrote: >> Hello, >> >> {{ form.start }} >> >> For example, outputs this: >> >> > > >> >> I have tried: >> >> {{ form.start_0 }} and {{ form.start_1 }}, but that

Re: UserProfile and select_related

2009-08-03 Thread Alex Gaynor
On Mon, Aug 3, 2009 at 5:12 AM, Malcolm Tredinnick wrote: > > On Mon, 2009-08-03 at 02:48 -0700, alant...@neei.uevora.pt wrote: >> Hello, >> >> I'm displaying lot of user profile picture with are on a user profile >> (i'm using contrib.auth). So for each picture I have a

Re: Python Conditional help

2009-08-01 Thread Alex Gaynor
On Sat, Aug 1, 2009 at 6:59 PM, prabhu S wrote: > > change student_id_validate to student_id_check > > Invalid variable dude. > > On Aug 2, 12:46 am, cprsystems wrote: >> I'm trying to redirect users of an html page to another page depending >> on the

Re: forward declaration

2009-07-31 Thread Alex Gaynor
On Fri, Jul 31, 2009 at 1:56 PM, Daymien wrote: > > Hallo, > > How could I implement forward declaration in django models? > this example wouldn't work for me: > Has anyone an idear or a solution? > > This django model show a simple implementation for a bloodline

Re: odd behavior with session variable that contains a list

2009-07-31 Thread Alex Gaynor
On Fri, Jul 31, 2009 at 1:15 PM, Margie wrote: > > I am seeing some behavior with session that I don't understand.  If I > have a session variable called recentAddIds that contains a list.  I > find that if I append to that list, like this: > >  

Re: Application Template on top of Django

2009-07-30 Thread Alex Gaynor
On Thu, Jul 30, 2009 at 11:52 AM, n179911 wrote: > > Hi, > > I am new to Django.  Can you please tell me if there is sample > application template  which builds on top of Django? Like of like > 'AppFuse' http://appfuse.org/ in Java World. > > What I mean is, for common webapp,

Re: sqlite error: Encrypted or Not a Database

2009-07-29 Thread Alex Gaynor
On Wed, Jul 29, 2009 at 9:06 PM, Art wrote: > > I have created a Django using sqlite as the database, and everything > works fine. But when I try to open the database using sqlite directly > rather than through Django: > sqlite mydatabase.db > I receive the message "File

Re: Query builder or report builder

2009-07-29 Thread Alex Gaynor
On Wed, Jul 29, 2009 at 7:36 PM, mike wrote: > >> I've written an app called django-filter which seems like it may be >> what you want:http://github.com/alex/django-filter/tree/master. >> Here's an example of it in use with a ticketing >> appliation:http://imgur.com/BPpmf.png

Re: Can I have custom validation in the admin change_list form when using ModelAdmin.list_editable?

2009-07-29 Thread Alex Gaynor
On Wed, Jul 29, 2009 at 5:05 PM, Vasil Vangelovski wrote: > > Is it possible to define custom validation for the form in the admin > change list when using ModelAdmin.list_editable? > > > > Yes, get_changelist_form, and get_changelist_formset:

Re:

2009-07-29 Thread Alex Gaynor
On Wed, Jul 29, 2009 at 2:25 PM, Margie wrote: > > I have a question about what people recommend when rendering custom > widgets.  My question relates to whether the rendered widgets should > contain their own scripts.  Let me use an example.  Say I have a table > and

Re: Query builder or report builder

2009-07-29 Thread Alex Gaynor
On Wed, Jul 29, 2009 at 12:38 PM, mike wrote: > > I'm new to django, somewhere between a newbie and novice :-). > > I'm looking for a query builder front end...middleware or app, and > thought I'd ask if anyone knows of such a django app or middleware. > I'm trying to avoid

Re: Simple Pagination Problem

2009-07-29 Thread Alex Gaynor
On Wed, Jul 29, 2009 at 10:04 AM, Mark wrote: > > Ye thats what I was afraid of - i was hoping there was something in > the Pagination object that would help me out. > But I cant see anything. > > Maybe someone will point it out after I have implemented the above. > >

Re: Error - got an unexpected keyword argument 'instance' on initialising form

2009-07-28 Thread Alex Gaynor
On Tue, Jul 28, 2009 at 2:02 PM, phoebebright wrote: > > I thought I was faithfully coping the tutorial, so don't understand > why I get this error. > > Here is the code in the view: > > @login_required > def edit_todo(request, todo_id): > >    task =

Re: Prefetch user profiles

2009-07-27 Thread Alex Gaynor
On Tue, Jul 28, 2009 at 1:19 AM, Andrew Fong wrote: > > Hi all, > > I'm using contrib.auth and have set up my own Profile model, linked to > the User model with OneToOneField. There are a lot of times when I'd > like to prefetch the Profile model when getting the User model

Re: iterating through user.groups

2009-07-27 Thread Alex Gaynor
On Mon, Jul 27, 2009 at 10:54 AM, Salvatore Leone wrote: > > Hi, > > anyone knows why this code: > > {% for group in user.groups%} >      {{group.name}} > {%endfor%} > > raise this exception: > > >      "Caught an exception while rendering: 'ManyRelatedManager' object

Re: Database connection closed after each request?

2009-07-24 Thread Alex Gaynor
On Fri, Jul 24, 2009 at 8:36 PM, Andy wrote: > > On Jul 24, 4:39 pm, James Bennett wrote: >> Except this is what it turns into. So suppose a patch is added which >> does nothing except keep the database connection open; well, that's >> problematic

Re: Where are the admin app icons from?

2009-07-24 Thread Alex Gaynor
On Fri, Jul 24, 2009 at 5:12 PM, Margie wrote: > > Hi, > > I'm wondering if the icons in the admin app (for example, the > addlink.gif icon) come from some standard icon (free) icon package > where there are more goodies of the same sort?  Anyone have any > pointers for

Re: Django-admin {{ root_path }} problem !

2009-07-22 Thread Alex Gaynor
Did you by any chance copy the text of the old templates, from before the rc? If so you'll need to update them for thr changes. Alex On Jul 23, 2009 12:35 AM, "Dr.Hamza Mousa" wrote: Hello Thanks Russ for the fast reply , The url for the admin is the same as the

Re: Use an arbitrary changelist

2009-07-22 Thread Alex Gaynor
On Wed, Jul 22, 2009 at 7:08 AM, TiNo wrote: > Hi, > I would like a second changelist for an app. Besides the changelist that > shows all members, I would like to show a changlist that show all members > interested in some category. I now I can apply a list filter in the main >

Re: OR in query_set

2009-07-21 Thread Alex Gaynor
On Tue, Jul 21, 2009 at 4:48 PM, caliman wrote: > > How do you use django to use OR instead av AND when you use filter? > > Let's say I want: > SELECT * FROM table WHERE attrib1 IN (1,2,3)  OR attrib2 IN (4,5,6) > > in django: >

Re: coercing to Unicode: need string or buffer, Post found

2009-07-20 Thread Alex Gaynor
On Mon, Jul 20, 2009 at 2:00 PM, AKK wrote: > > I kinda know what the problem is here but don't know how to fix it. > > I have this model class Comment(models.Model): > >    comment_post = models.ForeignKey('Post') >    comment_date = models.DateTimeField('Date comment

Re: combining valueslistqueryset with a simple list

2009-07-20 Thread Alex Gaynor
On Mon, Jul 20, 2009 at 6:48 AM, Viktor wrote: > > Hi, > > I would like to run something like > > ["User",].expand(MyObject.objects.all().values_list('myfield', > flat=True) > > but expand seemingly can't handle this operation. > I was trying MyValuesListQuerySet.insert,

Re: Redundant SQL queries regarding DELETE ALL

2009-07-20 Thread Alex Gaynor
On Mon, Jul 20, 2009 at 1:10 AM, aXqd<axqd...@gmail.com> wrote: > > On Mon, Jul 20, 2009 at 12:00 PM, Alex Gaynor<alex.gay...@gmail.com> wrote: >> >> On Sun, Jul 19, 2009 at 9:51 PM, aXqd<axqd...@gmail.com> wrote: >>> >>> Hi, all: >>&

Re: Redundant SQL queries regarding DELETE ALL

2009-07-19 Thread Alex Gaynor
On Sun, Jul 19, 2009 at 9:51 PM, aXqd wrote: > > Hi, all: > > I encountered another redundant SQL query problem while using django. > And this time it might even cause a defect of my own program. > > Here is the thing. I want to do something like below: > FOO.objects.filter(

Re: Change default queryset in admin for a model

2009-07-19 Thread Alex Gaynor
On Sun, Jul 19, 2009 at 5:07 PM, Some Guy wrote: > > Thanks for the help :-) > > overriding queryset in modeladmin worked for the filtering. > > as for the subclassing of the model.. > > I've basically got a table with lots of columns ex.[a,b,c,d,e,f,g...] > I would like to

Re: A simple use for multidb... is this possible yet?

2009-07-19 Thread Alex Gaynor
On Sun, Jul 19, 2009 at 3:29 PM, Jon Loyens wrote: > > Hi everyone (particularly those working on multidb), > > I have a pretty simple use case that involves use of multidb support > and I was wondering if the code base for multidb is far enough along > to help me out on

Re: Using Django's Cache

2009-07-19 Thread Alex Gaynor
On Sun, Jul 19, 2009 at 1:05 PM, WilsonOfCanada wrote: > > Hellos, > > I was wondering if I can use Django caching system to store .txt > or .img files on the client side (as temp file).  I want to use > javascript to use them later so it would not require to transfer files > from

Re: Foreign key triggered some redundant SQL queries

2009-07-19 Thread Alex Gaynor
On Sun, Jul 19, 2009 at 10:48 AM, aXqd wrote: > > Hi, all: > > Recently, I linked two models ( FOO & BAR ) with a foreign key. > Then I retrieved the whole records back with the following codes: > > 1 for item in FOO.objects.all(): > 2   print item.bar.id > > In my opinion, the

Re: Django, MySQL - bug?

2009-07-19 Thread Alex Gaynor
2009/7/19 Tomasz Zieliński : > > > > On 19 Lip, 16:29, Joshua Russo wrote: >> 2009/7/19 Tomasz Zieliński >> >> > So, should m.save() set m.id to some other value than None >> > or this is relaxed when

Re: A question about reverse url lookups for admin site in svn version

2009-07-19 Thread Alex Gaynor
On Sun, Jul 19, 2009 at 6:03 AM, mrsource wrote: > > I'm using the current trunk version and I have a similar issue with > the reverse function: > > - I defined a get_urls() method for one of my models whose I have > written a custom admin page. > - From my view I try to

Re: newbie questions: common components in django

2009-07-18 Thread Alex Gaynor
On Sat, Jul 18, 2009 at 8:08 PM, online wrote: > > Hi all, > > I know i can have common stuff like this in django > > > > {% include "header.html" %} > > > blah > > > {% include "footer.html" %} > > > but it seems i need to pass data footer.html and header.html

Re: Row-specific user permissions

2009-07-18 Thread Alex Gaynor
On Sat, Jul 18, 2009 at 4:23 PM, nkulmati wrote: > > Hi Django users, > > It's been a while since I used Django, so I need an update on the > following question. > > Has anyone found a generic solution to django-admin's huge flaw - > specifically, not being able to limit

Re: model name ending with an 's'

2009-07-17 Thread Alex Gaynor
On Sat, Jul 18, 2009 at 12:52 AM, Earl Lapus wrote: > hi, > > I have a model named 'Services'. I added it to the admin page and an extra > 's' was appended to the name (see attached file). > I grep'd through my project directory and I'm pretty sure that there are no > text

Re: PyOhio - Python Regional Conference

2009-07-15 Thread Alex Gaynor
On Wed, Jul 15, 2009 at 12:56 PM, Fred Chevitarese<fchevitar...@gmail.com> wrote: > Record this !!! And put on Youtube for us!!! Whe´re in Brazil!!! > > Thanks! ;) > > 2009/7/15 Alex Gaynor <alex.gay...@gmail.com> >> >> PyOhio: >> Dates: 25th - 26th

PyOhio - Python Regional Conference

2009-07-15 Thread Alex Gaynor
PyOhio: Dates: 25th - 26th July More info: http://www.pyohio.org/Home Later this month will be the 2nd Python regional conference in Columbus, OH. This year the conference will feature two full days of talks as well as sprints. There will be general web framework talks, including one by Mark

Re: accessing multiple dbs?

2009-07-15 Thread Alex Gaynor
On Wed, Jul 15, 2009 at 11:35 AM, Emily Rodgers < emily.kate.rodg...@googlemail.com> wrote: > > > > On Jul 15, 4:19 pm, Emily Rodgers > wrote: > > On Jul 15, 2:46 pm, "Richard E. Cooke" wrote: > > > > > OK. Before I get flamed! > > > > >

Re: tagging question about django-tagging

2009-07-15 Thread Alex Gaynor
On Wed, Jul 15, 2009 at 9:31 AM, joep wrote: > > I'm new to both python and django, so please excuse my ignorance if > this is obvious. I have a tagged model which I would like to form a > tag cloud. I am using the following > >t = Tag.objects.cloud_for_model(Post, >

Re: Slug Field

2009-07-14 Thread Alex Gaynor
On Tue, Jul 14, 2009 at 3:56 PM, Sonal Breed wrote: > > Hi all, > > I am little confused about the working of slug fields. > I have a model: > class Story(models.Model): >slug = models.SlugField(unique_for_date = 'date_created', >help_text="suggested

Re: dict objects are unhashable in admin... in this a bug?

2009-07-14 Thread Alex Gaynor
On Tue, Jul 14, 2009 at 2:28 PM, Some Guy wrote: > > Hi Group, > I'm using svn version of django and SQLite3 on linux. I set up a basic > admin user and when I try to access the edit page I get the > "TemplateSyntaxError at /admin/auth/user/1/ > Caught an exception while

Re: Import all modelspy from all apps

2009-07-14 Thread Alex Gaynor
On Tue, Jul 14, 2009 at 2:18 PM, Gustavo Henrique wrote: > > Hi guys! > > How to import all models.py from all apps in a specific views.py in > one app in my project automatically? > > Thanks! > > > > You can use the django model cache: from django.db.models.loading import

Re: Deployment dilemma

2009-07-14 Thread Alex Gaynor
On Tue, Jul 14, 2009 at 10:46 AM, Rama Vadakattu wrote: > > I have a django project with N number of dependencies to other > packages. > Now i want to deploy the project on production server? > > As of now iam doing this. > 1.Move the django project to production server.

Re: Question regarding post_save signal and ManyToMany field objects

2009-07-14 Thread Alex Gaynor
On Tue, Jul 14, 2009 at 9:35 AM, Russell Keith-Magee wrote: > > On Tue, Jul 14, 2009 at 6:27 PM, Ryan K wrote: > > > > Yea...it would be so elegant too! Here is a "bug" filing: > > http://code.djangoproject.com/ticket/5390. It's been open for two >

Re: inheriting Model more than once

2009-07-14 Thread Alex Gaynor
On Tue, Jul 14, 2009 at 7:15 AM, Luc Saffre wrote: > > """ > Can somebody explain why this testcase fails? It looks as if the > attribute 'a' passed to the E instance just gets ignored. > I guess that it has to do with the fact that E inherits Model more than > once. > > >>>

Re: QuerySet rendering

2009-07-13 Thread Alex Gaynor
On Mon, Jul 13, 2009 at 2:48 PM, Mihail Lukin wrote: > > Hello, everyone! > > django.forms allows me to define form class from model and render > forms to html with just calling as_table method. Is there some module > to do same thing with querysets? I guess its usage

Re: Predefined models like tree,sortable_set

2009-07-13 Thread Alex Gaynor
On Mon, Jul 13, 2009 at 12:56 PM, Maksymus007 wrote: > > I recently switched to Django from PHP with Doctrine ORM - there was a > possibility to make model 'act as' for example NestedSet - which > automagically added required fields and methods to operate on Tree - >

Re: unittest DB questions

2009-07-13 Thread Alex Gaynor
On Mon, Jul 13, 2009 at 10:38 AM, Shawn Milochik wrote: > > > > I highly highly recommend that you separate your development, testing, > and production instances of your DB and web server. You should never > ever develop or test on a production system! > > - -- > Randy

Re: Constraining LEFT OUTER JOIN with aggregates?

2009-07-13 Thread Alex Gaynor
On Mon, Jul 13, 2009 at 9:53 AM, Russell Keith-Magee wrote: > > On Sun, Jul 12, 2009 at 11:01 PM, Mat wrote: > > > > I'm trying to replace a convoluted database-specific SQL statement > > with the new aggregates functionality. As an example, say I

Re: Unhandled Exception when stopping database engine

2009-07-13 Thread Alex Gaynor
On Mon, Jul 13, 2009 at 7:27 AM, Vitaly wrote: > > Hi > > I have some problem with customizing error pages when application does > not work at all. One of things is stopping database on production > server and user should see normal description of problem. But instead > of

Re: How to limit the maximum selection from MultipleChoiceField from forms?

2009-07-12 Thread Alex Gaynor
On Sun, Jul 12, 2009 at 12:35 PM, Lokesh wrote: > > Hi, > > forms.py > education = forms.MultipleChoiceField(choices=education_filler > (education_list)) > > In one of my forms I have the field to select multiple options for > education. I am able to populate all the

Re: Add extra field to ModelForm

2009-07-11 Thread Alex Gaynor
On Sat, Jul 11, 2009 at 10:08 AM, adelaide_mike wrote: > > Django 1.0.2. My ModelForm concerns (and is based on the table for) > advertisements for houses placed by real estate agents. > > I need the agent widget (which by default is a pick list of all > agents),

Re: Make three columns without violating DRY

2009-07-09 Thread Alex Gaynor
On Thu, Jul 9, 2009 at 4:49 PM, Wiiboy wrote: > > The columns are actually categories. The left column is sports, etc. > So I can't make it a grid like that. > > I don't quite see how the paginator helps. > > > Why not just make it a list of tuples, so [('left',

Re: any ideas about "load testing" django apps?

2009-07-08 Thread Alex Gaynor
On Wed, Jul 8, 2009 at 3:52 PM, happyb787 wrote: > > Any ideas about load testing django apps? JMeter? Ab? > > Please advise. thanks! > > > > You'd use the same tools you use for any other HTTP application, I've heard good things about Ab and Siege. Alex -- "I

Re: Circular imports problem

2009-07-08 Thread Alex Gaynor
On Wed, Jul 8, 2009 at 3:45 PM, Ryan K wrote: > > I am creating an application that uses the dispatcher in Django. In > the apps models.py file I connect the post_save of two models to > functions in a signals.py file. The problem is that I need to use > several models in

Re: Caching query results and ManyToMany relationships

2009-07-08 Thread Alex Gaynor
On Wed, Jul 8, 2009 at 12:27 PM, Adam Olsen wrote: > > class ValidParameter(models.Model): ># .. fields > > class ValidRequest(models.Model): ># ... fields >optional = models.ManyToManyField(ValidParameter, null=True, >blank=True) > > >

Re: Django Server performance

2009-07-07 Thread Alex Gaynor
On Tue, Jul 7, 2009 at 1:16 PM, Ramdas S wrote: > Hi, > > We have a web server where we are hosting around 12-15 django web sites > most of them attracting modest traffic, except a couple which sees spiikes > on and off. Together we estimate just about 20,000-40,000 page views.

Re: edit form not working with imagefield

2009-07-07 Thread Alex Gaynor
On Tue, Jul 7, 2009 at 12:16 PM, geraldcor wrote: > > I have a form that is being added via jquery ajax. I can add a new > record, including images just fine. Works like a dream. However, when > I go to edit the form, every field will update except for the image > field. I

Re: Retrieving nested choices.

2009-07-06 Thread Alex Gaynor
On Tue, Jul 7, 2009 at 12:16 AM, Magnus Valle wrote: > > I have a CharField model with nested choices, like this one: > > MEDIA_CHOICES = ( >('Audio', ( >('vinyl', 'Vinyl'), >('cd', 'CD'), >) >), >('Video', ( >('vhs',

Re: SQLite and Null Character

2009-07-06 Thread Alex Gaynor
On Mon, Jul 6, 2009 at 11:52 AM, Andrew Fong wrote: > > I'm using a SQLite3 backend on Python 2.6 and saving a unicode string > with the null character (u'\x00') results in everything after that > character being truncated. > > For example: > > m =

Re: Django as python ORM in project

2009-07-06 Thread Alex Gaynor
On Mon, Jul 6, 2009 at 10:42 AM, Xiong Chiamiov wrote: > > > What i want to know is that should i use django ORM for it. > > Should i use any other kind of python orm instead of django orm? But > > then i would essentially need to use 2 different systems for one > >

  1   2   3   4   5   6   7   8   9   >