Re: Django call_command from Admin

2022-10-25 Thread Mike Oliver
Aziz, I had a similar need and I created my own middleware that checked the request path and did the call when I got a match. See https://docs.djangoproject.com/en/4.1/ref/middleware/ *Mike Oliver** Founder**, Open 4 Business Online* Tel: +1(951)260-0793 | Mobile:**NEW* 639479927462 US Toll

Re: Can an app subclass a core django class to channge its behavior

2022-08-24 Thread Mike Oliver
ervisor.ChutheIOMiddleware", > ] > > Think you should try by shell to make sure you can call it, or importable > `from mysite.mymiddleware import DoseControllerMiddleware`. Shell very > helpful. > On Thu, Aug 25, 2022 at 11:09 AM Mike Oliver < > mike

Re: Can an app subclass a core django class to channge its behavior

2022-08-24 Thread Mike Oliver
go.middleware.clickjacking.XFrameOptionsMiddleware', ] runserver gives me... ModuleNotFoundError: No module named 'mysite.mymiddleware' On Thursday, August 25, 2022 at 12:04:55 PM UTC+8 Mike Oliver wrote: > Well I have continued to search and now I see that CustomMiddleware will > d

Re: Can an app subclass a core django class to channge its behavior

2022-08-24 Thread Mike Oliver
uld you tell us more detail of process flow? > > On Wed, 24 Aug 2022 at 20:52 Mike Oliver < > mikeol...@open4businessonline.com> wrote: > >> Hello, >> >> I want to follow a microservices architecture and have some shared >> services I can include in

Can an app subclass a core django class to channge its behavior

2022-08-24 Thread Mike Oliver
Hello, I want to follow a microservices architecture and have some shared services I can include in a process flow instead of the 1:1 View:Model Suggestions? MO -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group

Re: System check takes so much? Bug?

2021-08-01 Thread Oliver Küchler
https://stackoverflow.com/questions/41438593/skip-system-checks-on-django-server-in-debug-mode-in-pycharm Oliver Küchler schrieb am Freitag, 30. Juli 2021 um 17:35:58 UTC+2: > I further worked on the topic, since I really want to solve it. > I figured out, that the SQL-queries are already perfo

Re: System check takes so much? Bug?

2021-07-30 Thread Oliver Küchler
minimal example see here: Question on StackOverFlow <https://stackoverflow.com/questions/68446241/djangos-performing-system-checks-takes-ages-with-postgresql> Oliver Küchler schrieb am Dienstag, 27. Juli 2021 um 16:20:29 UTC+2: > > Hey guys, > > I have already opened a questi

System check takes so much? Bug?

2021-07-27 Thread Oliver Küchler
Hey guys, I have already opened a question on StackOverflow, but so far nobody was able to help me out (link: StackOverflow-Link ). So I thought I'd give it a try in this

Using a custom AdminSite subclass

2020-04-02 Thread Oliver Kraitschy
" does not define a "HalAdminSite" attribute/class*Any hints about how I can fix this? That would be really appreciated!. Greetings Oliver -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this

AMQP Connection

2020-03-04 Thread Oliver Monaghan-Coombs
Hi all, We currently send an AMQP message to a RabbitMQ Broker if a certain condition is met during the request and response cycle. In order to send the message, we open a connection to the broker, send the message, then close the connection. This is clearly not as efficient as it could be, and I

Re: unexpected JSONField behavior clarification - key value pairs initially loaded integers, then saved down as strings into the database

2018-05-07 Thread Oliver Zhou
omething you have to watch out for since it can lead to data > loss. > > >>> import json > >>> test = {4: 5, '4': 'a'} > >>> json.loads(json.dumps(test)) > {'4': 5} > > On Apr 24, 2018, at 6:06 PM, Oliver Zhou > wr

Re: looking for the right way to work with JSONField - behavior inconsistent between strings and integers

2018-05-07 Thread Oliver Zhou
Thanks for the clarification -> although it seems like it should actually raise a warning or exception to prevent non-deterministic data errors when people aren't aware. Oliver On Tuesday, April 24, 2018 at 8:20:53 PM UTC-7, Simon Charette wrote: > > Hello Olivier, > > Si

unexpected JSONField behavior clarification - key value pairs initially loaded integers, then saved down as strings into the database

2018-04-24 Thread Oliver Zhou
load the model again - it seems uncertain which values actually got saved down - *whats the expectation here?* In [175]: reload_example3 = ExampleModel.objects.get(id=2) In [176]: reload_example3.external_ids Out[176]: {u'1234': {u'890': u'567'}} Thanks! Oliver

looking for the right way to work with JSONField - behavior inconsistent between strings and integers

2018-04-24 Thread Oliver Zhou
;1234': {u'567': u'890'}} *After I save and then reload the model, I'm unsure which value gets saved over. (Although in tests it seems like the newest data wins)* In [174]: reload_example2.save() In [175]: reload_example3 = ExampleModel.objects.get(id=2) In [176]:

GeoDjango distance lookup on Subquery: AttributeError: 'tuple' object has no attribute 'extend'

2017-07-30 Thread Oliver Eidel
Good evening, I'm having a problem doing a distance lookup on a Subquery. I always get an AttributeError (see above). Put simply, I have a table of Locations where a User may have many Locations (one-to-many). Now, I want to look up which users were close to a Point at a specific time, i.e., g

Re: Django code of conduct - last line

2015-05-08 Thread Graham Oliver
/08/2015 01:43 PM, Graham Oliver wrote: > > Thank you, so how about > > > > 'Don’t forget that it is human to err and blaming each other doesn’t get > > us anywhere. > > Instead, focus on helping to resolve issues and learning from mistakes' > &g

Re: Django code of conduct - last line

2015-05-08 Thread Graham Oliver
L. > > -- > let's build quiet armies friends, let's march on their glass > towers...let's build fallen cathedrals and make impractical plans > > - GYBE > > On 8 May 2015 at 12:51, Graham Oliver > > wrote: > >> Hello all >> Just readi

Django code of conduct - last line

2015-05-07 Thread Graham Oliver
Hello all Just reading the code of conduct https://www.djangoproject.com/conduct/ The last line goes like this 'Don’t forget that it is human to err and blaming each other doesn’t get us anywhere, rather offer to help resolving issues and to help learn from mistakes.' I don't really understand

Checking for foreign key in clean method - Django 1.77 vs 1.8

2015-04-16 Thread Graham Oliver
Hi guys I have some code in a clean() method that works ok on Django 1.77 but stops working in 1.8 The scenario class Span(models.Model): happening = models.ForeignKey('Happening', blank = True, null = True) soul_class = models.ForeignKey('SoulClass', blank = True, null = True)

Re: running template system standalone on django 1.7.1 results in AppRegistryNotReady error

2015-01-08 Thread Oliver Willekens
Found it. That template had {% load staticfiles %} in it, which cannot be used in this standalone context. Op donderdag 8 januari 2015 02:32:00 UTC+1 schreef Oliver Willekens: > > I'm running into a problem when I'm trying to use Django's template system > in

running template system standalone on django 1.7.1 results in AppRegistryNotReady error

2015-01-07 Thread Oliver Willekens
n/1.7/ref/templates/api/#configuring-the-template-system-in-standalone-mode>, I first configure the settings of Django and then call one of the template loaders. However, I get an AppRegistryNotReady error: In [1]: from django.conf import settings In [2]: settings.configure(**{'TEMPLATE_

Re: Generated migration blocks my application

2014-11-29 Thread Oliver Meinusch
Hi Markus, thanks for your answer. As stated, I already solved my problem. I am happy and can focus on my development :) Sorry, that I can not contribute any further investigation. Am Samstag, 29. November 2014 14:28:50 UTC+1 schrieb Markus Holtermann: > > Hey Oliver, > > Can you

Re: Generated migration blocks my application

2014-11-29 Thread Oliver Meinusch
I solved the problem by myself using the debugger to see there IS a recursion problem with dependecies. I created a migration file by my own which applies to fields to models which needs my first model. Now my problem is gone. -- You received this message because you are subscribed to the Goog

Generated migration blocks my application

2014-11-26 Thread Oliver Meinusch
Hello everybody, I am very big fan of Django. I found Django and Python after several years of php development and working with Python and Django feels like loosing all chains you have never known about ;) In my free time I am developing a web application and cms for my local theatre group. Bec

Re: AppConfig where to execute initialization queries?

2014-10-22 Thread Oliver George
Did you find a good solution for this? On Monday, October 6, 2014 11:56:15 PM UTC+11, Marc Aymerich wrote: > > Hi, > I have been bitten by unexpected behaviors when running tests because on > AppConfig.ready() I was initializing some stuff that depends on DB stored > data. Reading the django doc

How to delete a referenced object when the object, referencing the other object, is deleted?

2014-08-20 Thread Oliver Funk
I posted the following question on SO (link ) and I haven't received any helpful answers. Can someone here please help me? I am relatively new to Django and I'm just starting to get a feel for it, but

Re: Custom model fields not working?

2013-08-06 Thread Oliver Beattie
and I really can't >> figure out why I keep getting errors. My code for my fields module is >> at http://dpaste.com/hold/27712/ >> >> When I try to run syncdb on a model which uses the PickledObjectField >> (see my sample model at http://dpaste.com/hold/27713/)**

script folder

2013-07-27 Thread Oliver
I'm running Windows 8.1 and following this tutorial http://www.youtube.com/watch?v=NqNNuXwi0eI I'm missing the script folder in Python33 folder so I can't find django-admin.py. However, I can start project and it build a project. I'm using djangostack-1.5.1-0. -- You received this message b

Re: server error (500)

2013-07-25 Thread Oliver
Jul 25, 2013 at 2:32 PM, Oliver > > wrote: > > I change the ALLOWED_host = ['*']. Now I'm getting this "Not Found > the > > requested URL / not found on the server" > > Yes. You will need to add some views and URLs to the server if you >

Re: server error (500)

2013-07-25 Thread Oliver
I change the ALLOWED_host = ['*']. Now I'm getting this "Not Found the requested URL / not found on the server" On Thursday, July 25, 2013 8:19:13 AM UTC-4, Oliver wrote: > > when you change Debug=False > > > > > On Thursday, July 25, 20

Re: server error (500)

2013-07-25 Thread Oliver
I did allowed host to 0.0.0.0. It's back to server error(500) On Thursday, July 25, 2013 9:32:45 AM UTC-4, Christian Erhardt wrote: > > Set Allowed Hosts to 0.0.0.0 > > Am Donnerstag, 25. Juli 2013 14:19:13 UTC+2 schrieb Oliver: >> >> when you change Debug=False >

Re: server error (500)

2013-07-25 Thread Oliver
when you change Debug=False On Thursday, July 25, 2013 8:12:14 AM UTC-4, victoria wrote: > > The error log doesn't show anything. In which step following the > documentation are you getting this error? > > On Thu, Jul 25, 2013 at 12:09 PM, Oliver > > wrote: &

Re: server error (500)

2013-07-25 Thread Oliver
ou app there in production or development? > Em 25/07/2013 04:35, "victoria" > > escreveu: > > > > Hi, > > > > On Thu, Jul 25, 2013 at 4:30 AM, Oliver > > wrote: > > > If I set DEBUG = False, I get this > > > > > > It worked

Re: server error (500)

2013-07-25 Thread Oliver
Hi Victoria, attached is my the error log from the apache2 Thanks On Thursday, July 25, 2013 3:35:00 AM UTC-4, victoria wrote: > > Hi, > > On Thu, Jul 25, 2013 at 4:30 AM, Oliver > > wrote: > > If I set DEBUG = False, I get this > > > > It worke

server error (500)

2013-07-24 Thread Oliver
*If I set DEBUG = False, I get this* It worked!Congratulations on your first Django-powered page. Of course, you haven't actually done any work yet. Here's what to do next: - If you plan to use a database, edit the DATABASES setting in mysite/settings.py. - Start your first app by runn

Re: Can´t get Django Administration page to show

2013-06-05 Thread Oliver Hilmarsson
Thanks, Sithu, I didn´t uncomment the lines in urls.py. It´s working now :o) Regards, Óliver On Wednesday, June 5, 2013 11:47:49 AM UTC, Oliver Hilmarsson wrote: > > I´m finished part 1 in django tutorial > https://docs.djangoproject.com/en/dev/intro/tutorial01/ > > Everythi

Can´t get Django Administration page to show

2013-06-05 Thread Oliver Hilmarsson
I´m finished part 1 in django tutorial https://docs.djangoproject.com/en/dev/intro/tutorial01/ Everything worked great, but starting in part 2 I can´t get the admin page to show up. I always just get the initial "It worked! Congratulations on your first Django-powered page" page when I go to

Django doesn't serve staticfiles

2012-12-25 Thread Oliver Schmidt
I use the django-less app to compile lesscss files to css. The compiled files are cached and stored into the folder LESS_CACHE in my staticfiles folder. And these files aren't served (404) while evrything else (other static files) are served. I use the dajngo development server. My project: https

Re: Weird Problem: Template Shows Templatevariable's Name Instead Of It's Value

2011-08-14 Thread Oliver Schmidt
Thank you very much!! I know my code needs to be tidied up xD. I'vd tried many things to solve the problem that's why my code looks so awful. And I'm glad there is an easy solution for my problem (and I didn't saw it *wall*) And @bruno desthuilliers: It's good for a newbie like me to see how ot

Problem with relationships in models

2011-07-21 Thread Oliver Schmidt
I'm trying to write my first django app, so maybe my problem is stupid. But I have problems in using relationships in my models. My models.py looks like this: # -*- coding: utf-8 -*- from django.db import models from django.contrib.auth.models import User import datetime class Ka

Re: How can I force a browser to cache my view?

2011-04-27 Thread Oliver Andrich
Hi Javier, 2011/4/27 Javier Guerra Giraldez > On Wed, Apr 27, 2011 at 10:48 AM, Oliver Andrich > wrote: > > So, I was looking into possible solutions. As you can't download anything > > via ajax directly, you have to trick the browser into caching it and then > >

Re: How can I force a browser to cache my view?

2011-04-27 Thread Oliver Andrich
file or attachment. > Already tried it, and it hasn't worked at all. Best regards, Oliver -- 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 from th

How can I force a browser to cache my view?

2011-04-27 Thread Oliver Andrich
s not cashed at call. The caching even doesn't if I open the url in the browser directly. Can I force the browser to cache my data? Best regards, Oliver My Django view: @login_required @redweb_view @last_modified(last_modified_func) def show_pdf(request, page_id, quality): page = Pa

Struggling with aggregation/annotation

2010-11-02 Thread Oliver Andrich
AND topic.trashed_at = video.trashed_at''', }) Selecting a topic instance or a list of topic instances I also want to know the amount of images associated with the topic, which share the same value for trashed_at. Can this be written using the annotate method and t

Creating a common URL prefix?

2010-10-25 Thread Oliver Beattie
lly hoping I've missed something obvious :) Any help would be really appreciated. —Oliver -- 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 grou

Reponse code for a require_XHR decorator?

2010-10-12 Thread Oliver Andrich
, **kwargs) return wrapper But the question is, is Bad Request (HTTP Status Code 400) the best choice? Which response code do you use in such a situation? Best regards, Oliver -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to

Re: Need help in serialization of objects.

2010-02-23 Thread Oliver Beattie
I'm not entirely sure why you'd want to do this, but I'm sure you have your reasons. Probably the best way would be to write your own serializer, which subclasses Django's XML serializer (in django.core.serializers.xml_serializer), and overrides the start_serialization and end_serialization methods

Re: {{ form.as_table }} not displaying in template

2009-12-13 Thread oliver
Sounds like you are not creating the form in your view .. read the tutorial the part about creating a form .. you need the form class, and the view that process your form (a) creates an empty form b) process the submitted one) see this relative simple example of a login form .. class userLoginFor

Get the user inside a form class

2009-05-25 Thread Oliver Zheng
other recourse do I have in accomplishing this? PS. How do I set a value inside a form's save() function anyway? When there's an instance, it's just self.instance.field = value, but when it's submitted unbound, there is no in

settings.LOGIN_URL not redirecting properly

2009-05-13 Thread Oliver Zheng
There is really weird. I noticed that all urls without a slash / at the end redirect to the url with a slash. Thus, users/logout becomes users/logout/. Okay. Now I made a users/login. It works great. I wanted Django to redirect to it for login_required, so I set LOGIN_URL to "users/login". Now, a

Re: Switching database backends at runtime?

2009-03-17 Thread Oliver Beattie
Nope, seems this is actually impossible (at least using manage.py shell), since it will load all of the models and hold references to them on initialization until termination, so the settings-definte backend is tied to BaseQuery forever :( On Mar 17, 12:01 pm, Oliver Beattie wrote: > Thanks

Re: Poll Tutorial regarding __unicode__

2009-03-17 Thread Oliver Beattie
You're probably using the tutorial for the development (trunk) version of Django, but you're running 1.0.x — you should be following this tutorial: http://docs.djangoproject.com/en/1.0//intro/tutorial02/#activate-the-admin-site On Mar 17, 1:21 pm, TP wrote: > I have fixed this error: > > now wh

Re: Poll Tutorial regarding __unicode__

2009-03-17 Thread Oliver Beattie
Below that there will be an error. I'm guessing it may be a SyntaxError or NameError, since it looks like you have python after 'mysite.polls' (probably by accident) — that is if that traceback is right. On Mar 17, 12:36 pm, TP wrote: > This relates to the first tutorial on django project. > My

Re: Poll Tutorial regarding __unicode__

2009-03-17 Thread Oliver Beattie
__unicode__ is called when unicode(ModelInstance) is called. __str__ is called when str(ModelInstance) is called. Internally, if you only define __unicode__, then Django will provide __str__ for you (see http://code.djangoproject.com/browser/django/trunk/django/db/models/base.py#L277 for the nit

Re: Switching database backends at runtime?

2009-03-17 Thread Oliver Beattie
way. I'm sadly bound to using the release version of Django… so will this apply? On Mar 16, 10:25 pm, Alex Gaynor wrote: > On Mon, Mar 16, 2009 at 6:20 PM, Oliver Beattie wrote: > > > Does anyone know if it's possible to switch the database backend in > > Django at

Switching database backends at runtime?

2009-03-16 Thread Oliver Beattie
Does anyone know if it's possible to switch the database backend in Django at runtime (let's say I want to use dummy for something, but then switch it back to the original after I'm done). Is this possible using django.db.load_backend or something (I'm doubting it as I see there is some module-le

Re: ContentTypes and fixtures

2009-01-30 Thread Oliver Beattie
> Oliver, meet ticket #7052. Ticket #7052, meet Oliver :-)\ Thanking you, I'm not as familiar with the tickets as I should be =) > The best workaround that I can suggest is to include your ContentTypes > in your fixtures. They are dumpable objects, just like everything else > i

ContentTypes and fixtures

2009-01-28 Thread Oliver Beattie
w can I be sure that the ContentType IDs are always constant, and therefore my data in fixtures is guaranteed to always point to the right object? Any help would be greatly appreciated! —Oliver --~--~-~--~~~---~--~~ You received this message because you are subscri

Re: Django + mail server

2008-12-15 Thread Oliver Beattie
http://docs.djangoproject.com/en/dev/ref/settings/#email-host On Dec 15, 7:25 pm, prem1er wrote: > Didn't know about this. Where do I set the EMAIL_HOST parameter? > > On Dec 15, 1:35 pm, "Karen Tracey" wrote: > > > > > On Mon, Dec 15, 2008 at 1:01 PM, prem1er wrote: > > > > Hey everyone, > >

Re: Difference between sqlite3 and mysql backend on test code involving generic relationships

2008-09-25 Thread Oliver Andrich
Well, it seems to happen, when the post_syncdb signal code from django.contrib.auth is called. Somehow calling the code from ./manage.py test differes from ./manage.py flush. I think I will reproduce this in a minimal django project and try file a bug report. Best regards, Oliver -- Oliver

Re: Difference between sqlite3 and mysql backend on test code involving generic relationships

2008-09-25 Thread Oliver Andrich
so have to note, that DocumentTests includes 3 tests - the first always works while the later two always fail. But it is not depend on the test itself, but simply on the order of the tests in the test case. Bye, Oliver -- Oliver Andrich <[EMAIL PROTECTED]> --- http://o

Difference between sqlite3 and mysql backend on test code involving generic relationships

2008-09-25 Thread Oliver Andrich
In sqlite3 this works like a charm. Can anybody drop me a helpful tip? The app itself works like expected, but I would appreciate to have working testcode. :) Best regards, Oliver -- Oliver Andrich <[EMAIL PROTECTED]> --- http://oliverandrich.net/ --~--~-~--~~~

Question admin area and logging of changes of models

2008-07-20 Thread Oliver Andrich
Hi, I have currently the desire to use the logging support from the admin app in my own app. This step is solved. But how does the app accomplish the task to determine which fields have changed on the given instance. Is there an easy way to achieve that in my own app? Best regards, Oliver

Re: Images in MySQL

2008-07-14 Thread Oliver Andrich
with storing images in your filesystem and serving them from a seperate http server. Hopefully, I haven't told you something you already know and have already considered. Best regards, Oliver Am 14.07.2008 um 16:41 schrieb lukeqsee: > > I know you can store images in a BLOB fie

Re: Error in latest SVN "multipartparser.py", think it is a bug ..

2008-07-09 Thread oliver
Karen, thanks for that. Yes it is the same bug. I tried the fix and it solved the issue. Not sure how "nice" the fix is yet but it makes the SVN work for this project again. o On Jul 9, 3:04 pm, "Karen Tracey" <[EMAIL PROTECTED]> wrote: > On Wed, Jul 9, 20

Re: how to log in automaticly

2008-07-09 Thread oliver
Hi, just do this after the "registration" part is completed http://www.djangoproject.com/documentation/authentication/#how-to-log-a-user-in On Jul 9, 7:15 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > i am using registration module from google, does anyone know how to > log in automati

Re: Error in latest SVN "multipartparser.py", think it is a bug ..

2008-07-09 Thread oliver
one more note, I was not uploading a new file. just re-saving the object. On Jul 9, 1:31 pm, oliver <[EMAIL PROTECTED]> wrote: > Hi, > > I get this odd error:http://dpaste.com/61580/ > > "SuspiciousOperation: The multipart parser got stuck, which shouldn't >

Error in latest SVN "multipartparser.py", think it is a bug ..

2008-07-09 Thread oliver
Hi, I get this odd error: http://dpaste.com/61580/ "SuspiciousOperation: The multipart parser got stuck, which shouldn't happen with normal uploaded files. Check for malicious upload activity; if there is none, report this to the Django developers." This started happening only since I updated m

Re: Django HTML Editor

2008-06-14 Thread oliver
Hi, I can really recommend e-editor (text mate clone for windows), uses the same textmate bundles so it knows django and django html. light weight and quick and good support. http://www.e-texteditor.com/ On Jun 14, 7:36 am, Ngu Soon Hui <[EMAIL PROTECTED]> wrote: > Forgot to mention, it would be

Re: very odd MySQL 'ascii' code error in MySQLdb/connections.py

2008-06-07 Thread oliver
Thanks for that. We kind of worked around it but it does still pop up randomly which is very odd! Will keep an eye on it! thanks again. On Jun 6, 7:55 pm, Ole Laursen <[EMAIL PROTECTED]> wrote: > I think it's this bug: > > http://code.djangoproject.com/ticket/6052 > > Nasty fellow. > > -- > Ole

Re: Can Someone Do something about ALL THIS SPAM

2008-06-05 Thread oliver
There is a little "more options" link .. has a "report this message" option in there. You might need to be registered thou. I find it easier using the "bulk" email as you just get the headers and can quite easy skip the spam with out getting every message in your inbox. On Jun 5, 8:54 pm, "[EMAIL

manytomanyfield unique ??

2008-05-27 Thread oliver
hi, i am trying create a unique manytomanyfield in my module, as I need to some how manage to only create one object with a given selection of m2m relations. Unique together doesn't work on the m2m field. i am not to sure how to approche this, if doing some custom save function which checks if a

Re: moving from MySQL to PostgreSQL on a "live" site ..

2008-05-20 Thread oliver
Thanks for all the advice! I think django could probably do with a little tool like this when dumping or importing data. Is the boolean field the only odd one out? or is there any thing else that needs chanaging? Date fields? datetime? Thanks again! On May 20, 12:54 pm, George Vilches <[EMAIL P

Re: moving from MySQL to PostgreSQL on a "live" site ..

2008-05-20 Thread oliver
some tweaking with your db (like adding, removing models) > > On May 19, 1:41 am, oliver <[EMAIL PROTECTED]> wrote: > > > Hi, > > I am planning to move from Mysql to PostgreSQL (mainly for transaction > > support). I just wanted to know if I can take my active dja

moving from MySQL to PostgreSQL on a "live" site ..

2008-05-19 Thread oliver
Hi, I am planning to move from Mysql to PostgreSQL (mainly for transaction support). I just wanted to know if I can take my active django projects (all with lots of data in mysql, with more or less every model field type possible) and do a XML data dump and than just load this into the Postgresql

Re: dynamic default values for Forms

2008-05-12 Thread oliver
I do it like this: def frommagic(request): if request.POST: process form else: from = MyForm(initial={'user_name': 'John Doe' }) works well in our quite complex 6 step booking form .. On May 12, 9:37 pm, Mike Chambers <[EMAIL PROTECTED]> wrote: > I have a project where I need to dyn

Re: very odd MySQL 'ascii' code error in MySQLdb/connections.py

2008-05-09 Thread oliver
email/#e-mail-messages > > On May 8, 3:26 am, oliver <[EMAIL PROTECTED]> wrote: > > > we use thishttp://www.djangosnippets.org/snippets/285/asa base and > > made it work for us. templates are stored in the database so our users > > can "edit" the html em

Re: very odd MySQL 'ascii' code error in MySQLdb/connections.py

2008-05-07 Thread oliver
ii/unicode errors by the looks of it. you can see most of the code for this in the dpast link in my 1st message On 7 May, 13:23, Kenneth Gonsalves <[EMAIL PROTECTED]> wrote: > On 07-May-08, at 12:49 PM, oliver wrote: > > > Now this all works fine till I get a non English PC using

Re: very odd MySQL 'ascii' code error in MySQLdb/connections.py

2008-05-07 Thread oliver
eed to be encoded to > UTF-8 first, e.g: "A string".encode('utf-8') > > Julien > > On May 7, 5:21 pm, oliver <[EMAIL PROTECTED]> wrote: > > > as an extra note, all Tables and Fields involved in this are set to > > Utf8 / unicode. > > >

Re: very odd MySQL 'ascii' code error in MySQLdb/connections.py

2008-05-07 Thread oliver
as an extra note, all Tables and Fields involved in this are set to Utf8 / unicode. On 7 May, 08:19, oliver <[EMAIL PROTECTED]> wrote: > Hi, > > I am building a fairly large website but I have come a cross one very > odd error. > We build a simple email record model that

very odd MySQL 'ascii' code error in MySQLdb/connections.py

2008-05-07 Thread oliver
Hi, I am building a fairly large website but I have come a cross one very odd error. We build a simple email record model that has a custom def save() function which when called creates a new Record and fires of the email(s). Now this all works fine till I get a non English PC using this (the err

Re: Auto fill the form field???

2008-04-23 Thread oliver
This will get you started. The JS and the views needed are pretty easy. http://www.willarson.com/blog/?p=37 On Apr 23, 8:42 am, laspal <[EMAIL PROTECTED]> wrote: > Hi, > I have a form with the following field. > > 1)Title > 2)Descriptions > 3) No of person > 3) Drop down box containing the prev

Re: Migration from Linux to Windows Setup

2008-04-17 Thread oliver
restrictive on directories so it should be easy to get the "uploading" to work. I develop on Windows, but host on linux. (using svn you keep the live system up to date). The main issue will be running your project via IIS (never done it so dont know). oliver On Apr 17, 2:06 pm, shocks

Re: newforms initial value

2008-04-09 Thread oliver
Hi, this is how we do it, when you initial the Form object, you can add "inital" values". ignore the request.session in there that isjust where we stored values if the user goes back and forth in multiple forms. the 1st '' part is the form element. form = BookingFormOne(initial={

Re: Creating Custom Admin Views

2008-04-01 Thread oliver
e the source code you copied from the django admin? I > also looked into the django-admin source code, but I hadn't enough time > to look deeper into this topic. > > Is there a possibility in newforms-admin to solve this problem? > > On Tue, 2008-04-01 at 07:13 -0700, oliver

Re: Really strange Newforms issue with Initial data.

2008-04-01 Thread oliver
s, read the > documentation:http://www.djangoproject.com/documentation/newforms/ > > What you are trying to accomplish, if you properly implement NewForms > and request sessions, should be much cleaner and more simple. > > On Tue, Apr 1, 2008 at 10:29 AM, oliver <[EMAIL PROT

Re: Really strange Newforms issue with Initial data.

2008-04-01 Thread oliver
my way is not doing it right. On Apr 1, 3:09 pm, oliver <[EMAIL PROTECTED]> wrote: > Hi, > > I have this very wired problem and I just can not figure out why it is > happening. > Newfroms seem to not send the "initial" value for a field on the 1st > load of the

Re: Creating Custom Admin Views

2008-04-01 Thread oliver
have you found any answers to this? as i am trying to do the same thing, I just want to change the data set that is send to the default template. I have been looking in the srouce code and am trying to copy what django admin does into my custom view, but it would be nice if there was an easier way

Really strange Newforms issue with Initial data.

2008-04-01 Thread oliver
Hi, I have this very wired problem and I just can not figure out why it is happening. Newfroms seem to not send the "initial" value for a field on the 1st load of the view. This is the code: http://dpaste.com/42561/ its "just" a form and a view that calls the form. The problem lies with addin

Re: Django CSS

2008-02-15 Thread oliver
Thought this might help some. I have it setup so my vhost takes care of static data (which i think is the best option, or using a 2nd sever for serving static media) My settings stuff: MEDIA_ROOT = '/web/PROJECT/media/' <- change "PROJECT" MEDIA_URL = '/' ADMIN_MEDIA_PREFIX = '/admin-media/' <

Can't seem to get Q objects to work as I'd like...

2008-02-08 Thread Oliver Beattie
nyone. I'm running out of ideas of what to try next. Can anyone help me? Is there another way I could go about this? Any help would be appreciated immensely, Oliver --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups

Re: MacOS X Leopard + mod_pyton + mysql problems

2007-12-27 Thread Oliver Beattie
the other architectures). Then you should be able to run setup.py install with no problems. *Phew!* On Dec 27, 9:07 am, Oliver Beattie <[EMAIL PROTECTED]> wrote: > I have compiled it for > 64-bit:http://farm3.static.flickr.com/2013/2140077639_7abe03b5fb_o.gif > > Yet I still

Re: MacOS X Leopard + mod_pyton + mysql problems

2007-12-27 Thread Oliver Beattie
ROTECTED]> wrote: > On Dec 27, 9:49 am, Oliver Beattie <[EMAIL PROTECTED]> wrote: > > > Did anyone ever get this working, I am tearing my hair out here trying > > to figure it out; I finally get it to build and now I'm getting:- > > > ImproperlyConfigur

Re: Passing a dictionary as a query argument?

2007-12-27 Thread Oliver Beattie
I think the pickle modules guarantee that both pickle and cPickle will be able to read each other's pickles, but that's about it. Aside from unpickling every database object on every database query, though, I see no other alternative (aisde from writing my own pickle module [eek]). And thanks for

Re: MacOS X Leopard + mod_pyton + mysql problems

2007-12-26 Thread Oliver Beattie
Did anyone ever get this working, I am tearing my hair out here trying to figure it out; I finally get it to build and now I'm getting:- ImproperlyConfigured: Error loading MySQLdb module: dlopen(/Library/ WebServer/.python-eggs/MySQL_python-1.2.2-py2.5-macosx-10.5-i386.egg- tmp/_mysql.so, 2): no

Re: How to implement a search box for my website?

2007-11-04 Thread oliver
You probably want to use "Complex lookups with Q objects" (http:// www.djangoproject.com/documentation/db-api/) here is how i use it on a site: from django.db.models import Q query = Q() for term in request.GET['area'].split(' '): q = Q(city__icontains = term) \

Re: RegexField and Admin interface

2007-10-10 Thread oliver
@ Nader : i think you got it, just give it a try! if it doesnt work django will tell you anyway ;) You define a function that gets called on validation of the field is the very abstract view of it as i understand it. On Oct 10, 6:34 pm, Tim Chase <[EMAIL PROTECTED]> wrote: > > class Property(mo

Re: RegexField and Admin interface

2007-10-10 Thread oliver
Regex is done via a custom validator. works pretty simple. here is an example how i use to check if the entered data is a correct UK postcode (zip code) from django.core import validators you might need to import some thing else as well (import datetime, random, sha, re, os, Image, urllib thats

Re: Random objects in view

2007-10-02 Thread oliver
This works for me. My model: class BannerPosition(models.Model): position = models.SmallIntegerField() banner = models.ForeignKey(BannerItem) class Meta: ordering = ('position', 'banner') def __str__(self): return '%s - %s' % (self.ba

Re: Spawning long processes

2007-07-05 Thread Oliver Charles
Ahhh, I got it now - Thanks so much Simon! The problem was I had left out close_fds, so it was still spawning as a child process I think. With close_fds it works a treat - thank you once again :D - Ollie On Jul 5, 3:18 pm, Simon Drabble <[EMAIL PROTECTED]> wrote: > On Thu, 5 Jul 200

  1   2   >