Fun django plugins?

2010-04-16 Thread Alex F
o. Thanks! Alex -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more optio

Re: Django SMTP and SPA

2010-04-14 Thread Alex
No. I've just googled a bit for SPA, SPA+python. But I did not find anything helpfull. On 13 апр, 18:44, Massimiliano della Rovere wrote: > i think the python modules > - smtplib > - email > will help. Have you already tried these ones? > > On Tue, Apr 13, 2010 at 14:

Django SMTP and SPA

2010-04-13 Thread Alex
Hi. Can anybody suggest an idea how to deal with SMTP server with Secure Password Authentication in Django? -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from t

Re: MySQLdb setup on snow leopard help

2010-04-12 Thread Alex Robbins
If you are planning to deploy to linux servers, you might have a nicer time developing on a linux vm. I have a mac, but do my development in an ubuntu vm. Many difficult installations become a simple "sudo apt- get install ". YMMV, Alex On Apr 12, 2:09 am, Bdidi wrote: > I reinsta

Re: Simple export of CSV

2010-03-25 Thread Alex Robbins
Not sure if this will help, but the docs have a pretty in-depth explanation of doing csv export. http://docs.djangoproject.com/en/dev/howto/outputting-csv/ HTH, Alex On Mar 24, 3:03 pm, jlwlynn wrote: > I'm trying to simply export CSV, but have failed miserably.  First I > perform a

Re: Upload image file, resize using PIL, then save into ImageField - what to save to ImageField?

2010-03-18 Thread Alex Robbins
I think Satchmo uses http://code.google.com/p/sorl-thumbnail/ I think it uses PIL underneath a layer of abstraction. That might work for you if you are just wanting to generate alternate versions of uploaded images. Alex On Mar 18, 12:10 am, robinne wrote: > I can save an uploaded image t

Re: Internationalization problems in Django 1.2 (beta 1 SVN-12678)

2010-03-04 Thread Alex
Posting this question made me rethink the problem... And it was a very small mistake: {% trans "..." %} is not able to mark multilined... Just use one line and everything will work. Hope this helps someone :-) Alex On 5 Mrz., 04:19, Alex wrote: > I've got some very simply

Internationalization problems in Django 1.2 (beta 1 SVN-12678)

2010-03-04 Thread Alex
at I did not miss something very obvious :-) Thanks in advance Alex -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django

Re: {% url %} not working

2010-03-04 Thread Alex Robbins
them off to views, but you cannot reverse such patterns. Hope that helps, Alex On Mar 4, 2:13 am, codethief wrote: > Hello dear Django community, > > I'm desperately trying to get the url template tag working. This is my > template's source > code:http://bitbucket.org/codeth

Re: Restrict choices in ModelForm for ForeginKey field

2010-03-02 Thread Alex Robbins
If you set limit_choices_to on the underlying foreign key, I think that shows up in any modelform derived from it too. http://docs.djangoproject.com/en/dev/ref/models/fields/#django.db.models.ForeignKey.limit_choices_to Hope that helps, Alex On Mar 1, 8:24 am, AlienBaby wrote: > Hi. > &g

Re: Just deployed to 1.2 w/mod-wsgi, app works, admin's busted

2010-03-02 Thread Alex Robbins
I think the problem is that you are using the old admin.site.root. You should use the include(admin.site.urls) form instead. http://docs.djangoproject.com/en/dev/ref/contrib/admin/#hooking-adminsite-instances-into-your-urlconf Hope that helps! Alex On Mar 2, 12:01 am, ssteinerX wrote: > T

Re: preventing template from converting html entities

2010-02-25 Thread Alex Robbins
Oops, it would actually be title={% filter force_escape %}"{{ villa.name }}"{% endfilter %} Sorry. -- Alex Robbins 5Q Communications, Inc. http://www.5Qcommunications.com/ alex.robb...@5qcommunications.com 800-747-4214 ext 913 (p) http://www.ask5q.com/twitter/ On Thu, Feb 25, 2010

Re: preventing template from converting html entities

2010-02-25 Thread Alex Robbins
I think you can do that with title={% filter force_escape %}"{{ villa.name }}"{% endfilter %}. Haven't tried it though. Alex On Feb 24, 8:36 am, Federico Capoano wrote: > Hello to all, > > simple question: > > I have the following HTML in a template: >

Re: Passing RequestContext as dict vs. context_instance=RequestContext

2010-02-25 Thread Alex Robbins
index.html', { 'extra_context_var': value, }) Alex [1] http://docs.djangoproject.com/en/dev/ref/generic-views/#django-views-generic-simple-direct-to-template On Feb 24, 6:00 am, Jesaja Everling wrote: > Hi all! > > Is there any difference between these two ways of us

Re: Optimize large table view

2010-02-24 Thread Alex Robbins
t how to combine some of those queries. Also, you could try and bridge the relationships in the query instead of doing it in python. I think this would give a list of all samurai in a given province. Samurai.objects.filter(room__province=current_province) Sayonara, Alex On Feb 24, 2:08 am, Ti

Re: Use django auth system with ruby on rails

2010-02-18 Thread Alex Robbins
hash combo. You could check the validity of the user id from the hash (using a shared secret). Alex On Feb 17, 4:09 pm, geraldcor wrote: > Hello all, > > Internally, we have some RoR apps and Django apps. Our main website > runs on Django and is considered to be the main portal for

Re: Problem with apache server

2010-02-04 Thread Alex Robbins
/modwsgi/#howto-deployment-modwsgi http://code.google.com/p/modwsgi/wiki/IntegrationWithDjango Hope that helps, Alex On Feb 3, 5:30 am, Zygmunt wrote: > Hi! > When i create some changes in my page, i need restart apache server. > How can i avoid restarting? -- You received this message becau

Re: Template-Include and block.super

2010-02-03 Thread Alex Robbins
Daishy, I don't think you can do that with an include tag. You could do it by defining a "base_with_menu.html" and having it extend "base.html" You could make a menu block in base and override it in base_with_menu.html. Hope that helps, Alex On Feb 3, 3:28 am, Daishy

Re: Template-Include and block.super

2010-02-02 Thread Alex Robbins
Daishy, it would help if you posted the template code you already tried. This is basically how you could do what you are describing: base.html {% block extrahead %} {% endblock %} sub_page.html {% extends "base.html" %} {% block extrahead %} {{ block.super }}

Re: Rebuild admin site after dropping field from models.py?

2010-02-02 Thread Alex Robbins
siest. 3) Make the change using SQL against the database. (Using the interactive tool that comes with most databases.) Hope that helps, Alex On Feb 1, 1:54 pm, John Abraham wrote: > I figured this out.  I my __unicode__(self) still refered to the > field! Doh! > > I changed it, reran

Re: read only django admin

2010-01-29 Thread Alex Robbins
It sounds like the databrowse[1] contrib app may be what you are looking for. It is basically a read-only admin. You'll have to register classes with it the same way you register with the admin, but it might be nicer than trying to force the admin to be read-only. Hope that helps, Alex [1]

Re: Efficient access through two manytomany layers

2010-01-18 Thread Alex Robbins
sses: parent_disciplines = this_class.parent_discipline.all() for disc in parent_disciplines: disciplines.append(str(disc.name)) self.disciplines = ', '.join(set(disciplines)) super(Event, self).save(*args, **kwargs) Hope that helps, Alex [1] http://docs.djangoproject.c

Re: Efficient access through two manytomany layers

2010-01-18 Thread Alex Robbins
Hmm, you posted the save method for your Event model, but not the definition. I think you haven't gotten any feed back because no one really knows what you are asking. Could you show the Event model, and then show what a finished save should look like? What should the data end up like? Ale

Re: Admin list_display loop though sub objects and output sum of values - newbie

2010-01-18 Thread Alex Robbins
There is also an online version of one of the django books here: http://djangobook.com/ On Jan 17, 5:08 pm, pfwd wrote: > Thanks fantastic thank you > I was also able to do: > result = obj.task_set.aggregate(Count('id'))['id__count'] > to get the a count of the tasks for quote > > I don't suppose

Re: Linked list of abstract objects

2010-01-18 Thread Alex Robbins
Also, I think you'll need to make those relations to a class that isn't abstract. Right now you have a 'class Meta: abstract=True' That means your model doesn't really exist for the relations to link to. Hope that helps, Alex On Jan 18, 2:26 am, Kerrick wrote: > I&#x

Re: how can a test log in as a given user before calling client.get()?

2010-01-07 Thread Alex Robbins
I would use the create_user[1] function, then you can just enter the password, instead of the hash value. Might make your code a little more readable. Alex [1]http://docs.djangoproject.com/en/dev/topics/auth/#creating-users On Jan 6, 3:19 pm, Phlip wrote: > > Google cannot find any traf

Re: get_absolute_url not recognized

2009-12-23 Thread Alex Robbins
n and replacing it with pass. Then try moving the function higher in the class. Hopefully you'll find the problem at one of those stages. Alex On Dec 22, 1:21 pm, neridaj wrote: > I'm trying to add a get_absolute_url method to a Tweet model from > django-syncr and do not understand

Running multiple versions of Django on the same machine

2009-12-22 Thread Alex Fink
Mac OS X 10.5, Python 2.5. Thank you, Alex -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@google

Re: Book

2009-12-22 Thread Alex Robbins
You could also try the free online book. http://djangobook.com/ On Dec 22, 3:46 am, Amine wrote: > Hi, > I'm new in django and i'm searching a book : > django 1.0 web site development PDF > > can u help me please ! > inhttp://my.softarchive.net/search/?q=django&x=0&y=0   I could not > download it

convert NodeList back to string

2009-12-16 Thread Alex
Hi, What would be the best way to convert NodeList created from template back to a string? I'm trying to implement a two-pass rendering. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegrou

Re: Filter (AND excluding empty values)

2009-12-15 Thread Alex Robbins
Does it work for one case at a time? Have you tried q = request.GET.get('city') properties = Property.objects.filter(city=q) I would make sure it is working for each variable before combining them together. (Maybe you already have, I don't know.) Alex On Dec 14, 5:32 pm, Osiaq

Scope of variables in template blocks

2009-12-12 Thread Alex Rades
Hi, I have a master template which defines two blocks: {% block account %}{% endblock %} {% block content %}{% endblock %} I have a templatetag which tells me the time of the last image upload (it's a photo sharing site). This templatetag hits the database, and I don't want to call it multiple t

Re: how to allow RSS aggregators to use feeds available only for logged-in users?

2009-12-08 Thread Alex Robbins
Maybe you could just make another url that wasn't password protected. If the token doesn't get used up in your plan, you have roughly the same security (not much). def rss_view(request): askdmalkdmakds protected_rss_view = login_required(rss_view) Hope that helps, Alex On Dec

Re: What apps do besides provide views?

2009-12-03 Thread Alex Robbins
> Yeah, app integration right now seems very non-DRY and much too fiddly. > Stands to reason > that including an app implies you include the app's urls and templates - or > why include it? I > definitely cringe when copying an integrated app's templates into my > project's template > hierarchy

Re: Sick of defining urls

2009-12-03 Thread Alex Robbins
amework is built with that mindset. It guides design decisions and allows us to move beyond arguments over personal preference. If you disagree with all (or most) of the Zen of Python, you are welcome to stay, but unlikely to be happy. If you start to complain about significant whitespace too, you a

Re: Sick of defining urls

2009-12-03 Thread Alex Robbins
Todd, If you are just trying to define a restful interface to your objects, you might look at django-piston[1] If you really want the Rails approach, you are going to be pretty frustrated working with Django. The python equivalent of "convention over configuration" is "explicit is better than imp

How to instantiate django.test.Client out of django unittest framework

2009-11-25 Thread Alex Dong
odule(self.urlconf_name) File "/Library/Frameworks/Python.framework/Versions/2.6/lib/ python2.6/site-packages/django/utils/importlib.py", line 35, in import_module __import__(name) ImportError: No module named urls -- Cheers, Alex -- You

How to tell whether the current module is loaded under `manage.py test`

2009-11-25 Thread Alex Dong
, if there is a django method called `django.test.is_testing() `, then I should be able to change the filename based on the return value. Any hints on how I could do this? Cheers, Alex -- You received this message because you are subscribed to the Google Groups "Django users" group. T

virtualenv, PIP, fabric and patches to external projects

2009-11-24 Thread Alex Rades
Hi, I know this is probably not 100% django related (well, actually is 0%) but I think most of you have worked with virtualenv and PIP and this looks like a good place to talk about deployment scenarios. Basically, I'd like to handle dependencies of my virtual environment with PIP, but I have some

Re: Is there a way to integrate php to a django app?

2009-11-23 Thread Alex Robbins
probably not worth it. Especially if you are only implementing the login and a bulletin board. Getting the login/auth accounts to work on both PHP and django will be far more work than implementing a bulletin board in any sane web framework. Hope that helps, Alex On Nov 20, 8:01 am, GreatEntrepreneur

Re: Auth and Sites in Admin

2009-11-15 Thread Alex Robbins
Those sections won't show up for anyone who doesn't have edit permissions. As long as you don't give the admin user superuser status or permissions for those apps they won't show up. On Nov 14, 6:34 pm, Zeynel wrote: > Is it possible to remove "Auth" and "Sites" sections from the Admin > panel?

Re: Is there a way to integrate php to a django app?

2009-11-14 Thread Alex Robbins
alls as an api and just making calls against it by the other half. You aren't going to get good help unless you tell us what exactly you are doing. Hope that helps. Alex On Nov 13, 7:59 pm, Allen wrote: > Hi, all: > >   I've build a application with django, and my friends buil

Re: Databrowse: Loading a large number of records

2009-11-10 Thread Alex Robbins
That error happens if you refresh the page while it is still loading from the dev server. You may have gotten impatient, refreshed and caused that error. It is possible that this isn't really the problem you are having, but just a secondary issue caused by the long load time and a page refresh. O

Re: Display a view of a single record?

2009-11-10 Thread Alex Robbins
]http://docs.djangoproject.com/en/dev/ref/contrib/databrowse/ Hope that helps, Alex On Nov 10, 3:36 am, derek wrote: > Yes, the fields should not be editable in a "view". > > However, I do not see it as "a problem" - more as "a desirable > feature".  There are any numbe

Re: syncdb for INSTALLED_APPS throws errors

2009-10-29 Thread Alex Robbins
The warning on line 2 is because you are using python2.6, default in Ubuntu9.04. You don't need to worry about it. It is just telling the authors of mysqldb that ImmutableSet is going away in newer versions of python. Not something you need to care about. On Oct 29, 3:37 am, sridharpandu wrote:

Re: {% url in templates

2009-10-29 Thread Alex Robbins
Maybe it is just me, but I feel like writing out the view functions like that is a beating. I just name[1] all the urls. Then the url tag is easy. I just do things like {% url home-page %} or {% url blog- index %}. If you set up a generic view in the views and name it, it will work like normal. [

Re: Admin why deleting related(null=True) objects?

2009-10-08 Thread Alex Robbins
This sounds related to this ticket http://code.djangoproject.com/ticket/9308, which supposedly fixed this issue 5 months ago. You should probably file a bug report. On Oct 7, 4:19 pm, Peter Sagerson wrote: > Yes, Django always cascades deletes. There's talk about providing more   > options in a

Re: TinyMCE in Admin (Practical Django Projects book)

2009-09-28 Thread Alex Robbins
If you use the net tab of firebug[1] you can tell when url/file paths are messed up. That is the only way I ever get tinymce running. [1]http://getfirebug.com/ On Sep 27, 7:29 am, Erik Kronberg wrote: > On Sun, Sep 27, 2009 at 1:54 PM, James Bennett wrote: > > > > > > > On Sun, Sep 27, 2009 at

Re: My Django powered website for web based learning

2009-09-28 Thread Alex
Good job! Didn't have much time to check the content but the first 4 or 5 videos seemed very interesting. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to djan

Re: Retrieving the request URI inside the view function?

2009-09-26 Thread Alex Robbins
that has the redirect logic you are after. [1] http://docs.djangoproject.com/en/dev/topics/auth/#the-login-required-decorator [2] http://docs.djangoproject.com/en/dev/topics/auth/#django.contrib.auth.views.login Hope that helps, Alex --~--~-~--~~~---~--~~ You r

Re: Firefox search plugin for Django documents

2009-09-26 Thread Alex Robbins
Very nice. I just found out you can assign a keyword to search engines in the manage search engines menu. Now I just type "django search term" in the location bar and I get what I need. Don't have to change the search engine back and forth. Thanks for the awesome plugin. On Sep 24, 4:01 am, 玉东

Re: how to return ajax info in one case, and redirect to a different url in another?

2009-09-15 Thread Alex Robbins
imply make one of the ajax responses be {"redirect_to": "http://www.example.com/"} and parse it out on the client side. Hope that helps, Alex On Sep 15, 2:07 am, Margie Roginski wrote: > I have a situation where the user fills in a form and hits submit to > post the for

Re: Is there an example of html template usage?

2009-09-10 Thread alex
http://www.satchmoproject.com/ good luck On Sep 10, 9:07 pm, aftalavera wrote: > Hi there, > > Where can I found sample about real apps usgin html templates with > Django templates? --~--~-~--~~~---~--~~ You received this message because you are subscribed to th

Re: haml + sass + django

2009-09-09 Thread Alex Robbins
You might look at http://sandbox.pocoo.org/clevercss/, which is python based. On Sep 8, 9:19 am, ThinRhino wrote: > Hello, > > I just came across haml and sass, but looks like it is built for Ruby on > Rails. > > Any implementation that can work on Django? > > Though I also came acrosshttp://bit

Re: QuerySet cache

2009-09-06 Thread Alex Gaynor
call .iterator() on the QuerySet and it will hvae it's cache disabled. 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 "Code can always be sim

Re: name error not defined in models

2009-09-01 Thread Alex Gaynor
class Dek(models.Model): >    ank = models.ManyToManyField(Ank) > > How come I got "NameError: name 'Dek' is not defined" when running > runserver > > > > > > Take a look at: http://docs.djangoproject.com/en/dev/ref/models/fields/#lazy-relationships Alex

Re: Django and SSL Deployment using mod_wsgi

2009-09-01 Thread Alex Robbins
tally going to http://mysite/credit_card_form/ will be redirected to https:// I'm guessing that overriding the wsgi.url_scheme is meant to handle that, but I don't understand how. Thanks, Alex On Aug 31, 6:02 pm, Graham Dumpleton wrote: > On Sep 1, 3:39 am, Francis wrote: >

Re: FormWizard: how to pass in extra keyword arguments into a form's __init__?

2009-09-01 Thread Alex Robbins
I guess the question is when you know the additional keyword argument. If you already know what that extra keyword is when you are constructing the form list, you could use a partial[1] to put in the arguments you know already. Partials are python 2.5+ only, you can use a lambda instead if you are

Re: Defining subsets of "list" variable at template level

2009-08-31 Thread Alex Robbins
First, if you aren't running into db performance problems, I wouldn't optimize. Keep everything as simple as possible, then optimize the parts that actually demonstrate themselves to be a performance issue. If this really is a performance issue, you could solve it like this: If you know that you

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

2009-08-31 Thread Alex Gaynor
;field2') > > For some reason, I can't get field2 removed from the subclassed form. > If I subclass AnotherForm from ModelForm, field2 will be removed, but > then I lose all my customizations from MyForm... > > > The answer is you don't. You change the inheritanc

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

2009-08-30 Thread Alex Gaynor
> do this with the Django ORM. > > Thanks for any thoughts on this, > > Stephen > > > LinkBack.objects.values_list('target_url', flat=True).distinct() should do what you want. Alex -- "I disapprove of what you say, but I will defend to the death your right to

Re: Django searching for admin template in admindocs directory

2009-08-30 Thread Alex Gaynor
gt;    (r'^admin/', include(admin.site.urls)), >    (r'^articles/', include('oslaurier.articles.urls')), > ) > > -- > > I noticed that for some reaso

Re: Advice on Subclassing a TextField

2009-08-30 Thread Alex Robbins
Also, maybe you aren't submitting all the code, but you could do the same thing by just passing an attrs dictionary to the text area widget. http://docs.djangoproject.com/en/dev/ref/forms/widgets/#django.forms.Widget.attrs Not sure that this requires two more classes. Hope that helps,

Re: Advice on Subclassing a TextField

2009-08-29 Thread Alex Gaynor
>     return super(HtmlField, self).formfield(**kwargs) > >     def __init__(self, *args, **kwargs): >     super(HtmlField, self).__init__(*args, **kwargs) > > > > > The biggest thing is there is no need to rewrite the __init__ method if you aren't chang

Re: Django and SSL Deployment using mod_wsgi

2009-08-29 Thread Alex Robbins
You'll probably want to look into something like this: http://www.djangosnippets.org/snippets/880/ It allows you to set some urls to redirect so they are always https. Otherwise those silly users will go to credit card pages without https. On Aug 29, 1:04 am, Vitaly Babiy wrote: > Hey guys, > W

Re: Execute code after sending a http response?

2009-08-28 Thread Alex Robbins
You'll have to set something in a table and run a cron to send it later. Django-mailer [1] has all of this set up for, along with some other cool features. I've used it in a project before and been happy with it. [1] http://code.google.com/p/django-mailer/ On Aug 28, 1:10 am, Shadow wrote: > Hi

Re: QuerySet without result_cache?

2009-08-27 Thread Alex Gaynor
On Thu, Aug 27, 2009 at 5:56 PM, Sam Tregar wrote: > On Thu, Aug 27, 2009 at 5:47 PM, Alex Gaynor wrote: >> >> Instead of iterating over the QuerySet itself, use >> QuerySet.iterator(), this will avoid populating the result cache. > > Thanks, works great!  This would

Re: QuerySet without result_cache?

2009-08-27 Thread Alex Gaynor
cache which is holding all the rows > retrieved by the query.  Is there any way to turn this cache off?  Looking > at the code leads me to think no, but I thought I'd ask. > > -sam > > > > > Instead of iterating over the QuerySet itself, use QuerySet.iterator(), this

Re: show user and date in change_list

2009-08-27 Thread Alex Gaynor
#x27;] > > >> >> But both functions returns (None). Why I can do it? >> >> > > > > > You can't have methods with the same names as fields on your models, since this would mean an object having two attributes by the same name. Alex -- "I disa

makemessages clutters project locale files with strings from already translated apps

2009-08-26 Thread Alex Rades
Hi, I have many applications in my project. I've carefully translated them launching manage.py makemessages from within each application directory, so that each app has its own locale/ directory with translations. When it comes to translating project-level strings, and I launch makemessages from

Re: Creating forms

2009-08-25 Thread Alex Gaynor
t; > > Cheers > > tom > > > > Take a look at formsets: http://docs.djangoproject.com/en/dev/topics/forms/formsets/ 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 highes

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

2009-08-25 Thread Alex Gaynor
your tests in a tests.py file, however you still need to have an empty models.py file, so Django picks up the app correctly. Alex -- "I disapprove of what you say, but I will defend to the death your right to say it." -- Voltaire "The peo

Re: How to validate image dimensions?

2009-08-21 Thread Alex Gaynor
rt Image > image = Image.open(img) > if image.size[0] > 64: #image.size is a 2-tuple (width, height) >   ... > Or you could resize it down to 64 px if it is bigger. > TiNo > > > If you call django.core.files.images. get_image_dimensions on the file you'll get back a width, height dim

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

2009-08-20 Thread Alex Gaynor
types.models import ContentType ct = ContentType.objects.get_for_id(content_type_id) obj = ct.model_class()._default_manager.get(pk=obj_id) 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: Bulk data insert

2009-08-20 Thread Alex Gaynor
imagine Django is running INSERT and COMMIT each time?). > > Thanks very much. > > > > Django doesn't currently support any form of bulk insert. Using raw SQL is your best option at this point. Alex -- "I disapprove of what you say, but I will defend to the de

Re: save a form

2009-08-19 Thread Alex Gaynor
- >> DR. > > > On a validated form the values will be in the dictionary form.cleaned_data 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 la

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

2009-08-18 Thread Alex Gaynor
ingle object, I could spare a little > bit of code, if I just write: >>>> "User.objects.get(username='Leon').avatar" > instead of >>>> "u = User.objects.get(username='Leon')" >>>> "UserProfileExtension.objects.get(user=

Re: Problem installing Django 1.1 on XP

2009-08-18 Thread Alex Gaynor
\django\utils\__init__.py", line 1 >    Django-1.1/of the Lawrence Journal-World newspaper in Lawrence, > Kansas. >                           ^ > SyntaxError: invalid syntax > > Any ideas? > > > > Your download got messed up somehow, that content does'nt exi

Re: Django model register for admin section

2009-08-18 Thread Alex Gaynor
r way to register all class by single register call  like > this >    admin.site.register(Poll,Choice,Vote) > > with thanks > Ajay > > > Yep, admin.site.register([Model1, Moel2, Model3]) Alex -- "I disapprove of what you say, but I will defend to the death your right to

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

2009-08-16 Thread Alex Gaynor
rkaround I can do to make it work? > > > MySQL works fine for me under Python 2.6, you get a warning when you import it, but that doesn't prevent normal execution, it's just annoying ;) Alex -- "I disapprove of what you say, but I will defend to the death your right

Re: QuerySet's cache

2009-08-16 Thread Alex Gaynor
oes not contain new tag >>>> queryset > [, ] > > # hmm, maybe not?? > > Any help on clarifying this would be greatly appreciated! > > David > > > > The issue here is how __repr__ works on QuerySets, specifically it does repr(list(self[:MAX_REPR_SIZE]

Re: mass-updating question

2009-08-13 Thread Alex Gaynor
> > > > If you're using django 1.1 you can use the new F() objects so it'd look like: thread.forums.allparents.update(postcount = F('postcount')+1, lastpost=post) Alex -- "I disapprove of what you say, but I will defend to the death your right to say it.&q

Re: Need help with filter, limit and order_by query

2009-08-12 Thread Alex Gaynor
ew attempts but the > results were as above). > > > Your best bet would be to take the items you want. And do items = list(items) items.reverse() to put them in the correct order in Python, this is going to be easier than mucking around with custom SQL. Alex -- "I dis

Re: Django aggregates and having

2009-08-12 Thread Alex Gaynor
u're getting exactly what you've asked for. Your query contains >> filter(l=2) - that is, you're filtering on l, the SUM. >> >> > How can I force using having when I can't define the param in >> > annotate? >> >> I'm afraid I don&#x

Re: unique_together with None

2009-08-11 Thread Alex Gaynor
t; > > You are talking about in the forms/admin validation correct? Thinking to how this is implemented there likely is a bug where this doesn't use the SQL concept of NULL != NULL and uses the Python None == None instead, which of these behaviors is correct I'm not sure of (though I lean t

Re: Dumping Large Databases

2009-08-11 Thread Alex Gaynor
lot more >> efficient and robust. Dumpdata is great for the sweet spot, but it isn't >> designed to completely replace all existing database tools. >> >> Regards, >> Malcolm >> >> >> >> > >> > > > > Unless the majority of

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

2009-08-10 Thread Alex Gaynor
7;: 1249911607L}, {'time': 1249911607L}, {'time': > 1249911607L}, ...] >>> > > The same thing happens in the Admin when I specify date_hierarchy in > my ModelAdmin a one of these fields.  Why are the standard accessor > methods (namely 'to_python()')

Re: My ModelAdmin customizations don't work

2009-08-08 Thread Alex Gaynor
>    search_fields = ['name'] > > admin.site.register(University) > > > > Your problem is you registered your Model with the admin without telling it about your custom ModelAdmin class, so it used the default one. The last line should be. admin.site.regist

Re: DeprecationWarning - How can I fix this?

2009-08-08 Thread Alex Gaynor
eprecation warning, however it will continue to work perfectly fine. 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 "Code can always be simpler than you think,

Re: Sum for each day? aggregate / annotate

2009-08-08 Thread Alex Gaynor
don't provide a way to work with dates that easily, however I think this task might be accomplishable with a custom Aggregate object, search the mailng list for more information on creating these. Alex -- "I disapprove of what you say, but I will defend to the death your right to say it.&

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

2009-08-08 Thread Alex Gaynor
hen I >> > moved to a different db? >> >> Actually, my SQLite observation was entirely bogus. I suspect what >> you're seeing is the difference between these two lines: >> >>         t1 = Task.objects.create(status=u'3') >>         t2 = Task

Re: access to REQUEST_URI ?

2009-08-06 Thread Alex Koshelev
Hi, Rebecca! Try to use request's `get_full_path` [1] method. It's environment independent and produces full path string with query. [1]: http://docs.djangoproject.com/en/dev/ref/request-response/#django.http.HttpRequest.get_full_path --- Alex Koshelev On Fri, Aug 7, 2009 at 1:37 A

Re: python md5

2009-08-06 Thread Alex Gaynor
ed > > > Thanks > > > You can call the hexdigest() method on the md5 object to get a string of the hash. 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." --

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

2009-08-05 Thread Alex Gaynor
s or with sqlite) I get this >> assertion error: >> >> Traceback (most recent call last): >> ... >> AssertionError: 3 >> >> If someone more clued up than me could take a look at this and confirm >> that it is a Django bug I can start looking int

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

2009-08-05 Thread Alex Gaynor
:project, 'form':form, > 'newurl':newurl} >    ) > >    return response > > template.html > > > {% extends 'base.html' %} > {% load i18n %} > > {% block content %} > > {% trans "Browse Measurands" %} ({% trans &qu

Re: Can i rise 404 from my middleware ?

2009-08-04 Thread Alex Gaynor
= > urlparse.urlsplit(request.META['HTTP_HOST'])[2].split('.') >                        request.subdomain = bits[0] >                else: >                        raise Http404 > > -- > Mirat Can Bayrak > > > > Right now there is a bug in django's middleware where it doesn&

Re: is it possible to do a monkey patch on django.contrib.atuh.models.User to make the email field unique?

2009-08-04 Thread Alex Koshelev
Hi, Vasil! `Field.unique` is the read only property. If you want to set uniqueness you have to assign field's `_unique` attribute to True. --- Alex Koshelev On Wed, Aug 5, 2009 at 12:54 AM, Vasil Vangelovski wrote: > > Having this line of code: > > User._meta.get_field(&#

Re: Intermediate Table question

2009-08-04 Thread Alex Gaynor
t > > I'd like to store all the ordering info in one intermediate table > while maintaining different tables for the porducts > > Lee > > > Bah, this is what I get for reading too quickly. The answer is maybe, you'd have to try it. I see no obvious reason it wouldn&

Re: model upload_to

2009-08-04 Thread Alex Gaynor
works great if I just want to change the filename but I can't > change folder. > > So what am I doing wrong? > > Stefan > > > > > > > > You needed to do self.the_file. In python member variables aren't automatically accessible, you have to get them

Re: 'RelatedManager' object is not iterable

2009-08-04 Thread Alex Gaynor
mpression that the output from obkects.all() was > iterable? > > I would appreciate any help anyone can give. > > Thanks > > > > It is, you've done something, either in your template or in your models that's somehow causing the issue. If you could show us those

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