Re: validating fields with newforms - part 2

2007-11-26 Thread Thomas Güttler
rtEnd(Form): start = IntegerField() end = IntegerField() def clean(self): start, end = self.cleaned_data.get('start'), self.cleaned_data.get('end') if start!=None and end!=None and start>end: self.errors.append('start&#

Re: Out of range value

2007-11-26 Thread Thomas Güttler
usted for column 'poolMaskID' at row 1! There is a patch which works for me (postgres): http://code.djangoproject.com/ticket/399 -- Thomas Güttler, http://www.tbz-pariv.de/ Bernsdorfer Str. 210-212, 09126 Chemnitz, Tel.: 0371/5347-917 TBZ-PARIV GmbH Geschäftsführer: Dr. Reiner Wohl

SCGI (or other) graceful restart

2007-11-30 Thread Thomas Güttler
support graceful restart. Thomas -- Thomas Güttler, http://www.tbz-pariv.de/ Bernsdorfer Str. 210-212, 09126 Chemnitz, Tel.: 0371/5347-917 TBZ-PARIV GmbH Geschäftsführer: Dr. Reiner Wohlgemuth Sitz der Gesellschaft: Chemnitz Registergericht: Chemnitz HRB 8543

Signals: Server ready to server first request.

2007-12-14 Thread Thomas Guettler
Hi, I read this: http://code.djangoproject.com/wiki/Signals But I couldn't find a solution to execute code, if the SCGI/FastCGI/WSGI server is up, ready to handle the first request. Or is there an other way (without signals)? Thomas --~--~-~--~~~---~--~

Raising Http Redirect

2008-01-02 Thread Thomas Guettler
raise responseutils.HttpRedirectException(obj.get_absolute_url()) Thomas --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe f

Re: Raising Http Redirect

2008-01-02 Thread Thomas Guettler
Am Mittwoch, 2. Januar 2008 11:09 schrieb James Bennett: > On Jan 2, 2008 3:49 AM, Thomas Guettler <[EMAIL PROTECTED]> wrote: > > The HTTP return codes 404 and 500 can be raised with an exception. > > > > That's very handy. Unfortunately a Http Redirect can't

Django development work in Sydney, Australia

2006-11-27 Thread Thomas Ashelford
well-resourced. I'm looking for someone Sydney-based, who can work largely unsupervised. Specific real-world Django experience would be great, but a strong Python background and a brief exposure to Django would be considered as well. If you're interested in talking further, drop me a

Anyone got PyTextile?

2006-06-21 Thread Thomas Ashelford
I've been trying to source a copy of PyTextile 1.3 to use in a Django application I'm building, but the dealmeida.net server is down. Is there any kind soul out there who could email a copy at thomas-at-ether.com.au? --~--~-~--~~~---~--~~ You rec

Re: Anyone got PyTextile?

2006-06-26 Thread Thomas Ashelford
Thanks William, I don't know if that's the latest version, but it's working fine. It looks like dealmeida.net is down for the count. Cheers, Thomas William McVey wrote: > On Wed, 2006-06-21 at 11:53 -0400, Jay Parlar wrote: > > On 6/21/06, Thomas Ashelford &

PostgreSQL vs. MySQL

2006-07-06 Thread Thomas Ashelford
I keep reading that PostgreSQL is the preferred database for use with Django, but I'm wondering if anyone can explain what its concrete advantages are. I've just moved from DreamHost to Webfaction to get the advantage of using mod_python instead of fcgi. Already the advantages of mod_python are c

Re: __init__() got an unexpected keyword argument 'on delete' when make migrations

2021-12-05 Thread Thomas Lockhart
Please use polite language. Thank you. - Tom > On Dec 5, 2021, at 5:21 PM, Anurag Agarwal wrote: > > Why are you fucking passing the args > On_delete in manytomany . Class > >promotion = models.ManyToManyField(Promotions, on_delete=models.CASCADE) > > > On Sun, Dec 5, 2021, 21:09 Samuel

Re: Declarative mechanism for Django model rows

2021-12-08 Thread Thomas Lockhart
I may be completely misunderstanding your use case, but just in case… You can have different views in your application, and if you don’t want to expose the data as separate pages then you might consider django-rest-framework to provide data in various ways, including across models. You’ll end up

Re: get country from IP_addres.

2021-12-15 Thread Michael Thomas
https://docs.djangoproject.com/en/4.0/intro/tutorial02/#playing-with-the-api Kind Regards, Michael Thomas On Thu, Dec 16, 2021 at 3:08 PM Amor Zamora wrote: > Can you help me? > I need to obtain the country of where the users access from the IP and > insert that information into the sqlite3 databa

Running tests fails in the test runner call_command

2021-12-21 Thread Thomas Lockhart
I’ve got a 3.2.10 installation and haven’t run my unit tests in a long time. When I try now, I get a failure which seems to trace back to the test runner itself: TypeError: Unknown option(s) for check command: databases. Valid options are: all, debug, force_color, help, names, no_color, pythonp

Re: Search & replace an object in the database

2022-01-21 Thread Thomas Lockhart
Yes this exactly. A couple of possible additions: I’ve had great luck using python and SQL queries to manipulate a database including converting from other schemas and merging duplicate records. Make a test database from your backup, and beat it up with your scripted code until you are happy wi

Re: Django 1.5 app had subclasses without tables without proxy and now 1.6 won't sync with proxy

2022-04-05 Thread Thomas Lockhart
(Used 1.5 but don’t remember a thing :) ) Yes, what Steven says. If you try moving through each version then you will end up understanding a *lot* more about the application, but it sounds painful. Your specific question seems to indicate that you would want your subclasses to actually share ta

Re: Please criticise use of global keyword in Admin

2022-05-18 Thread Michael Thomas
to get wrong, in my opinion at least! Kind Regards, Michael Thomas On Thu, May 19, 2022 at 9:34 AM Mike Dewhirst wrote: > The code below appears to work perfectly but it worries me because I > have never used the global keyword before. > > Is there a generous guru who will criticise

Re: Added new column to model and run migrations but not applied to database table

2022-07-03 Thread Thomas Lockhart
Sorry that you are having continued problems. Your first report was almost a year ago and did not end up getting resolved but all the history on your thread is missing here so we can’t help with this information. “Migrations were not added” might indicate that your development server is out of

Re: DRF question

2022-07-18 Thread Michael Thomas
ssions and serializers mentioned above, as well as any additional actions that didn't fit within the normal REST verbs 4) Created a router and registered the viewsets with it 5) Added the router's urls into the projects url configuration I hope that's useful :) Kind Regards, Michael Thomas

Re: DRF question

2022-07-20 Thread Michael Thomas
est-framework.org/api-guide/views/ >>> >>> On Tue, 19 Jul 2022 at 06:38, Nikhil Chawla >>> wrote: >>> >>>> Don't clutter the django views with DRF requests. Keep them separate, >>>> available at, say `api` endpoints. >>&g

Re: Need help on reducing cognitive complexity

2022-07-21 Thread Michael Thomas
Personally I think the code has a very weird "smell"... Assuming you don't have any way of rewriting the calling code and are stuck with editing this single method, I'd suggest something along the lines of: @staticmethod def in_circle_check(obj_type, item, uuid): if obj_type not in ['trees', '

Re: Search option in website

2022-07-23 Thread Thomas Lockhart
You can implement a robust search using something like elastic search or whatever seems to be the best choice currently (haven’t done one in a few years). Hth - Tom > On Jul 23, 2022, at 9:39 AM, Mahendra wrote: > > Hi to all, > How to implement Search option in website.please any one guide

Re: Setting up Celery with Python

2022-08-05 Thread Thomas Lockhart
Django and celery need a message server to communicate. You’ve configured one but it does not seem to be running. - Tom > On Aug 5, 2022, at 8:56 PM, Madhusudhan Reddy wrote: > > Hi Team, > > What's wrong...? > 09-19-34.png> 2022-08-06 09-18-44.png> > > -- > You received this message becau

Re: Two list on one page

2022-08-24 Thread Thomas Lockhart
Lay out your template to include both lists, then define get_context_data() in your view to have two lists of objects to show in your template. Get farther along and it will be easier for us to answer specific questions. hth - Tom > On Aug 24, 2022, at 12:34 PM, Matheus Bon wrote: > > What w

Re: Negative Stock Prevention

2022-08-30 Thread Thomas Couch
I don't see where you define the quantity variable, should that be instance.quantity? Also, presumably you want to check if quantity is greater than or equal to qu rather than 0. Try changing `if quantity > 0` to `if instance.quantity >= qu` On Tuesday, August 30, 2022 at 3:44:51 PM UTC+1 Ryan

Re: Averaging timestamp deltas with Django ORM

2022-09-07 Thread Thomas Lockhart
Something like qs.aggregate(delay=Avg(F(“approved_at”) - F(“created_at”)))[“delay”] where I cribbed the technique from https://stackoverflow.com/questions/50219652/django-queryset-get-avg-of-2-fields hth - Tom

Re: JSON files. How is it done?

2022-09-22 Thread Thomas Lockhart
This will create a JSON file of the specified name for data from a time range specified in the URL. Re-reading your post, it seems that perhaps you don’t actually want a physical file but rather some JSON data to populate your browser window.Then Django Rest Framework will do what you want afte

Re: Adding csv as models

2022-09-23 Thread Thomas Lockhart
This is a very broad question so perhaps you are the stage of choosing the tools. The workflow, handling historical data, managing updates and replacement data, etc are things to consider for a production system so you’ll need to deal with those design questions. For my most recent system I do

Re: Anyone help?

2022-10-15 Thread Thomas Lockhart
You don’t run model files directly, but rather through manage.py which references your settings.py file. ./manage.py hth - Tom > On Oct 15, 2022, at 1:07 PM, It's ShAdAn wrote: > > Got error > > > /usr/bin/python3.9 > /home/user/PycharmProjects/pythonProject4/mycham/abcd/models.py > Tr

Re: getting unique id

2022-11-23 Thread Thomas Lockhart
Why not use the existing Django AutoField? - Tom > On Nov 23, 2022, at 8:56 AM, Larry Martell wrote: > > I have an app that needs to get a unique ID. Many threads run at the > same time that need one. I would like the IDs to be sequential. When I > need a unique ID I do this: > > with transact

Django .values() / SQL table fields wildcards

2023-02-02 Thread Thomas Schmidt
, t2 and t3 are serializable as models in the ORM) Is this possible? So far, I looked at `values` and `values_list` but there doesn't seem to be a documented way to do this. Any help appreciated, I know this group is helpful, -- Thomas -- You received this message because you are subscrib

Runtime decision on language support

2023-04-24 Thread Shawn Thomas
Hi, I've searched online for an answer to this but couldn't find anything. I have a multi-tenant Django app that supports multiple languages, both in code (django.po/django.mo) and for customer data. However, not every customer wants to translate their data into every language we support (thin

Re: Runtime decision on language support

2023-04-25 Thread Shawn Thomas
Thank you so much for your incredibly thorough response, Emmanuel! That is exactly the kind of insight I was hoping for. Best, Shawn From: django-users@googlegroups.com on behalf of ASAMOAH EMMANUEL Date: Monday, April 24, 2023 at 10:22 PM To: django-users@googlegroups.com Subject: Re: Runt

Django date time picker

2023-05-29 Thread Thomas Mutavi
Hello, how can i implement a form with several date fields which have date and time picker in django? -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-us

Django Deployment.

2023-06-24 Thread Thomas Mutavi
Hello team, Please recommend an article or a tutorial on Django deployment on windows server 2016 using either IIS or Apache. If you know the whole process you can also share. Thanks -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubsc

Re: Calculations

2023-07-07 Thread Thomas Couch
Hi Abdou, have a look at aggregation (https://docs.djangoproject.com/en/4.2/topics/db/aggregation/) In this case I think you'll want something like: ``` from django.db.models import Sum # Where loan = the LoanInformation instance you're interested in outstanding_balance = loan.amount_to_pay -

Re: Calculations

2023-07-07 Thread Thomas Couch
Or, you can combine annotations and expressions to do something like this: qs = LoanInformation.objects.annotate(outstanding=F("amount_to_pay") - Func(F("payments__amount"), function="SUM)) loan = qs.get(id=loan_id) loan.outstanding On Friday, July 7, 2023 at 4:03:09 PM

Re: Calculations

2023-07-10 Thread Thomas Couch
Ah ok, looks like aggregate always returns a dictionary. This should work: outstanding_balance = loan.amount_to_pay - loan.payments_set.aggregate(paid=Sum("amount"))['paid'] On Monday, July 10, 2023 at 11:03:06 AM UTC+1 Abdou KARAMBIZI wrote: > Hello Thomas > >

Re: Is there a way to prevent /static directory browsing?

2012-02-06 Thread Cherian Thomas
Direct your webserver to prevent this. .htaccess/conf in apace. Directory browsing is disabled by default in nginx http://www.ducea.com/2006/06/26/apache-tips-tricks-disable-directory-indexes/ Regards, Cherian On Mon, Feb 6, 2012 at 8:23 PM, Robert Steckroth wrote: > Hey Guys, I am looking fo

Re: Finding It Hard To Make It Work!

2012-02-08 Thread Thomas Weholt
Google "ajax tutorial" or even better just google jquery and take it from there. There are several tutorials on how to integrate jquery and django as well. Thomas On Wed, Feb 8, 2012 at 10:11 AM, coded kid wrote: > How bro? Don't know Ajax. Can you please put me through? I&

Re: How can I load a custom template filter which is in my project directory ?

2012-02-14 Thread Thomas Rega
Am 14.02.12 21:28, schrieb Nolhian: Hello everyone, In my template I put : {% load pygmentize %} But I got : TemplateSyntaxError at / 'pygmentize' is not a valid tag library: Template library pygmentize not found, tried django.templatetags.pygmentize,django.contrib.admin.templatetags.pygmentiz

Update primary key and update child tables

2012-02-22 Thread Thomas Guettler
). Thomas Güttler -- Thomas Guettler, http://www.thomas-guettler.de/ E-Mail: guettli (*) thomas-guettler + de -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscribe

Re: Django TypeError

2012-02-22 Thread Thomas Rega
Am 22.02.12 15:11, schrieb coded kid: return u"/%i/%i/%i/sol/%i/%s/" % (self.date.year, self.date.month, self.date.day, self.id) 5 != 4 cheers ... -- http://thoreg.com -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this gr

Re: Traceback from csrf_exempt in 1.3.1

2012-03-02 Thread Thomas Orozco
You seem to have no 500.html page. This traceback won't actually show the error that happened, but error out on the fact that it can't find a template to display the 500 error. 1. Are you running DEBUG = True? 2. Wouldn't you rather want to simplejson.dum > > I have never used csrf_exempt before.

Re: social graph

2012-03-05 Thread Thomas Orozco
You might want to look into the Django socialauth app Le 5 mars 2012 14:08, "suresh dokania" a écrit : > How to access user 's facebook profile information using django ? > And how to find their friends and use their info as well ? > > -- > You received this message because you are subscribed to

Re: Traceback from csrf_exempt in 1.3.1

2012-03-05 Thread Thomas Orozco
my urls.py > > url(r'^auth/', 'auth.views.json_api'), > > Once I uncomment the two csrf_exempt statements, I get the 500 error? > Any ideas? > > > > On Mar 2, 6:57 am, Thomas Orozco wrote: > > You seem to have no 500.html page. > > >

Re: ANN: Mezzanine 1.0 released

2012-03-05 Thread Thomas Woolford
You should consider using Sentry Instead. This way you will get live feedback on errors, even ones that nobody reports. On Mar 4, 1:24 pm, Stephen McDonald wrote: > Yes - behind the project homepage is the entire demo site where anyone > can log in and try it out. I've left debug on so that when

Batch processing in parallel (celery)

2012-03-12 Thread Thomas Guettler
overkill for my current project. How can I use the ORM with the multiprocessing python module? The docs don't contain information about this. On the net you can find some notes How do you solve this? Do you use celery? Thomas -- Thomas Guettler, http://www.thomas-guettler.de/ E

Re: Django deployment practices -- do people use setup.py?

2012-03-14 Thread Thomas Guettler
methods and variables. Switching between a deployment implementation would be easier. Thomas Am 12.03.2012 23:55, schrieb Tom Eastman: Hey guys, I'm looking for deployment best practices for Django projects. Google searches seem to show countless numbers of them, many of them som

syncdb failure in new project with 1.4c2

2012-03-17 Thread Thomas Lockhart
I see this is an old ticket (#16017) but the same failure is showing in 1.4c2 and the code does not reflect the solution suggested in the ticket comments: python manage.py syncdb ... Creating tables ... Creating table auth_permission Creating table auth_group_permissions Creating table auth_group

Re: Bulk Creating Django Models from CSV File?

2012-04-02 Thread Thomas Weholt
You might want to look at DSE as well. Currently is has some issues with Django 1.4, but I'll look into fixing those tonight. https://bitbucket.org/weholt/dse2 Regards, Thomas Weholt On Mon, Apr 2, 2012 at 7:24 AM, Victor Hooi wrote: > Hi, > > I have several large CSV files that

Comparing QuerySets

2012-04-05 Thread Thomas Guettler
Not equal? I think they should be Not equal? I think they should be: [1] [1] I could not find a documentation of this in the django docs[1]. Before creating a doc-ticket I want to ask here. [1] https://docs.djangoproject.com/en/dev/ref/models/querysets/ -- Thomas Guettler, http://www.thomas-gue

Re: Force logout a user in signed cookie mode

2012-04-10 Thread Cherian Thomas
Hi, all Can someone help? - Cherian On Tue, Apr 10, 2012 at 11:51 AM, Cherian wrote: > Hi all, > > In the signed cookie mode is it possible for me force logout an > account? > Say I login from two places, and I need to logout my account from the > one access I forgot to logout in a public inte

PostgreSQL Introspection Bug

2012-04-11 Thread Thomas Guettler
Hi, I fixed a postgreSQL introspection bug, but unfortunately it is still in stage "new". Can someone please review it? https://code.djangoproject.com/ticket/17785 Thank you, Thomas Güttler -- Thomas Guettler, http://www.thomas-guettler.de/ E-Mail: guettli (*) thomas-gue

DB queries at import time

2012-04-12 Thread Thomas Guettler
def mychoices(): for obj in MyModel.objects.all(): # this hits the db during import. That's not good. class MyForm(forms.Form): foo=forms.ChoiceField(choices=mychoices()) -- Thomas Guettler, http://www.thomas-guettler.de/ E-Mail: guettli (*) thomas-guettler + de -- You rec

Re: DB queries at import time

2012-04-12 Thread Thomas Guettler
Am 12.04.2012 15:25, schrieb Jani Tiainen: 12.4.2012 15:09, Thomas Guettler kirjoitti: Hi, sometimes it happens, that db queries get executed at import time (during importing the file by the interpreter). That's waste of time a resources. Is there a way to test how many querie

Re: DB queries at import time

2012-04-13 Thread Thomas Guettler
. Thomas -- Thomas Guettler, http://www.thomas-guettler.de/ E-Mail: guettli (*) thomas-guettler + de -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscribe

Re: New to Jdango - What IDE to use?

2012-04-23 Thread Thomas Weholt
m is great and the guys behind it makes a bunch of great products. Thomas On Mon, Apr 23, 2012 at 2:01 PM, Timothy Makobu wrote: > I have one of those actually, but that's coz I have a project that's been > around a while. They actually checked out the googlecode page. > > &

Re: deploying django - including third party apps

2012-04-26 Thread Thomas Rega
Am 26.04.12 09:37, schrieb luke lukes: Hi Daniel. yes I have ssh access but without root or sudo privileges. it seems there's no virtualenv installed. i've tried to install virtualenv with 'pip install virtualenv' but i got this error: /error: /usr/local/lib/python2.6/site-packages/virtualenv

Re: how to get the variable in the context

2012-04-28 Thread Thomas Rega
Am 28.04.12 11:11, schrieb DanYun Liu: I defined a context processor to pass the login user info to the template. and, I also need to use it in the view. is there any way to get the variable from the context? http://stackoverflow.com/questions/41547/always-including-the-user-in-the-django-te

Re: Import from local ftp server

2012-04-30 Thread Thomas Weholt
Might not be exactly what you need, but want to mention it anyway: https://bitbucket.org/weholt/djftpd Regards, Thomas On Mon, Apr 30, 2012 at 5:33 PM, orsomannaro wrote: > Hi all. > > In my LAN I have some files stored in a ftp server, to which I can access > from my computer w

Best practices for calling an external service in a Django app

2012-05-11 Thread Thomas Orozco
ser's end. What are the best practices here ? Should I open a socket connection each time I want to access the service? Should I keep one open all the time in a separate thread? Thanks in advance, Thomas -- You received this message because you are subscribed to the Google Groups "D

Re: Best practices for calling an external service in a Django app

2012-05-11 Thread Thomas Orozco
> If you are making a lot of requests, the overhead of making new > connections may prove to be significant. I wouldn't anticipate this unless > you are making a new request more frequently than perhaps once a second > (and even then, I would wait and see what performance was like).

Re: Does Django guarantees to generate well Optimized SQL Query ??

2012-05-18 Thread Thomas Lockhart
On 5/18/12 10:02 AM, George Silva wrote: Yes and no. And it does not (can not) protect one from building a bad model which could result in bad performance. So having a requirement for high performance without having done some reading on data normalization and SQL schema design probably gets th

Links between App and Docs

2012-05-21 Thread Thomas Guettler
ow do you do this? Reated: http://stackoverflow.com/questions/10512971/links-between-documentation-sphinx-and-django-app http://sphinx.pocoo.org/latest/ext/intersphinx.html -- Thomas Guettler, http://www.thomas-guettler.de/ E-Mail: guettli (*) thomas-guettler + de -- You received this message be

Re: Python Web Development with Django by Wesley Chun

2012-05-22 Thread Thomas Lockhart
On 5/22/12 6:46 AM, Russell Keith-Magee wrote: ... We *will not* condone any attempt to use official Django forums as a way to circumvent copyright. Thanks Russell! - Tom -- You received this message because you are subscribed to the Google Groups "Django users" g

Re: Django GeoIP Module not found; can't remedy

2012-05-28 Thread Thomas Lockhart
... File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ctypes/__init__.py", line 353, in __init__ self._handle = _dlopen(self._name, mode) OSError: dlopen(/usr/local/lib/libGeoIP.dylib, 6): no suitable image found. Did find: /usr/local/lib/libGeoIP.dylib: mac

Re: How to use an optional ForeignKey to sites.Site and admin's "View on site"?

2012-05-29 Thread Thomas Lockhart
... Hi, I have a model which has a ForeignKey to the Django contrib sites.Site model. This field should be optional. If it is optional it is not a foreign key. You can put a constraint on the field to have a non-null value be present in the other table, and perhaps there is a way to do this

Re: how to tell apache to see my projects database file?

2012-05-30 Thread Thomas Lockhart
On 5/30/12 1:11 AM, doniyor wrote: hey man, problem solved. i did *chown www-data. . *then *chmod 777 dbfile *now everything is working fine. thank you so much for your time and help. I've lost track of the early parts of this thread, but chmod 777 on a database rarely indicates that everythin

Re: how to tell apache to see my projects database file?

2012-05-30 Thread Thomas Lockhart
schrieb Thomas: On 5/30/12 1:11 AM, doniyor wrote: hey man, problem solved. i did *chown www-data. . *then *chmod 777 dbfile *now everything is working fine. thank you so much for your time and help. I've lost track of the early parts of this thread, but chmod 777

Obtaining objects from a many-to-many relationship

2012-06-01 Thread Thomas Lockhart
I've got two models with one having a many-to-many relationship with the other: class A(models.Model): name = models.CharField("name") class B(models.Model): haveone = models.ManyToManyField(A) What is the idiom for getting all instances of A which are referenced in B? I found this works:

Re: Obtaining objects from a many-to-many relationship

2012-06-02 Thread Thomas Lockhart
tance of B). tia - Tom On Sat, Jun 2, 2012 at 12:36 AM, Thomas Lockhart mailto:tlockhart1...@gmail.com>> wrote: I've got two models with one having a many-to-many relationship with the other: class A(models.Model): name = models.CharField(&quo

Re: Django unsupported locale settings

2012-06-05 Thread Thomas Lockhart
On 6/5/12 4:06 AM, Mo Mughrabi wrote: I've been developing an application using Django for the past a year. The application was written in a Debian environment, the development and testing was entirely done in a debain machine. Recently, I decided to move the application to my local Mac OS X

Re: ForeignKey and Performance

2012-06-08 Thread Thomas Orozco
Why not use a lookup: TheA = ... TheCs = C.objects.filter(b__a = TheA) Le 8 juin 2012 15:01, "bo.schwarzst...@gmail.com" a écrit : > ** > Hi all, > > Is there any guideline about SQL performance ? > > For example, now we have 3 models, > > class A(Model): > ... > > class B(Model): > a = ForeignK

Re: Where are my posts?

2012-06-16 Thread Thomas Lockhart
On 6/16/12 2:35 PM, Laurence MacNeill wrote: How do I get privileges to post in this group? I've posted two questions, and have not seen them pop up yet... Who do I need to contact to get posting privileges? I really was hoping to get these questions answered soon. fwiw I've never seen my po

Re: Django on Mac OS X

2012-06-16 Thread Thomas Lockhart
On 6/16/12 9:41 PM, Moshe Voloshin wrote: I tried that too, but it didn't change anythin Tried what too? I've had good luck with python, virtualenv, and postgresql from MacPorts and then using virtualenv and pip to get psycopg2, django, etc. The library path from your error indicates that you

Making fields read-only after first save in admin

2012-06-18 Thread Thomas Weholt
I want to make a few foreignkey-fields read-only in the admin after the post is saved, ie when the change-form for that item is opened after the item has been saved the two foreignkeys in question should not be editable. In my case the user has to chose two foreignkeys when first adding an entry, b

Re: Oracle: blank, null, and empty_strings_allowed

2012-06-20 Thread Thomas Lockhart
On 6/20/12 3:33 AM, Melvyn Sopacua wrote: On 20-6-2012 0:49, André Pang wrote: The idea is to try to ensure that no empty strings make it to the database, so you're not allowed to insert them into the database. You can ensure this at the Django (ORM) layer right now with blank=True for the admin

Re: New to DJANGO

2012-06-21 Thread Thomas Lockhart
On 12-06-21 9:37 PM, LJ wrote: I started out learning Django using the "Writing your first Django app" article: https://docs.djangoproject.com/en/dev/intro/tutorial01/ This is a very well-written tutorial that goes through each part in detail. +1 anyone starting with Django is wasting time if t

How to render a modeladmin dynamically?

2012-06-22 Thread Thomas Weholt
using a custom template extending the normal change_list template. I cannot add these things to the modeladmin of the models in question, it has to be done at runtime. -- Mvh/Best regards, Thomas Weholt http://www.weholt.org -- You received this message because you are subscribed to the Google

Re: Creating permalink for blog tags that have the Post class as foreign key

2012-06-25 Thread Thomas Lockhart
On 12-06-24 7:18 PM, Matthew Meyer wrote: After making some changes debugging in the shell revealed, I have gotten it to work, thanks!!! So what was the solution??!!! - Tom -- You received this message because you are subscribed to the Google Groups "Django users" group. To po

Re: Custom SQL for creating django tables

2012-06-25 Thread Thomas Lockhart
On 12-06-25 1:35 AM, Mina Farid wrote: Hello guys, I am connection from django to Apache Derby. I am using IBM DB2 driver backend. Django tables are created in DB2 syntax, which is not very compatible with Derby. Is there any way that I can force django to customize the creation of SQL to a

Re: ForeignKey problem

2012-06-25 Thread Thomas Lockhart
On 12-06-25 10:02 AM, Adrian Bool wrote: On 25 Jun 2012, at 17:53, Soviet wrote: Thank you kind sir for your fast response, that worked brilliantly. Can I be cheeky and ask why does it work? :) Magic! ;-) The mechanism must involve deferred resolution of the second model by passing the model

Re: ManyToManyField is this right?

2012-06-27 Thread Thomas Lockhart
On 12-06-27 6:57 AM, David Wagner wrote: I'm a self taught programmer who hasn't done much of anything for years so please forgive me if this question is naive. I have a hard time sometimes understanding some of the lingo used by trained programmers. With that said, I'm having trouble wrappin

Re: ManyToManyField is this right?

2012-06-27 Thread Thomas Lockhart
On 12-06-27 8:02 AM, David Wagner wrote: Thanks for all the replies and I think I'm getting it now but it gets more complex too. So NRA Licenses is essentialy going to become a type of several certifications. For instance. NRA Instructor * Home Firearm Safety Instructor * Refuse to be a

Re: ManyToManyField is this right?

2012-06-27 Thread Thomas Lockhart
On 6/27/12 11:48 AM, David Wagner wrote: Looking at that I think I may need to add a foreignkey to cert_types relating to person since a person can have multiple certification types (NRA Instructor, CCL Instructor, etc). No. See below. On Wed, Jun 27, 2012 at 11:40 AM, David Wagner

Re: settings and constants on a reusable app

2012-06-29 Thread Thomas Rega
Am 28.06.12 17:30, schrieb Marc Aymerich: Hi, I'm developing a reusable application and I'm having troubles with constant values on settings. Imagine that the reusable application comes with the following settings.py # MY_APP/settings.py from django.conf import settings MY_CONSTANT = 'C1' MY_OT

Re: Upload a valid image. The file you uploaded was either not an image or a corrupted image.

2012-07-01 Thread Thomas Orozco
Do you have jpeg support installed for PIL? Le 1 juil. 2012 18:13, "Nikhil Verma" a écrit : > > Hi All > > I am trying to add jpeg image in a ImageField. and it gives this error . > It is not allowing me to save the image. > > I have installed PIL and image other utilities. > > Upload a valid ima

Re: Upload a valid image. The file you uploaded was either not an image or a corrupted image.

2012-07-01 Thread Thomas Orozco
all.py", > line 434, in easy_install > File > "/home/nikhil/Citysom/local/lib/python2.7/site-packages/setuptools-0.6c11-py2.7.egg/setuptools/package_index.py", > line 475, in fetch_distribution > > AttributeError: 'NoneType' object has no attribute

Re: Management form in Model Formsets

2012-07-01 Thread Thomas Orozco
You might want to check this snippet out: djangosnippets.org/snippets/1389*/ * Le 1 juil. 2012 06:27, "Knight Samar" a écrit : > Hi, > > I am using Django 1.2 and developing using Model formsets. Using > JavaScript, I am allowing the user to dynamically "Add another" formset on > the template, bu

Re: Upload a valid image. The file you uploaded was either not an image or a corrupted image.

2012-07-01 Thread Thomas Orozco
92 kB in 3s (57.9 kB/s) > Selecting previously deselected package libjpeg62-dev. > (Reading database ... 302567 files and directories currently installed.) > Unpacking libjpeg62-dev (from .../libjpeg62-dev_6b1-1ubuntu2_amd64.deb) ... > Setting up libjpeg62-dev (6b1-1ubuntu2) ... >

Re: Upload a valid image. The file you uploaded was either not an image or a corrupted image.

2012-07-01 Thread Thomas Orozco
ysom/lib/python2.7/site-packages/PIL/PIL-1.1.7-py2.7.egg-info >> changing mode of /home/nikhil/Citysom/bin/pilfont.py to 775 >> changing mode of /home/nikhil/Citysom/bin/pilfile.py to 775 >> >> >> changing mode of /home/nikhil/Citysom/bin/pilprint.py

Re: settings and constants on a reusable app

2012-07-01 Thread Thomas Orozco
ly using), which > defaults to False and which the project settings file can override to > True. > > On Fri, Jun 29, 2012 at 9:06 AM, Marc Aymerich > wrote: > > On Fri, Jun 29, 2012 at 11:08 AM, Thomas Rega wrote: > >> Am 28.06.12 17:30, schrieb Marc Aymerich:

Re: am new bird to django,need some suggestion...please please do reply friend..

2012-07-02 Thread Thomas Lockhart
On 7/2/12 10:38 AM, manish girdhar wrote: h i will try my best.actually i have already read that documentation but when i went to make application,then i got problem in using filter functions..and this kind of functions are not mentioned in the documentation.thats why i was facing

Re: Foreign Key needs quotes?

2012-07-02 Thread Thomas Lockhart
... So I wanted to know, which is the right way to go or it does not matter? I prefer without quotes for most cases. But for cases when a model is not yet defined (for example, you want to define a foreign key to a model which comes later in the source file) then you need to use the quotes to

Re: 1.4: Emails to BCC addresses not sent

2012-07-06 Thread Thomas Lockhart
... If that fails as well, I guess a ticket is in order, but like I said "works for me" (in version 1.4). If that doesn't fail, then make sure cco is filled. fwiw it works for me too in 1.4 using virtualenv. Thanks Melvyn for the simple example. - Tom -- You rec

Re: If using South, does it even matter what the underlying database is?

2012-07-06 Thread Thomas Lockhart
On 12-07-06 8:56 AM, Houmie wrote: Today I have started my first steps into postgresql, since its recommended by the Django team. I came across several issues, that I solved patiently one by one. (disclaimer: I'm a Postgres homer) These issues *should* come up with a well-designed database. 1)

Re: ForeignKey problem

2012-07-06 Thread Thomas Lockhart
On 12-07-06 10:14 AM, Soviet wrote: Thanks, but damn, isn't that overly complicated (for me). Using through looks like a easier way, but then I have to add Wheel four times and can't just type '4' in some field, since I don't need it to exist in database four time, just an information that ther

Re: Problem with DetailView

2012-07-08 Thread Thomas Orozco
Could you give us the fill error message displaying what ended up being passed to the view? Also, are you sure a car exists with the id / pk you're passing? Le 7 juil. 2012 23:10, "Soviet" a écrit : > But the ListView is working fine. And they don't use in the > documentation, just this, which

Re: how to use HTTPS with django

2012-07-08 Thread Thomas Orozco
This comes down to a simple middleware that intercepts http requests and redirects them to https. This is very to do in django. You can find plenty of such middleware on djangosnippets. Now, if your app is running behind a reverse proxy (e.g. nginx + gunicorn) , things get a little bit more comp

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