Re: Models and select

2009-03-17 Thread Alex Gaynor
ect > > Categories object > > Categories object > Categories object > > > > What is going on here? Am I missing something now? I've been doing this for > a long time and I guess I forgot something > > > > By default it uses the __unicode__ method to

Re: Django Admin Titles

2009-03-17 Thread Alex Gaynor
ef_str_ > > thanks, > > Andrew > > > You have def _str_ it should be __str__(2 underscores before and after), also if you're on 1.0 you should probably be using __unicode__ instead). Alex -- "I disapprove of what you say, but I will de

Re: Typo for Django or Like?

2009-03-17 Thread Alex Gaynor
orandblack.com > > > > Most of us aren't RoR developers so we don't really know what that is, can you provide a description of what it is your looking for? Alex -- "I disapprove of what you say, but I will defend to the death your right to say it.

Re: Completions

2009-03-17 Thread Alex Gaynor
s the later you'll need to roll your own or use a solution out there like this: http://jannisleidel.com/2008/11/autocomplete-form-widget-foreignkey-model-fields/ Alex -- "I disapprove of what you say, but I will defend to the death your right to

Re: Completions

2009-03-17 Thread Alex Gaynor
it's exactly, what I needed. Thanks a lot :-) > > Any chance such functionality will put directly into DJango in some > future releases? > > -- > Filip Gruszczyński > > > > Highly unlike at best, the core developers are of the opinion that javascript is a client side

Re: Completions

2009-03-17 Thread Alex Gaynor
On Tue, Mar 17, 2009 at 8:10 PM, Alex Gaynor wrote: > > > 2009/3/17 Filip Gruszczyński > >> >> > Are you talking about autocompletion as in what the browser does, or >> some >> > sort of Ajax autocompleter. If it's the format that's handled

Re: TemplateSyntaxError (newbie)

2009-03-17 Thread Alex Gaynor
the admin urls were indeed special, in the sense that they didn't include another URLconf as you're doing with the CMS urls, what they did was they sent all the URLs to a single view and that view dispatched to other views. Alex -- "I disapprove of what you say, but I will defend to th

Re: Activating admin site

2009-03-18 Thread Alex Gaynor
t/ > > when using the admin.site.root > > Thanks, > Jeff > > > > > This is a bug in the current development version of Django: http://code.djangoproject.com/ticket/10061 . It has a patch on it, which you can try applying to your Django version if you like, it should wor

Re: yet another unicode question...

2009-03-18 Thread Alex Gaynor
x27; at > settings.py > > How can I have django display html code from the databse without any > problems? > > Thanks a lot > Juan > > > > > This has nothing to do with your db charset, this is Django's template autoescape feature, you can have it render

Re: how to iterate list of list using template language

2009-03-18 Thread Alex Gaynor
]a[1] > {% endfor %} > > but i received this error: > > Could not parse the remainder: '[0]' from 'a[0]' > > any thoughts or suggestions? > > thanks. > > > You use the . notation even for subscripting so i'ts just {{ a.0 }} or {{ a.1 }} alterna

Re: question about template system

2009-03-18 Thread Alex Gaynor
> {% for t in lst %} > {{ dic.t}} > {% endfor %} > > Does anyone have any suggestions on how to accomplish this? > > Thanks a lot! > > > > Write a template filter that does the lookup against the variable. Alex -- "I disapprove of what you say, but I will defend to t

Re: How do I 'redirect' in my test code after a 301 response?

2009-03-19 Thread Alex Gaynor
_response = c.get(response.ulr) > > Any ideas? Help? Pointers to documentation? > > Thanks > > > In the Django development version you can do this: http://docs.djangoproject.com/en/dev/topics/testing/?from=olddocs#django.test.client.Clientsee the bits on follow = True. On 1.0

Re: request object needed in form methods

2009-03-19 Thread Alex Gaynor
s is you have a global and local scope, if you want something in your local scope you pass it to it. If you really want to have the request object stored you can write a custom middleware to do it, but I woulldn't. Alex -- "I disapprove of what you say, but I will d

Re: Getting logged in username in admin

2009-03-19 Thread Alex Gaynor
: http://twitter.com/jpartogi > > > > The admin has a specific method you can overide just for this: http://docs.djangoproject.com/en/dev/ref/contrib/admin/#save-model-self-request-obj-form-change The example should make it pretty clear what you need to do. Alex -- "I disapprove of

Re: admin: search generic relation?

2009-03-19 Thread Alex Gaynor
t work ... are there any workarounds? > > thanks, > patrick > > > > Not really, but that's because there's no way to preform that query at the database level. Alex -- "I disapprove of what you say, but I will defend to the death your right to say it." --

Re: custom validation (clean_) based on image height and width

2009-03-19 Thread Alex Gaynor
On Thu, Mar 19, 2009 at 3:31 PM, Michael Repucci wrote: > > I'm struggling with what seems like should be a very straightforward > task. I have a model with a field named image of type ImageField, and > I'd like to do custom validation via the model form's clean_image > method based on the height

Re: Map events in space on a django app

2009-03-19 Thread Alex Gaynor
ot of tools for working with maps and geographic data, you might want to look at it: http://geodjango.org/ . Alex -- "I disapprove of what you say, but I will defend to the death your right to say it." --Voltaire "The people's good is the highest law."--Cicero --~--~---

Re: Using _default_manager in a model causes many idle MySQL connections. (Django 1.0)

2009-03-19 Thread Alex Gaynor
in flawed? If not, does > anyone know if there is a working fix? > > TIA, > > Michael LaRue > > > > It's not a default manager issue, the issue is by default django closes the connection at the end of the request, but it only tracks the default connection, so your cusotm

Re: customizing admin interface: showing descriptive names for objects

2009-03-19 Thread Alex Gaynor
her model, the foreign key reference to MyModel > gets displayed as a list of: > > MyModel object > MyModel object > > etc > > I'd like it to make it show MyModel.name instead. How is this changed? > > Nate > > > > Using the __unicode__ method on

Re: customizing admin interface: showing descriptive names for objects

2009-03-19 Thread Alex Gaynor
On Thu, Mar 19, 2009 at 7:36 PM, Nate Reed wrote: > On Thu, Mar 19, 2009 at 4:29 PM, Alex Gaynor wrote: > >> >> >> On Thu, Mar 19, 2009 at 7:21 PM, Nate Reed wrote: >> >>> I'm working on an admin interface for my app, and wondering how to >>&

Re: Map events in space on a django app

2009-03-19 Thread Alex Gaynor
On Thu, Mar 19, 2009 at 7:41 PM, Alessandro wrote: > > On Thu, Mar 19, 2009 at 9:08 PM, Alex Gaynor > wrote: > > > Geo Django has a lot of tools for working with maps and geographic data, > you might want to look at it: http://geodjango.org/ . > > > > I thought g

Re: Variables in parent template

2009-03-20 Thread Alex Gaynor
f a form object from the base template? > > Thank you. > Antonio > > > > Take a look at template context processors, they are made for something just like this. Alex -- "I disapprove of what you say, but I will defend to t

Re: how can i custom the comments framework ?

2009-03-20 Thread Alex Gaynor
> comment field only,so how can i custom the comments framework ? or > any other solution? > > > > > There are quite a few hooks for customizing the comments framework take a look at them: http://docs.djangoproject.com/en/dev/ref/contrib/comments/custom/ Alex -- "I di

Re: Django annotate with Count() problem

2009-03-20 Thread Alex Gaynor
quot;app_visit"."id") AS "visit_cnt", COUNT > ("app_comment"."id") AS "comment_cnt" FROM "app_file" LEFT OUTER JOIN > "app_visit" ON ("app_file"."id" = "app_visit"."file_id") LEFT OUTER &

Re: Django annotate with Count() problem

2009-03-20 Thread Alex Koshelev
Try to add distinct() to query set. On Fri, Mar 20, 2009 at 10:06 PM, eli wrote: > > Hi, > > I have a problem with Django Orm annotate method.. > > My models (application: app): > > class File(models.Model): >  name = models.CharField(max_length=255) >  file = MyFileField(upload_to=...) > > clas

Re: Compressing templates

2009-03-20 Thread Alex Gaynor
ding the "deployment" version of your stuff isn't really a task for Django(Django is built for handling Http requests and return http responses at it's core), so I would look at a python deployment tool like fabric: http://pypi.python.org/pypi/Fabric/ Alex -- "I disap

Re: Compressing templates

2009-03-20 Thread Alex Gaynor
plates, before launching new code. > > Thanks! > > On Mar 20, 4:23 pm, Alex Gaynor wrote: > > On Fri, Mar 20, 2009 at 7:19 PM, chachra > wrote: > > > > > Hi, > > > > > Sorry if this has been discussed before. I am minifying my js/css > &g

Re: I'm having some trouble with GenericForeignKey

2009-03-20 Thread Alex Gaynor
self.assertEqual( barn.animal.name, "Bob") >#this fails saying: AssertionError: u'Stewart' != 'Bob' > > > > When you get a related object using the accessor it is cached for the lifetime of that obj so you don't need to requery for

Re: Compressing templates

2009-03-20 Thread Alex Gaynor
On Fri, Mar 20, 2009 at 9:22 PM, chachra wrote: > > Excellent. This would work. Except that this work would have to be > done on every page load, unless template (pre-rendered versions) get > cached? > > Thanks! > > > On Mar 20, 5:30 pm, Alex Gaynor wrote: > >

Re: Installing Django for rapidsms

2009-03-21 Thread Alex Gaynor
t;, line 664, in __init__ >Field.__init__(self, **kwargs) > TypeError: __init__() got an unexpected keyword argument 'core' > > Is there some patch to solve this error? > > Am i doing something wrong...? > > Regards > Deepak > > > > Whatever

Re: Aggrevate and offsets

2009-03-21 Thread Alex Gaynor
ou point me to a place, where I could try to > take a look and fix it? I need it and would like to use SQL. > > -- > Filip Gruszczyński > > > > Take a look at this thread: http://groups.google.com/group/django-users/browse_thread/thread/4ee4d8507e41213e Alex -- "I disap

Re: Multiple ModelAdmins for a single Model

2009-03-21 Thread Alex Gaynor
ModelForm for your > situation. I think that should completely solve your problem. > > If not, come back with questions and some explanation of what isn't > working or how I've entirely misunderstood your problem. > > Regards, > Malcolm > > > > > In the

Re: urlize

2009-03-22 Thread Alex Gaynor
gs/ The urlize filter can be found at django/templates/defaultfilters.py . This is not already available, although you could just apply the filter as usual and then have a second filter that just altered the tags. Alex -- "I disapprove of what you say, but I will defend t

Re: Contact Enquiry model expecting identity value

2009-03-22 Thread Alex Gaynor
#x27; > > when i pass an int as the first parameter it works fine but i thought > an autonumber would be passed as the id value ? > > Thanks for any help > > > > How are you creating an instance of the model, can you paste the code you are running and the full traceb

Re: Contact Enquiry model expecting identity value

2009-03-22 Thread Alex Gaynor
x27;],cd['subject'],cd['email'],cd > ['message'],datetime.datetime.now()) >c.save() > >return HttpResponseRedirect('/contact/thanks/') > > if i enter an integer before cd['name'] the instance gets saved in the > dat

Re: If less than in template language

2009-03-22 Thread Alex Gaynor
reatly appreciated! > Thanks > -Robert > > > > > Check out james bennet's template-utils libarary which contains an {% iflessthan %} template tag. Alex -- "I disapprove of what you say, but I will defend to the death your right to say it." --Voltaire "

Re: If less than in template language

2009-03-22 Thread Alex Gaynor
On Sun, Mar 22, 2009 at 10:01 PM, Robert wrote: > > Looks great! > Stupid question... it's been a while since i've worked in django. > Where's a good place to physically store that document on the server? > sorry! > > On Mar 22, 8:16 pm, Alex Gaynor wrote:

Re: Using Template Tags Within Markdown

2009-03-23 Thread Alex Gaynor
> > > > > I would write a template filter that takes a block of text and renders it as a template, and then render that as markdown so it would look like: {{ that_text|templatize|markdown }} Alex -- "I disapprove of what you say, but I will defend to the death your right t

Re: Problem with Sum() function

2009-03-23 Thread Alex Gaynor
k2 field. > > > > Model1.objects.annotate(myfk1=Count('fk1', distinct=True), myfk2=Count > > ('fk2', distinct=True)).annotate(my_sum=Sum('myfk1+myfk2')).order_by('- > > my_sum') > > > > Thanks for help. > > > > regard

Re: Django book mostly done?

2009-03-23 Thread Alex Gaynor
On Mon, Mar 23, 2009 at 5:31 PM, Scot Hacker wrote: > > > On Mar 17, 2009, at 10:51 AM, Alex Gaynor wrote: > > > Adrian just put the last batch of chapters online, so I believe all > > the content is now up. Having skimmed most of it I can say it looks > > really

Re: Django book mostly done?

2009-03-23 Thread Alex Gaynor
On Mon, Mar 23, 2009 at 6:08 PM, Graham Dumpleton < graham.dumple...@gmail.com> wrote: > > > > On Mar 18, 6:20 pm, Gour wrote: > > >>>>> "Alex" == Alex Gaynor writes: > > > > Alex> Adrian just put the last batch of chapters o

Re: DjangoBook forms

2009-03-23 Thread Alex Gaynor
x this change the first conditional to be: if request.GET.get('conditional') Which means "if conditional is in GET return it, else return None" both of which will evaluate to False in a boolean context. Alex -- "I disapprove of what you say, but I will defend to the d

Re: Bug report: Model.get(pk=None)

2009-03-24 Thread Alex Gaynor
and the current trunk (revision > 10162 at the time when I tested this), the "ModelA.objects.get(pk=None)" > statement unexpectedly returns the object created by the > "ModelA.objects.create()" on the previous line. > > > Mike > > > > > Under MyS

Re: Bug report: Model.get(pk=None)

2009-03-24 Thread Alex Gaynor
On Tue, Mar 24, 2009 at 2:51 PM, Michael Glassford wrote: > > Alex Gaynor wrote: > > > > > > On Tue, Mar 24, 2009 at 2:39 PM, Michael Glassford > <mailto:glassfo...@gmail.com>> wrote: > > [snip model definition, etc.] > > > When I ru

Re: Why won't my form validate?

2009-03-24 Thread Alex Gaynor
On Tue, Mar 24, 2009 at 3:02 PM, Theme Park Photo, LLC wrote: > > Im trying to get code to edit an existing record in a table working. > For some reason, form.is_valid is returning false (and I can't save it > because there's no cleaned data). Even reduced to this (below) where > I'm simply gettin

Re: Why won't my form validate?

2009-03-24 Thread Alex Gaynor
gt; >'publish': datetime.datetime(2009, 3, 23, 15, > > 3, > >36), 'score': -93L, 'categories': [1L], > > 'title': > >u'Hello', 'slug': u

Re: Join unrelated models

2009-03-24 Thread Alex Gaynor
where > Link.title is null; > > Is it possible to make the same thing by Django ORM only ? > > > > So to be clear you want all items from Media for which there isn't a link with that title, in the ORM that would look like: Media.objects.exclude(title__in=Link.objects.valu

Re: Join unrelated models

2009-03-24 Thread Alex Gaynor
On Tue, Mar 24, 2009 at 4:15 PM, Paulo Köch wrote: > > Does that generate a join or a not in? This is very relevant for > performance. > > Cheers, > Paulo Köch > > > > On Tue, Mar 24, 2009 at 20:13, Alex Gaynor wrote: > > > > > > On Tue

Re: Join unrelated models

2009-03-24 Thread Alex Gaynor
On Tue, Mar 24, 2009 at 4:26 PM, Konstantin S wrote: > > > > On Mar 24, 11:13 pm, Alex Gaynor wrote: > > On Tue, Mar 24, 2009 at 4:05 PM, Konstantin S > wrote: > > > > > Hello! > > > > > I have two unrelated models that have one common field.

Re: Bug report: Model.get(pk=None)

2009-03-24 Thread Alex Gaynor
On Tue, Mar 24, 2009 at 4:50 PM, Michael Glassford wrote: > > Alex Gaynor wrote: > > > > I'm almost positive the MySQL CLI operates differently for the purposes > > of this query. The reason the queries do different things in .96 is > > that in .96 that query

Re: Filter with many_to_many returns duplicate results

2009-06-19 Thread Alex Gaynor
t; > In [16]: e2 = pru.models.Entry(blog=b, headline='2', body_text='22', > pub_date='2009-09-09') > > In [17]: e2.save() > > In [18]: e2.authors.add(jo) > > In [19]: e2.authors.add(bob) > > In [20]: e2

Re: TypeError: 'module' object is not callable

2009-06-19 Thread Alex Gaynor
8, in __call__ >self.load_middleware() > File "/Library/Python/2.5/site-packages/django/core/handlers/ > base.py", line 47, in load_middleware >mw_instance = mw_class() > TypeError: 'module' object is not callable > [19/Jun/20

Re: TypeError: 'module' object is not callable

2009-06-19 Thread Alex Gaynor
t; > value for middleware? > > > > It looks like that might be problem, none of the above code. > > > Why did you add 'django.contrib.auth.models' to your middleware? That's whats causing your issue, but what were you hoping to accomplish? Alex -- "I disapp

Re: QuerySet question, getting latest 3 objects filtered by a key.

2009-06-22 Thread Alex Gaynor
vg_foos>] > > I hope that makes sense. I'll do multiple queries if need be. > > > > It sounds like all you're trying to do is order by the primary key and then do a limit, so it would be: Stat.objects.order_by('-id')[:3] Alex --

Re: ANDing together results from ManyToMany Field not working

2009-06-22 Thread Alex Gaynor
Any ideas? > > > Your problem is that when you do 2 filters on a multi-value relationship in a single filter() they operate on the same obj, but if you split them into seperate calls to filter() it will do just what you want: Model.objects.filter(related_value__id=1).filter(related_value__id=2)

Re: custom filter on join

2009-06-22 Thread Alex Gaynor
add extra join conditions (this will likely be addressed in some way during the 1.2 timeine since it is needed for this ticket: http://code.djangoproject.com/ticket/10870 to be solved). Alex -- "I disapprove of what you say, but I will defend to the death your right to say it." --Voltaire &q

Re: How to use Sum function with expression

2009-06-23 Thread Alex Gaynor
ure, but probably it probably won't get done until at least > Django v1.2, probably later (unless someone else volunteers to do the > work). > > Yours, > Russ Magee %-) > > > > It's actually possible if you write you're own custom aggregate (and I feel confident that

Re: Will future Django releases support multiple databases?

2009-06-25 Thread Alex Gaynor
vesdrop on the Django Developers group (as > opposed to this Django Users group) where Alex Gaynor has been > posting updates on his GSoC project to add multi-DB support to > Django[1]. There are several aspects to multi-DB support[2] but > I believe he's addressing some of the more

Re: Where to put form definitions?

2009-06-25 Thread Alex Gaynor
ople put them in forms.py, since it's a nice clean, obvious place for them. Alex -- "I disapprove of what you say, but I will defend to the death your right to say it." --Voltaire "The people's good is the highest law."--Cicero --~--~-~--~~-

Re: Can base.html template contain dynamic content if used by direct_to_template

2009-06-25 Thread Alex Gaynor
ys to do this, either a) a template context process, which bsaically adds something to the context of all templates rendered, or b) an inclusion tag which basically let's you do an include but with a new context that you can create dynamically. Alex -- "I disapprove of what you say, but I wi

Re: Can base.html template contain dynamic content if used by direct_to_template

2009-06-25 Thread Alex Gaynor
On Thu, Jun 25, 2009 at 3:27 PM, Pete-Sitedesign < peter.king.sitedes...@googlemail.com> wrote: > > On Jun 25, 9:22 pm, Alex Gaynor wrote: > > On Thu, Jun 25, 2009 at 12:23 PM, Pete-Sitedesign < > > > > peter.king.sitedes...@googlemail.com> wrote: > &

Re: Django ORM exhibiting caching like behavior in a non web based daemon script

2009-06-25 Thread Alex Gaynor
want to iterate over a new one instead of the current one you can just do queryset.all() and then you won't be going through the cache. Alex -- "I disapprove of what you say, but I will defend to the death your right to say it." --Voltaire "The people's good is the h

Re: Global objects

2009-06-25 Thread Alex Gaynor
ect list, to populate a part of a > > menu in my site. How can I do it? How can I instantiate the model object > > list, so that it is available to all the views? > > > > Thanks! > > > > Diogo > > > See my answer in this thread: http://groups.google.com/group/dja

Re: "python manage.py runserver" tutorial error

2009-06-25 Thread Alex Gaynor
. I installed > Django using subversion. > > > > On ubuntu all you should need to do is sudo apt-get install python-psycopg2 and you'll be good to go. Alex -- "I disapprove of what you say, but I will defend to the death your right to say it."

Re: Writing a reusable app

2009-06-25 Thread Alex Gaynor
alistic or full- >> > batteries included? >> >> full batteries >> >> > > -- > Join Scrum8.com. > > http://scrum8.com/member/jpartogi/ > http://scrum8.com/blog/jpartogi/ > http://twitter.com/scrum8 > > > > > I think the best sol

Re: "python manage.py runserver" tutorial error

2009-06-25 Thread Alex Gaynor
e postressql_psycopg2 set as your DATABASE_ENGINE. Alex -- "I disapprove of what you say, but I will defend to the death your right to say it." --Voltaire "The people's good is the highest law."--Cicero --~--~-~--~~~---~--~~ You received

Re: Using Signals as hooks

2009-06-26 Thread Alex Robbins
get my email until there is web traffic on the server? That doesn't seem like a good idea. You could look into http://code.google.com/p/django-chronograph/. I have found that really helpful to automate jobs in the background. (It also has a link to a nice mailer app on the front page.

Re: Coding for arbitrary additional fields of a certain type

2009-06-27 Thread Alex Gaynor
eme, or a standard way of handling it? > > Thanks, > > Daniele > > > > > Yep, you'd have a second model that has a foreign key to person that has the type and number fields on it. Alex -- "I disapprove of what you say, but I will de

Re: Weird disappearing apps issue

2009-06-27 Thread Alex Gaynor
ould be happening here? > > Daniele > > > > > Your issue is that you have a circular import: A imports B and B imports A. To get around this see: http://docs.djangoproject.com/en/dev/ref/models/fields/#lazy-relationships Alex -- "I disapprove of what you say, but I

Re: django twisted model

2009-06-28 Thread Alex Clemesha
INGS_MODULE'] = 'my.settings' so that you can correctly important you django models from any of your code that uses twisted. Hope this helps, -Alex > > TIA -- Alex Clemesha clemesha.org --~--~-~--~~~---~--~~ You received this message becau

Re: Django database model interface for other python projects?

2009-06-28 Thread Alex Gaynor
my other projects. > > > Yep, it's possible, http://www.b-list.org/weblog/2007/sep/22/standalone-django-scripts/ shows what you need to do to get your django env set up for other scripts. Alex -- "I disapprove of what you say, but I will defend to the death your

Re: inlineformset_factory and modelforms

2009-06-28 Thread Alex Gaynor
opics/forms/modelforms/#inline-formsets > > However, if I have custom modelforms for Author and Book, is it > possible to use them with inlineformset_factory? > > Regards, > CM. > > > inlineformset_factory takes a form argument which should be the modelform class that w

Re: inlineformset_factory and modelforms

2009-06-28 Thread Alex Gaynor
On Sun, Jun 28, 2009 at 11:38 PM, chefsmart wrote: > > If I understand correctly, I can use the form argument to supply a > modelform. But actually I have custom modelforms for both the models. > So I hoping to be able to use both if possible? > > Regards, > CM. > > &

Re: inlineformset_factory and modelforms

2009-06-28 Thread Alex Gaynor
On Sun, Jun 28, 2009 at 11:46 PM, chefsmart wrote: > > Hi Alex, > > If we take the example from the documentation, let's say I have > modelforms for both Author and Book. So there is an AuthorModelForm > (ModelForm) and also a BookModelForm(ModelForm).

Re: Redirect to html file

2009-06-29 Thread Alex Gaynor
ew, since just about any static HTML is a valid template file. Alex -- "I disapprove of what you say, but I will defend to the death your right to say it." --Voltaire "The people's good is the highest law."--Cicero --~--~-~--~~~---~--~~ Y

Re: http://www.djangobook.com/en/2.0/chapter03/

2009-06-29 Thread Alex Gaynor
.conf.urls.defaults import * > from mysite.views import hello, home, current_datetime, hours_ahead > > urlpatterns = patterns('', > >('^hello/$', hello), >('^$', home), >('^time/$', current_datetime) >(r'^time/plus/

Ordering of ManyToManyField using a field of the intermediate table

2009-06-29 Thread Alex Rades
Hi, I have a couple of models like: class Album(models.Model): title = models.CharField(max_length=255) class Image(models.Model): image = models.ImageField(upload_to='images/') albums = models.ManyToManyField(Album, blank=True) the schema of the intermediate table is, of course:

Re: import a variable form views to forms

2009-06-29 Thread Alex Gaynor
On Mon, Jun 29, 2009 at 12:04 PM, ariest wrote: > > Nobody? > > > > Please try to be patient. This is an all volunteer mailing list and it's only been 2 hours. Many people are at work or otherwise occupied and thus unable to reply. Alex -- "I disapprove of what y

Re: no module name xxxx error

2009-06-29 Thread Alex Gaynor
d not happen when I've created other apps. > > > Did you forget to create an __init__.py in the folder? Python needs this to recognize the folder as a module. Alex -- "I disapprove of what you say, but I will defend to the death your right to say it." --Vo

Re: Trying to understand Django and Python from a C++ perspective

2009-06-29 Thread Alex Gaynor
o the class, not part of the instances. I just can't figure > out how to declare and instantiate them in python. > > > Django uses an advanced python feature called descriptors in order to prevent you from accessing a manager (which is what "objects" is) from an instance. My unde

Re: Global objects

2009-06-29 Thread Alex Gaynor
On Mon, Jun 29, 2009 at 10:43 PM, diogobaeder wrote: > > Alex, > > I'm trying to use the context processors, but I'm getting the > following error: > http://dpaste.com/61410/ > > Any idea of what it might be? > > Thanks! > > Diogo > > > >

Re: Global objects

2009-06-29 Thread Alex Gaynor
gument for > render_to_response? I have no data here, besides the context processor > data... > > Thanks again! > > Diogo > > > > On Jun 30, 12:47 am, Alex Gaynor wrote: > > On Mon, Jun 29, 2009 at 10:43 PM, diogobaeder > wrote: > > > > > Alex,

Re: Creating users in fixtures

2009-06-30 Thread Alex Gaynor
lid model identifier: > 'django.contrib.auth.user' > > Any help would be greatly appreciated. > > > It's just auth.user. You only use the app name (last part of the python path) and the model name. Alex -- "I disapprove of what you say, but I will defend to the dea

Re: Will future Django releases support multiple databases?

2009-07-01 Thread Alex Gaynor
On Wed, Jul 1, 2009 at 9:16 AM, Emily Rodgers < emily.kate.rodg...@googlemail.com> wrote: > > > > On Jun 25, 6:45 pm, Alex Gaynor wrote: > > On Thu, Jun 25, 2009 at 10:24 AM, Tim Chase > > wrote: > > > > Right now, Django doesn't seem to support th

Re: Will future Django releases support multiple databases?

2009-07-01 Thread Alex Gaynor
On Wed, Jul 1, 2009 at 9:39 AM, Emily Rodgers < emily.kate.rodg...@googlemail.com> wrote: > > > > On Jul 1, 3:22 pm, Alex Gaynor wrote: > > On Wed, Jul 1, 2009 at 9:16 AM, Emily Rodgers < > > > > > > > > emily.kate.rodg...@googlemail.com> w

Re: Display Data From Multiple Tables

2009-07-02 Thread Alex Robbins
You should take a look at select_related[1]. It will take the lot of queries TiNo was talking about and flatten it down to one big one. [1] http://docs.djangoproject.com/en/dev/ref/models/querysets/#id4 Hope that helps, Alex On Jul 1, 1:34 pm, TiNo wrote: > On Wed, Jul 1, 2009 at 16:59,

Re: 'MediaDefiningClass' object is not iterableRequest Method

2009-07-02 Thread Alex Gaynor
#x27;C:\\Python26\\lib\\lib-tk', 'C:\\Python26', 'C:\\Python26\\lib\ > \site-packages', 'C:\\Python26\\lib\\site-packages\\PIL'] > > Any help will be appreciated > Jayvandal > > > > > You've ommitted most of the traceback, if you co

Re: Invoke Django admin list filter

2009-07-02 Thread Alex Gaynor
x27;s designed for building iterfaces similar to list_filter. You can get the code here; http://github.com/alex/django-filter/tree/master or on PyPi. Alex -- "I disapprove of what you say, but I will defend to the death your right to say it." --Voltaire

Re: Using the test client API for integration tests?

2009-07-02 Thread Alex Gaynor
httplib2, it's the most popular library for making HTTP requests in Python (there are like 3 seperate modules in the stdlib you can use for it also, urllib, urllib2, and httplib, but I think httplib2 is best). Alex -- "I disapprove of what you say, but I will defend to the death your r

Re: Invalid syntax when place QuerySet to a new value

2009-07-02 Thread Alex Gaynor
obs = jobs.order_by('-recipes_count')[:10] > > > I'm very confusing in it ... Please help. > > > In Python a variable cannot start with a number. Alex -- "I disapprove of what you say, but I will defend to the death your

Re: Will future Django releases support multiple databases?

2009-07-03 Thread Alex Gaynor
On Fri, Jul 3, 2009 at 12:25 PM, Emily Rodgers < emily.kate.rodg...@googlemail.com> wrote: > > > > On Jul 3, 3:29 pm, Emily Rodgers > wrote: > > On Jul 1, 3:44 pm, Alex Gaynor wrote: > > > > > > > > > On Wed, Jul 1, 2009 at 9:39 AM, Emily

Re: Checking if a ForeignKey field is NULL

2009-07-04 Thread Alex Gaynor
? > > Cheers, > Ryan > > > Yes, foo.baz will be None if there is no related object. Alex -- "I disapprove of what you say, but I will defend to the death your right to say it." --Voltaire "The people's good is the highest law."--Cicero --~--~-~--~~

Re: type object 'MyModel'' has no attribute 'id'

2009-07-04 Thread Alex Gaynor
path = '/support/helping/product/%s' % maker >return HttpResponseRedirect(path) >else: > pmform = ProductModelForm(maker_filter=maker_id, data=None, > instance=ProductModel) >return render_to_response('helping.html',

Using custom form class for the django.contrib.auth password_change view

2009-07-04 Thread Alex S.
do some additional checking of the new passwords (for example password length). I know this would be possible with Javascript but I really would love to avoid using it in some projects. I'm currently working with the release version of Django (1.0.2). Thanks in advance

Re: Using custom form class for the django.contrib.auth password_change view

2009-07-05 Thread Alex S.
problems with this reading the source files. Alex On 4 Jul., 21:57, "Alex S." wrote: > Hi folks, > > as the title says I want to use my own form class for the password > change process supplied by django.contrib.auth. Do you know of any way > to do this without rewriting the c

Re: using python libraries in django?

2009-07-06 Thread Alex Gaynor
> > > Django is just python, to use any python libraries you simply import and use them as usual. Alex -- "I disapprove of what you say, but I will defend to the death your right to say it." --Voltaire "The people's good is the highest law."--Cicero --~--~

Re: Django as python ORM in project

2009-07-06 Thread Alex Gaynor
imary keys. That being said I use Django as a standalone ORM sometimes, because I'm familiar with it, and I know how to make it work easily. Alex -- "I disapprove of what you say, but I will defend to the death your right to say it." --Voltaire "The people's good is t

Re: SQLite and Null Character

2009-07-06 Thread Alex Gaynor
o SQLite3, the python-interface, or Django. This all > seems to work fine in MySQL however. > > -- Andrew > > > I'd try performing the same operations at the SQLite shell and see if you get the same behavior. If you do I'd guess that either it's a bug in SQLite, or you

Re: Retrieving nested choices.

2009-07-06 Thread Alex Gaynor
.objects.filter(media='cd') > > > to retrieve the objects. But what should I do if I want to get all > 'Audio' objects, ie. both 'vinyl' and 'cd'? > > Thanks, -0.5 > > > > > Use OR queries to get ones that are either v

Re: edit form not working with imagefield

2009-07-07 Thread Alex Gaynor
gt;return render_to_response('blogedit.html', {'form': form, > 'blg_id': > blg_id}) > > I will add more code as needed. Thanks for any and all help. > > > Ajax requests don't send file data.

<    2   3   4   5   6   7   8   9   10   11   >