Adding 'Select Any' to selects generated for forms

2008-12-24 Thread phoebebright
I want to have a popups in a search form that have an additional item 'Select Any'. Having trawled the internet I can't find any examples other than using jquery and I'm sure this must be possible in django. Any pointers very welcome. MODEL - simplified === TRANSMISSION_CHOICES = (

Using ModelChoiceField with query set - no error but no list either

2008-12-31 Thread phoebebright
I have a model that has a car and a car has a foreign key to carmodel via the field model (too many models!) This is the line for the form which appears to run: carmodel=forms.ModelChoiceField(queryset=Car.objects.all().values ('model','model__name').distinct() ) It generates the correct SQL

Re: Using ModelChoiceField with query set - no error but no list either

2008-12-31 Thread phoebebright
Thanks that makes sense. I'll give it go. Happy New Years --~--~-~--~~~---~--~~ 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: Comma or Currency formats

2009-01-03 Thread phoebebright
On Jan 2, 7:06 pm, Shay Ben Dov wrote: > Hi, > > I'm using GAE and wondering how come there is no comma insertion > orcurrencyformating of floating numbers like: > > {{ value|floatformat:2 }} built_in filter > > Shay You could try

Re: How to populate a form field with a Select widget

2009-01-03 Thread phoebebright
Following on from this example, I am trying to use values from a table to populate a choicefield (and been at it for 2 days trying every method I can find in google) Clearly from the output below, I am creating the wrong kind of data type, but don't know how to change it: THIS VERSION

Newbie: Help to understand string handling

2009-01-06 Thread phoebebright
As a newbie to both python and django (ex PHP) I am not clear on when I can use python functions and when I can't. I want to do some simple string handling in a view, search and replace for example, but can't find anything in the documentation. I assume this means that I can use python string

Re: Newbie: Help to understand string handling

2009-01-06 Thread phoebebright
Yes. Django is just Python > > On Tue, Jan 6, 2009 at 11:14 PM, phoebebright <phoebebri...@spamcop.net> > wrote: > > > As a newbie to both python and django (ex PHP) I am not clear on when > > I can use python functions and when I can't. > > > I want to do

Re: Newbie: Help to understand string handling

2009-01-06 Thread phoebebright
> On Tue, Jan 6, 2009 at 16:49, Jeff Anderson <jeffe...@programmerq.net> wrote: > > phoebebright wrote: > >> Thanks for your response. Do you think a working knowledge of python > >> is essential for django then?  And do I import modules the same in > >>

Re: How to populate a form field with a Select widget

2009-01-07 Thread phoebebright
)) fuels = forms.ChoiceField(choices=fuel_choices) On Jan 3, 9:38 pm, phoebebright <phoebebri...@spamcop.net> wrote: > Following on from this example, I am trying to use values from a table > to populate a choicefield (and been at it for 2 days trying every > method I can

Re: How to populate a form field with a Select widget

2009-01-07 Thread phoebebright
Ahh yes, much more elegant. Thanks. On Jan 7, 11:32 am, bruno desthuilliers <bruno.desthuilli...@gmail.com> wrote: > On 7 jan, 11:38, phoebebright <phoebebri...@spamcop.net> wrote: > > > Finally got it working - and I'm sure there is a much clear way of > > do

Re: best way to do tabs?

2009-01-08 Thread phoebebright
I'm a great fan of YUI and they have some nice tabs that are easy to implement. Just google YUI. On Jan 8, 10:03 am, Matias Surdi wrote: > JQuery UI? > > Margie escribió: > > > Hi, > > > This is not a directly a django question, but since django is the only > > web

Re: best way to do tabs?

2009-01-08 Thread phoebebright
I guess google has reached the status of hoover and tarmac! On Jan 8, 10:25 am, Matias Surdi <matiassu...@gmail.com> wrote: >  > implement.  Just google YUI. > Shoudn't it have been "yahoo for YUI" ? > > :-D > > phoebebright escribió: > > > I'm a

Do Mysql Views and Django work together?

2009-01-17 Thread phoebebright
I say an earlier post that seemed to imply they did. I created a view in an existing db and wrote a model test to match it so syncdb works fine. But when I try to import it I get: ViewDoesNotExist: Could not import todo.views. Error was: cannot import name test The ability to use views would

Re: Do Mysql Views and Django work together?

2009-01-17 Thread phoebebright
:14 -0800, phoebebright wrote: > > I say an earlier post that seemed to imply they did. > > > I created a view in an existing db and wrote a model test to match it > > so syncdb works fine. > > Hm ... it just occurred to me: whilst running syncdb probably works if > y

Re: how to enforce uniqueness

2009-01-18 Thread phoebebright
Maybe this would help? http://docs.djangoproject.com/en/dev/ref/models/options/#unique-together On Jan 18, 10:40 am, Konstantin wrote: > Hello! > > First of all I want to apologize for maybe very basic question, but I > newbie in django and web coming from c/c++ world. >

Best practise for using settings in templates

2009-01-18 Thread phoebebright
What is best practise if you want to use a variable defined in settings.py in a template? Pass it in via the view or call it directly in the template? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users"

Re: Best practise for using settings in templates

2009-01-18 Thread phoebebright
Thanks - learning more every day! On Jan 18, 11:37 am, Malcolm Tredinnick <malc...@pointy-stick.com> wrote: > On Sun, 2009-01-18 at 03:26 -0800, phoebebright wrote: > > What is best practise if you want to use a variable defined in > > settings.py in a template? > &

Re: Do Mysql Views and Django work together?

2009-01-18 Thread phoebebright
Got django reading the view ok. Potential problem where table uses two fields as a primary key - don't think django likes this, but think I can use a view to get around this one too. On Jan 17, 1:59 pm, phoebebright <phoebebri...@spamcop.net> wrote: > That sounds like a very usefu

Possible to see sql for queryset before database gets it?

2009-01-18 Thread phoebebright
I have a problem with the sql being generated by this: tasks = Task.objects.filter(status='open').order_by('-priority') tasks = tasks.extra(where=['list IN %s'], params= [settings.MY_LISTS]) Is there a command where I can say something like 'print tasks.sql' that would generate the sql

Re: Blueprint css versus YUI grids versus ?

2009-01-18 Thread phoebebright
Thanks for the tip on blueprint. I'm going to give it a go. Been using YUI and keen to find something to ween a designer off of tables within tables within tables within tables etc. YUI just not easy enough to explain and use and had to take it out of last development. On Jan 17, 9:34 pm, a b

Re: Possible to see sql for queryset before database gets it?

2009-01-19 Thread phoebebright
Thanks for those tips. Great help. On Jan 19, 12:37 am, Malcolm Tredinnick wrote: > On Sun, 2009-01-18 at 17:46 -0200, Ramiro Morales wrote: > > [] > > > > > or if you are using a recent trunk version (more recent than two weeks or > > so) > > you might want to

Odd problem with date based generic views

2009-01-19 Thread phoebebright
Generic view - year_archive, is not working for me. There are no errors displayed and no data either. On investigation, there seems to be a mysql error that is causing the problem and it could be related to the my using a view instead of a table as the source for the mode. The original date

Re: Odd problem with date based generic views

2009-01-19 Thread phoebebright
Just going to transfer the view into a real table. Will let you know if that doesn't solve the problem! On Jan 19, 12:57 pm, Malcolm Tredinnick <malc...@pointy-stick.com> wrote: > On Mon, 2009-01-19 at 04:38 -0800, phoebebright wrote: > > Generic view - year_archive, is not

Re: Recommendation on understanding CSS

2009-01-22 Thread phoebebright
If you have a Mac I recommend CSSEdit which allows you to analyse the css that applies to each element on a page (locally or online) and changes show immediately. On Jan 21, 8:52 am, Gath wrote: > Guys, > > Its seems the best way to do templates in Django is via plain html

Confused by error messages

2009-01-22 Thread phoebebright
I managed to set debug to false and spend an hour trying to understand this error: File "/Library/Frameworks/Python.framework/Versions/2.5/lib/ python2.5/site-packages/django/template/defaulttags.py", line 880, in load (taglib, e)) TemplateSyntaxError: 'openid_tags' is not a valid tag

Refresh Queryset - I know the answer is there somewhere

2009-01-23 Thread phoebebright
Have been reluctant to post on this one as have come across many many discussion during the 3 days of lack of success on resolving this issue, but none has left me with a solution. I have a form with a dropdown generated from a query. This is in the form: carmake =

Re: Refresh Queryset - I know the answer is there somewhere

2009-01-23 Thread phoebebright
ine form `__init__` and manually reassign choices to given > field every time form is created. > > def __init__(self, *args, **kwargs): >    super(MyForm, self).__init__(*args, **kwargs) >    self.fields['carmake'].choices = Carmake.get_makelist() > > On Fri, Jan 23, 2009 at

Model fails in shell but not in runserver - IndexError: list index out of range

2009-01-26 Thread phoebebright
Am I blind? I am getting this error in the shell, but no obvious errors when using the browser interface. >>> from models import Business Traceback (most recent call last): File "", line 1, in ? File "/home/django/towns/models.py", line 8, in ? class Category(models.Model): File

Re: Model fails in shell but not in runserver - IndexError: list index out of range

2009-01-26 Thread phoebebright
Karen, Yes have models in same directory as settings - bad girl! Thanks. Phoebe. On Jan 26, 1:37 pm, Karen Tracey <kmtra...@gmail.com> wrote: > On Mon, Jan 26, 2009 at 8:03 AM, phoebebright > <phoebebright...@gmail.com>wrote: > > > > > > > Am

Custom Template Tag - Passing variable for use in tag processing

2009-01-27 Thread phoebebright
I have duplicated as best I can the processing for handling variables in custom template tags mentioned in an earlier post but it's not working for me as I need the value of the variable before I parse it. Is there another way of making the variable available? The tag is being called from the

Re: Django imagefield at development server

2009-01-27 Thread phoebebright
You might also check, You have DEBUG = True in settings.py And have permissions set on the photo directory And have something in urls.py file to point to the photo directory On Jan 27, 1:58 pm, Akhmat Safrudin wrote: > dear list, > i am a noob, > i just starting a

Can I control contents of SELECT in queryset?

2009-01-29 Thread phoebebright
I want a distinct list of all the 'cat__names' that exist in Subcategory and have at least one entry in Business (Business is a subclass of model Directory which might be the problem) dir_query = Business.objects.all().select_related().distinct() ... subcats =

Re: Custom Template Tag - Passing variable for use in tag processing

2009-01-29 Thread phoebebright
You understood perfectly. It was just another case of my not understanding the documentation. Your explanation makes perfect sense. Many thanks. On Jan 27, 6:45 pm, Eric Abrahamsen <gir...@gmail.com> wrote: > On Jan 28, 2009, at 1:52 AM, phoebebright wrote: > > > > &g

Re: Can I control contents of SELECT in queryset?

2009-01-29 Thread phoebebright
rote: > On Jan 29, 8:44 am, phoebebright <phoebebright...@gmail.com> wrote: > > > > > I want a distinct list of all the 'cat__names' that exist in > > Subcategory and have at least one entry in Business (Business is a > > subclass of model Directory which might be the pr

Re: Custom Template Tag - Passing variable for use in tag processing

2009-01-29 Thread phoebebright
else: pages = False context['pages'] = pages return '' On Jan 29, 3:22 pm, phoebebright <phoebebright...@gmail.com> wrote: > You understood perfectly.  It was just another case of my not > understanding the documentation.  Your explanation makes per

Re: Can I control contents of SELECT in queryset?

2009-01-30 Thread phoebebright
0, 2:23 am, Malcolm Tredinnick <malc...@pointy-stick.com> wrote: > On Thu, 2009-01-29 at 06:44 -0800, phoebebright wrote: > > I want a distinct list of all the 'cat__names' that exist in > > Subcategory and have at least one entry in Business (Business is a > > subclass

Re: Can I control contents of SELECT in queryset?

2009-02-02 Thread phoebebright
nty-stick.com> wrote: > On Fri, 2009-01-30 at 07:46 -0800, phoebebright wrote: > > Using your suggestion returns no values: > > Then there is something else going on in your code that is important and > you haven't mentioned yet. > > If I use exactly the models you

Subclass/Inline Problem - should I be able to do this?

2009-02-06 Thread phoebebright
Here is my model: class Directory(models.Model): name = models.CharField(max_length=60) class Business(Directory): anyfield = models.CharField(max_length=60) class Gallery(models.Model): directory = models.ForeignKey(Directory), pic = models.ImageField(upload_to='pics') This

Changing Image in admin deletes the rest - expected behaviour?

2009-02-09 Thread phoebebright
Model: class Car(models.Model): ... lots of fields ... pic1 = models.ImageField(blank=True, upload_to='pics') pic2 = models.ImageField(blank=True, upload_to='pics') pic3 = models.ImageField(blank=True, upload_to='pics') pic4 = models.ImageField(blank=True, upload_to='pics')

Subclass conflict with admin widgets

2009-02-09 Thread phoebebright
I have implemented this solution successfully with a standard model, but when I try to use it on one which is subclassed I get an error because it is trying to validate the model before it knows about the subclass. I can work around this by defining an Admin class for each of the subclasses, but

Admin Image Handling - ability to display thumb and delete an image - one solution

2009-02-09 Thread phoebebright
In case this helps anyone, here is one implementation I have 4 pictures attached to each record but would work the same if only one. Uses sorl-thumbnails and based on snippet here: http://www.djangosnippets.org/snippets/934/ written by baumer1122 In models.py - used standard

Re: Subclass conflict with admin widgets

2009-02-09 Thread phoebebright
red if it was somthing django should allow for and the design of the two examples is inherantly the same. On Feb 9, 8:52 pm, Daniel Roseman <roseman.dan...@googlemail.com> wrote: > On Feb 9, 7:28 pm, phoebebright <phoebebright...@gmail.com> wrote: > > > > > I have imple

YUI Image Uploader - OK on Firefox/Mac but not elsewhere

2009-02-09 Thread phoebebright
Have been trying to get a RTE plugin working that will allow upload of images. The YUI verion is almost there but will not play well with browsers. The plugin from here http://allmybrain.com/2008/11/06/example-yui-image-upload-with-yui-260/ I modified to get Javascript to make an asynchronous

Re: Subclass conflict with admin widgets

2009-02-10 Thread phoebebright
That makes sense. I'll just create a different admin for each model. Thanks. On Feb 10, 4:36 am, Karen Tracey <kmtra...@gmail.com> wrote: > On Mon, Feb 9, 2009 at 5:18 PM, phoebebright <phoebebright...@gmail.com>wrote: > > > > > > > Yes I see that, it's

Re: YUI Image Uploader - OK on Firefox/Mac but not elsewhere

2009-02-10 Thread phoebebright
issues. that way you > can leave most of the default paths in the settings.py file and it > just works out of the box. > > On Feb 9, 4:39 pm, phoebebright <phoebebright...@gmail.com> wrote: > > > Have been trying to get a RTE plugin working that will allow upload of &

Parent_link=True causes Cannot assign None: "Business.id" does not allow null values.

2009-02-11 Thread phoebebright
I am following the instructions at the bottom of this page http://docs.djangoproject.com/en/dev/topics/db/models/#inheritance-and-reverse-relations and here http://docs.djangoproject.com/en/dev/ref/models/fields/#onetoonefield I have a parent class Directory and a child classes Business, Tourism

Really dumb question re output variable for debugging

2009-02-11 Thread phoebebright
I need to see the contents of some objects that are passed as parameters into a function. I can stop the function (assert false) and look at the traceback, but it doesn't tell me the contents of the objects. I have tried print statemnts, pickle and pprint. I don't want to stray into the

Re: Parent_link=True causes Cannot assign None: "Business.id" does not allow null values.

2009-02-11 Thread phoebebright
<kmtra...@gmail.com> wrote: > On Wed, Feb 11, 2009 at 1:36 PM, phoebebright > <phoebebright...@gmail.com>wrote: > > > > > > > I am following the instructions at the bottom of this page > > >http://docs.djangoproject.com/en/dev/topics/d

Re: Really dumb question re output variable for debugging

2009-02-11 Thread phoebebright
Intro. Have I missed something? Phoebe. On Feb 11, 8:45 pm, Lee Braiden <fallibledra...@gmail.com> wrote: > 2009/2/11 Karen Tracey <kmtra...@gmail.com>: > > > On Wed, Feb 11, 2009 at 3:01 PM, phoebebright <phoebebright...@gmail.com> > > wrote: > > >

Re: Really dumb question re output variable for debugging

2009-02-11 Thread phoebebright
really need to know to try and work out why my custom widget isn't working, otherwise I'm going to have to post yet another problem to this user groups, and I'm getting a bit emabarresed at the number of posts I'm making :~) On Feb 11, 9:22 pm, phoebebright <phoebebright...@gmail.com>

Re: YUI Image Uploader - OK on Firefox/Mac but not elsewhere

2009-02-11 Thread phoebebright
, but for some reason it is not called in this case. May return to this problem when I am more experienced with django... On Feb 10, 7:10 pm, phoebebright <phoebebright...@gmail.com> wrote: > I'm pretty sure I have all the paths correct because the TinyMCE/ > Filebrowser works ok on firef

Re: Parent_link=True causes Cannot assign None: "Business.id" does not allow null values.

2009-02-11 Thread phoebebright
Karen, Spot on! Changed field name to directory and all is well. Thanks so much. Phoebe. On Feb 11, 8:57 pm, Karen Tracey <kmtra...@gmail.com> wrote: > On Wed, Feb 11, 2009 at 3:19 PM, phoebebright > <phoebebright...@gmail.com>wrote: > > > > > Karen, > &

Custom widget for images is deleting them

2009-02-11 Thread phoebebright
I thought I had a custom widget which would allow images to be deleted working and was dead chuffed (http://groups.google.com/group/django- users/browse_thread/thread/ebf646208fa8880f/c22f87e85b5d78ef? lnk=gst=admin+image#c22f87e85b5d78ef) but unfortunately it doesn't work. I have spent the

Re: Custom widget for images is deleting them

2009-02-11 Thread phoebebright
out revision 9824. And dates are Feb 2 Any suggestions? On Feb 11, 11:32 pm, Alex Gaynor <alex.gay...@gmail.com> wrote: > On Wed, Feb 11, 2009 at 6:30 PM, phoebebright > <phoebebright...@gmail.com>wrote: > > > > > > > I thought I had a custom widget

Re: Documentation for Download?

2009-02-11 Thread phoebebright
If you downloaded using svn then it is in trunk/docs which is at the same level as trunk/django not inside it. On Feb 11, 11:59 pm, Tim Johnson wrote: > On Wednesday 11 February 2009, Alex Gaynor wrote: > > > Every django tarball or svn checkout includes a docs/ dir

Re: Custom widget for images is deleting them

2009-02-11 Thread phoebebright
t 7:02 PM, phoebebright > <phoebebright...@gmail.com>wrote: > > > > > > > It sounds like it.  I've tried to get the version 9765 as suggested > > but I don't think I have the right syntax: > > [r...@viv site-packages]# svn co > >http://code.django

WYSIWYG Image upload challenge

2009-02-18 Thread phoebebright
I have now spend 5 solid days trying to get any WYSIWYG editor with an image upload working in django with no success. Current status: YUI - works in Firefox/Mac not in IE. The image upload is happening but the response is being interpretted by IE as a download so control does not return to

Re: WYSIWYG Image upload challenge

2009-02-18 Thread phoebebright
wrote: > 2009/2/18 phoebebright <phoebebright...@gmail.com>: > > > > > I have now spend 5 solid days trying to get any WYSIWYG editor with an > > image upload working in django with no success.  Current status: > > This must be solveable!!! > > > Any su

Re: WYSIWYG Image upload challenge

2009-02-18 Thread phoebebright
pt. Have applied a similar program in PHP and it works fine. Tried different mime types and tried to trace what is going on but without progress. Phoebe On Feb 18, 2:33 pm, Almost George <almostgeo...@almostexciting.com> wrote: > On Feb 18, 5:36 am, phoebebright <phoebebright...@g

Re: WYSIWYG Image upload challenge

2009-02-18 Thread phoebebright
o how difficult this would be to port to YUI. There are a > couple of JS issues that I've had to fix with this, but otherwise, it > works very well. > > Regards, > Brandon > > On Feb 18, 8:33 am, Almost George <almostgeo...@almostexciting.com> > wrote: > > > On Fe

Re: Django CMS and Tiny_mce - ERROR 'module' object has no attribute 'JS_URL'

2009-02-19 Thread phoebebright
m/group/django-cms/browse_thread/thread/88dfe2... > > On 18 Feb., 19:59, Phoebe Bright <phoebebright...@gmail.com> wrote: > > > My experience with setting up tinymce was that there were plenty of plenty > > of opportunities for getting the paths wrong!  To avoid problems I

Re: WYSIWYG Image upload challenge

2009-02-19 Thread phoebebright
it?). On Feb 18, 8:23 pm, Colin Bean <ccb...@gmail.com> wrote: > On Wed, Feb 18, 2009 at 10:50 AM, phoebebright > > > > <phoebebright...@gmail.com> wrote: > > > The javascript makes a call to this view on submitting the form that > > uploads the image. >

Creating KML files for use in Google Maps

2009-02-27 Thread phoebebright
Took me a long long time to work out why the .kml file I created in django would parse as valid in Feedburner but googlemaps said it was an invalid kml file. Need to be sending as correct content-type of course. In case anyone else is stuck, here is how I did it: template ---

Re: Problem with syncr and picasa - not displaying large images, mostly

2009-04-04 Thread phoebebright
Rajesh, That make perfect sense. Thank you so much. Phoebe. On Apr 3, 8:18 pm, Rajesh D <rajesh.dha...@gmail.com> wrote: > On Apr 3, 12:59 pm, phoebebright <phoebebri...@spamcop.net> wrote: > > > I implemented syncr (http://code.google.com/p/django-syncr/) quickly >

Re: pull down form

2009-04-08 Thread phoebebright
I like YUI and that has lots of menu possibilities - http://developer.yahoo.com/yui/menu/ On Apr 8, 5:43 pm, nixon66 wrote: > Anyone have a good example of using a pull down menu in a Django > template. I've just finished working through search forms, but > couldn't find

Only show field in admin for superuser

2009-04-23 Thread phoebebright
I have a model with an owner field that I only want a superuser to be able to change. I can't change the list of fields in form in admin.py because there is not request.user to test at that time. If I were using custom templates I could put it in the template, but would rather stick to the

Re: Only show field in admin for superuser

2009-04-23 Thread phoebebright
to check if the current > user has permission to change the owner. > Take a look athttp://www.b-list.org/weblog/2008/dec/24/admin/to see an > example. > > On Thu, Apr 23, 2009 at 1:37 AM, phoebebright <phoebebri...@spamcop.net>wrote: > > > > > > >

Re: Only show field in admin for superuser

2009-04-23 Thread phoebebright
django/contrib/admin/options.py. > > On Thu, Apr 23, 2009 at 3:32 AM, phoebebright <phoebebri...@spamcop.net>wrote: > > > > > > > Zain, > > > Thanks for responding. > > I would really prefer not to show the field at all - I don't want > > ordinary user

Error message in admin - row level permissions

2009-05-09 Thread phoebebright
I have almost implemented a row level permissions facilitiy for a model in my app. I can change the owner of the record Display only their records in admin But when logged in as the owner and click Save on the edit screen I get the error "Please correct the error below." but no indication of

Re: Error message in admin - row level permissions

2009-05-09 Thread phoebebright
, 'save_on_top': False, 'title': u'Change Business Directory'}) On May 9, 9:18 am, phoebebright <phoebebri...@spamcop.net> wrote: > I have almost implemented a row level permissions facilitiy for a > model in my app. > > I can change the owner of the record > Display only their record

Re: Error message in admin - row level permissions

2009-05-09 Thread phoebebright
to the admin form. Tried hidden_fields, but this not available in version 1.0 of Django. On May 9, 9:18 am, phoebebright <phoebebri...@spamcop.net> wrote: > I have almost implemented a row level permissions facilitiy for a > model in my app. > > I can change the owner of the rec

Print question

2009-05-09 Thread phoebebright
Not looking for a discussion on debug methods, just want to know if there is any way to print an object. eg. print myobject OR pprint.pprint(myobject) just says something like And unless I know the structure of the object I can't access the values. I'm probably going to get a blasting

Re: Only show field in admin for superuser

2009-05-09 Thread phoebebright
Just a postscript to this - this will fail if the field being left out is a required field. The admin form will show an error but as the field is missing you will not know what the error is. I think with the new hidden_fields option, this will be a workaround. On Apr 23, 8:20 pm, phoebebright

Re: Print question

2009-05-09 Thread phoebebright
Masklinn, Thanks. I see what you mean about being bored! But that's a big step forward for me. As a PHP convert to Django/Python, I'm looking for the equivalent of print_r On May 9, 4:31 pm, Masklinn <maskl...@masklinn.net> wrote: > On 9 May 2009, at 16:37 , phoebebri

Signals giving: global name 'MyModel' is not defined

2009-05-14 Thread phoebebright
Have been at this now for some hours and still can't see the wood for the trees. Failed to get two signals working - one called on pre_save to keep an audit trail of one field on a model (didn't implemenet the Audit.py version in the wiki as more complex than I needed). The other to create some

Looking for coupon/voucher plugin

2009-05-20 Thread phoebebright
Have a client looking to add special 1euro night offers on local hotels. Have googled extensively for any site offering to manage the issuing of vouchers/coupons but can only find sites issuing coupons on behalf of others. If there is not such service, is there an opening for doing a django

Book: Python Web Development with Django

2009-06-04 Thread phoebebright
Just finished reading this book and found it really helpful as a newbie to both Python and Django. The things I really liked about this book: - assumes I know very little - intro to python programming just the right level of detail for me - tutorials include plenty of real code examples -

Generic Views vs. Admin

2009-06-11 Thread phoebebright
I have spent a good deal time researching this online and in this group but can find no clear answer. Generally, I can either use generic views and write a template for each model to list/view/update/delete or I can use admin and do a filter to only show a particular person's entries. My

Re: Generic Views vs. Admin

2009-06-11 Thread phoebebright
%} What do you think? On Jun 11, 4:34 pm, Jashugan <jashu...@gmail.com> wrote: > On Jun 11, 8:03 am, phoebebright <phoebebri...@spamcop.net> wrote: > > > I have spent a good deal time researching this online and in this > > group but can find no clear answ

Re: in admin interface - how to edit/show data based on ownership/not ownership

2009-06-11 Thread phoebebright
This post might help - http://groups.google.com/group/django-users/browse_thread/thread/c84dbbac27c6fea2/cf6624cca547fe89?lnk=gst=admin+owner#cf6624cca547fe89 Not exactly what you want but might give you some ideas. On Jun 11, 7:36 pm, "Sergio A." wrote: > Hello, > >

Re: django-registration .missing templates?

2009-07-20 Thread phoebebright
Send me an email and I will post back the forms I used. email username as above plus spamcop.net. On Jul 19, 6:08 pm, Asinox wrote: > Hi guys, im trying to use the django-registration...im new with > django, but i was thinking that maybe some templates are missing, like >

OSX - says view is missing but it isn't

2009-07-20 Thread phoebebright
My development environment has just started behaving strangely. If I cause an error, fix it and call the same URL again (not refresh, just enter link) I get ViewDoesNotExist: Could not import tweetlog.views. Error was: cannot import name parse_tweet The module and view are fine and if I go to

Template tags as parameter to template tag

2009-07-20 Thread phoebebright
Is there a way to get this to work: {% for tag in tags %} {% tag_link "{{tag.name}}" %} {% endfor %} The outer loop is using the standard tagging application and the tag_link is my custom template tag which has a different url depending on the type of

Re: OSX - says view is missing but it isn't

2009-07-22 Thread phoebebright
web/views.py in () 4 from tagging.models import * 5 from tweetlog.models import TweetLog > 6 from tweetlog.views import parse_tweet, autolink 7 8 ImportError: cannot import name parse_tweet On Jul 20, 11:11 am, phoebebright <phoebebri...@spamcop.net> wrote: >

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

2009-07-28 Thread phoebebright
I thought I was faithfully coping the tutorial, so don't understand why I get this error. Here is the code in the view: @login_required def edit_todo(request, todo_id): task = Task.objects.get(id=todo_id) if request.method == 'POST': form = TaskForm(request.POST) ...

Re: MS Word Characters

2009-07-28 Thread phoebebright
Be very interested in the answer too! On Jul 28, 4:02 pm, cootetom wrote: > I know why it's failing when I send it as an email. The django > EmailMessage class will try to encode any text based attachment down > to ascii. So any attachment containing characters out side of

Re: Django select multiple date from calendar

2009-07-28 Thread phoebebright
Don't have the whole answer, but google parsedatetime python library which has some good utilities to extract dates from text. You can then build the required queryset. On Jul 28, 10:49 am, kimo wrote: > Hi, > > Im new in using Django, and i want to know if there is

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

2009-07-28 Thread phoebebright
That would be it! Thanks for your prompt help - onwards On Jul 28, 7:06 pm, Alex Gaynor <alex.gay...@gmail.com> wrote: > On Tue, Jul 28, 2009 at 2:02 PM, phoebebright<phoebebri...@spamcop.net> wrote: > > > I thought I was faithfully coping the tutorial, so don't

No Module named ... problem

2009-09-02 Thread phoebebright
And it's not a missing __init__.py program that I can see. Am trying to move a site to a new server - CentOS to Ubuntu and version of python are changing from 2.4.3 to 2.5.2 and using wsgi now instead of mod_python. I already have one django site running on the new server so the basic setup is

Re: No Module named ... problem

2009-09-03 Thread phoebebright
ep 2, 2009 at 11:38 PM, phoebebright<phoebebri...@spamcop.net> wrote: > > > And it's not a missing __init__.py program that I can see. > > > Am trying to move a site to a new server - CentOS to Ubuntu and > > version of python are changing from 2.4.3 to 2.5.2 and

Model object has no attribute 'get'

2009-09-21 Thread phoebebright
Have been stuck on this one for a couple of days so hoping for some enlightenment from some more able django users. Am aware of the 'gotcha' where the model name matches and attribute or one of the Meta values. I am getting this when a form is instantiated with an existing object - no problem

Re: Records doesn't sometimes get upated

2009-09-21 Thread phoebebright
The code looks like it only handles the case of adding a new foo object but your comments refer to "old values". Are you also expecting this to work for an update? On Sep 21, 7:35 am, Szymon wrote: > Hello, > > I have strange problem. I will give example. I have model: > >

Re: ImportError: Could not import settings 'WWlove.settings'

2009-09-21 Thread phoebebright
Only a guess but maybe mixed case in WWlove is causing a problem? On Sep 20, 10:50 pm, Jose Sibande wrote: > Hi, > I get this error in /var/log/apache2/error.log: > > [Mon Sep 21 01:38:14 2009] [error] [client 41.157.12.3] ImportError: > Could not import settings

Re: Model object has no attribute 'get'

2009-09-21 Thread phoebebright
On Sep 21, 3:25 pm, Karen Tracey <kmtra...@gmail.com> wrote: > On Mon, Sep 21, 2009 at 10:05 AM, phoebebright > <phoebebri...@spamcop.net>wrote: > > > > > Have been stuck on this one for a couple of days so hoping for some > > enlightenment from

Re: Form Select Selected Choice

2009-09-21 Thread phoebebright
Can you give a more detailed example of your code? On Sep 21, 3:25 am, "Leonel Nunez" wrote: > Hello: > > I'm using > > form.base_fields['MYFIELD'].widget=widgets.Select(choices=CA) > > to fill a   tag, all works fine but I can't find how to add a > SELECTED  value, been

Re: Model object has no attribute 'get'

2009-09-21 Thread phoebebright
Karen, Yes absolutely right. Thanks for rescuing me from own stupidity! On Sep 21, 4:54 pm, Karen Tracey <kmtra...@gmail.com> wrote: > On Mon, Sep 21, 2009 at 11:49 AM, phoebebright > <phoebebri...@spamcop.net>wrote: > > > > > > > On Sep 21, 3:25 pm,

Internal Server Error for just one site

2009-09-23 Thread phoebebright
Can anyone suggest where the problem might be for this one. I am using wsgi and have a number of other django sites on this server all running fine. Have recreated the subdomain on the server, have copied the vhost.conf file from a site that works and changed the appropriate names (several

Re: Internal Server Error for just one site

2009-09-23 Thread phoebebright
, 7:11 pm, phoebebright <phoebebri...@spamcop.net> wrote: > > > Can anyone suggest where the problem might be for this one. > > > I am using wsgi and have a number of other django sites on this server > > all running fine.  Have recreated the subdomain on the server, h

Abstract model across apps

2009-10-01 Thread phoebebright
I am trying to use use a hCalendar model from django-microformats as the base class for events in my own app, microformat.models.py class hCalendar(LocationAwareMicroformat): ... class Meta: abstract = True web.models.py class Event(hCalendar): owner =

Re: Abstract model across apps

2009-10-01 Thread phoebebright
, and maybe it shouldn't. I can do some more exploration, but thought I would check I going in the right direction before proceeding. Phoebe. On Oct 1, 5:04 pm, Karen Tracey <kmtra...@gmail.com> wrote: > On Thu, Oct 1, 2009 at 10:59 AM, phoebebright <phoebebri...@spamcop.net>wrote:

  1   2   >