Re: django ORM not compatible with postgres

2009-03-22 Thread Mike Ramirez
On Sunday 22 March 2009 03:33:41 pm Brian Neal wrote: > On Mar 22, 2:56 pm, Mike Ramirez wrote: > > On Sunday 22 March 2009 09:25:42 am Brian Neal wrote: > > > But from what you posted, I'm guessing that line needs to read: > > > > > > obj.user = User.obj

Re: django ORM not compatible with postgres

2009-03-22 Thread Mike Ramirez
On Sunday 22 March 2009 03:59:10 pm Joshua Partogi wrote: > On Mar 23, 6:56 am, Mike Ramirez wrote: > > I think what you want to do with this style is: > > > >         obj.user = User.objects.get(username=request.user.username) > > > > > or maybe just > &

Re: Question IMAGE in Django

2009-06-22 Thread Mike Ramirez
rocessors and make sure the Media context processor[1] is set and you pass the request object to your RequestContext[2] Mike [1] http://docs.djangoproject.com/en/dev/ref/templates/api/#django-core-context-processors-media [2] http://docs.djangoproject.com/en/dev/ref/templates/api/#id1 -- We secu

Re: Question IMAGE in Django

2009-06-22 Thread Mike Ramirez
On Monday 22 June 2009 08:06:25 am Vlad(L) wrote: > Mike, I work on Django 1.0.2 - in this version in settings.py is not > mentioned at all about Media context processor and RequestContext. To > me they need to be added in addition most??? It's not mentioned in the settings.py fi

Re: Question IMAGE in Django

2009-06-22 Thread Mike Ramirez
or for media is also set) an example of mine: TEMPLATE_CONTEXT_PROCESSORS = ( "django.core.context_processors.auth", "django.core.context_processors.debug", "django.core.context_processors.i18n", "django.core.context_processors.media", } As long as the url

Re: Question IMAGE in Django

2009-06-22 Thread Mike Ramirez
On Monday 22 June 2009 10:27:22 am Vlad(L) wrote: > Mike, excuse that I occupy your time. > > All has made also, but is not present Image. > I will write more in detail. When I instal, for example, "{{MEDIA_URL}} {{art.image}}" width=200;/> image it is not displayed >

Re: Best distro for django

2009-07-03 Thread Mike Ramirez
I suggest you use what you are comfortable with. Mike -- Life is a POPULARITY CONTEST! I'm REFRESHINGLY CANDID!! signature.asc Description: This is a digitally signed message part.

Pyowa is this Monday!

2009-07-04 Thread Mike Driscoll
mming language. Be prepared to share! We may have another presentation in our Standard Library series as well or just something random. Let me know if you think you'll be there. Pop & water will be provided. We hope to see you there! -- Mike Driscoll http://www.

Re: Apache with Django

2009-07-06 Thread Mike Ramirez
erver in a production setting: http://docs.djangoproject.com/en/dev/ref/django-admin/#runserver You want use apache with mod_python or mod_wsgi or lighttpd with fastcgi (I think it's fastcgi with lighttpd, I use apache) or any other httpd that atleast has regular security checks. Mike

Re: Apache with Django

2009-07-06 Thread Mike Ramirez
bound IP addresses (0.0.0.0) # #Listen 12.34.56.78:80 Listen 80 Mike -- Yow! Is my fallout shelter termite proof? signature.asc Description: This is a digitally signed message part.

Re: Django RSS Feeds with adsense

2009-07-08 Thread Mike Ramirez
glesyndication.com/pagead/show_ads.js"">http://pagead2.googlesyndication.com/pagead/show_ads.js"</a>;> > > Wrap the script code with See: http://www.w3schools.com/xmL/xml_cdata.asp Mike -- The only difference in the game of love over the last few thousand years is

Re: Django RSS Feeds with adsense

2009-07-08 Thread Mike Ramirez
On Wednesday 08 July 2009 12:51:16 pm Alessandro Ronchi wrote: > 2009/7/8 Mike Ramirez > > > Wrap the script code with > > > > See: http://www.w3schools.com/xmL/xml_cdata.asp > > > > Mike > > It's parsed too: > > <![CDATA[ sorry, then I d

Re: Error in install django-tagging, help pls?

2009-07-12 Thread Mike Ramirez
he quotes) for the quick fix and reading up on using linux a bit more before continuing. I would start with the ubuntu with the ubuntu guide and the other links below. http://ubuntuguide.org/wiki/Ubuntu:Jaunty https://help.ubuntu.com/9.04/switching/index.html http://www.linuxtopia.org/online_bo

cross-referencing design question

2009-07-23 Thread Mike Dewhirst
I'm new to Django and want to express a self-referencing design feature to link clients in the same table with each other. Django is currently objecting to this. Could you please point me to documentation which will let me figure it out? This is my models.py in a play project using Django from sv

Re: cross-referencing design question

2009-07-27 Thread Mike Dewhirst
ame contains non-ASCII-chars. Thanks again ... Daniel Roseman wrote: > On Jul 24, 5:46 am, Mike Dewhirst wrote: >> I'm new to Django and want to express a self-referencing design >> feature to link clients in the same table with each other. > You don't say what the error is

Re: cross-referencing design question

2009-07-27 Thread Mike Dewhirst
Please disregard my previous - I've got something happening/hatching Thanks Matthias and Daniel Mike Mike Dewhirst wrote: > Matthias Kestenholz wrote: > > > >> Is this your complete Membership model? Or do you have additional >> fields there? If you've o

Re: cross-referencing design question

2009-07-27 Thread Mike Dewhirst
Daniel and Matthias Thanks for your help. I finally figured out I don't need any automatic Django n:m at all! I just made my own n:m table and everything works the way I expect. I'll really try to keep things simple from now on ... Cheers Mike Mike Dewhirst wrote: > Matthi

Re: Django and related_name

2009-07-29 Thread Mike Dewhirst
Asinox wrote: > > > Hi guys, first im so sorry with my english, im new with Django, u > know ;) > > I have a problem with a related_name, the tables are fine, but the > problem is that in the Select (DropDown) the data display is "bad", in > this way: Tarifas_object: > > Html code: > > Tarifa

Re: Calculating a date

2009-08-05 Thread Mike Ramirez
On Wednesday 05 August 2009 06:01:11 am adelaide_mike wrote: > This should really be a Python enquiry, but I am sure someone will > know: > > I need to calculate the date 12 weeks before today. What is the best > way? TIA > > Mike > --~--~-~--~~---

Re: Calculating a date

2009-08-05 Thread Mike Dewhirst
tday=date.today()): anniversary = self.birthdate.replace(year=tday.year) diff = anniversary.toordinal() - tday.toordinal() if diff < -358 or (diff >= 0 and diff <=7): return 'Yes' return 'No' > > Mike > > > > --~--~---

Re: Memory error

2009-08-05 Thread Mike Ramirez
t to follow this 'rule of thumb' and setup a vhost for serving media/static files through apache, bypassing django. [1] http://docs.djangoproject.com/en/dev/howto/static-files/#the-big-fat-disclaimer [2] http://docs.djangoproject.com/en/dev/howto/deployment/modpython/#serving-media-files Mike -- Overdrawn? But I still have checks left! signature.asc Description: This is a digitally signed message part.

display module and template names in templates

2009-08-10 Thread Mike Dewhirst
nable way to do this? Thanks for any pointers. Mike --~--~-~--~~~---~--~~ 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: display module and template names in templates

2009-08-10 Thread Mike Ramirez
On Monday 10 August 2009 08:47:57 pm Mike Dewhirst wrote: > If DEBUG is True I would like to include view.__name__ and the template > filename somewhere in the rendered page. > > It would be nice to adjust the {% block title %} so the information > appears in the top of the browser

[highly recommended] Re: display module and template names in templates

2009-08-10 Thread Mike Dewhirst
Mike Ramirez wrote: > On Monday 10 August 2009 08:47:57 pm Mike Dewhirst wrote: >> If DEBUG is True I would like to include view.__name__ and the template >> filename somewhere in the rendered page. >> >> It would be nice to adjust the {% block title %} so the informati

Re: Deploying django on apache - cant access database

2009-08-11 Thread Mike Ramirez
directory, I believe/assume /Users/someone/ is your home directory. I would use something like /srv/djangoproject and configure the settings so both your user and the apache user can read write to the files through the group settings. With a database like mysql/postgres that you connect to over a

Re: paginator for 0.96?

2009-08-11 Thread Mike Ramirez
ngo/branches/0.96-bugfixes/django/core/paginator.py Mike -- I went to my first computer conference at the New York Hilton about 20 years ago. When somebody there predicted the market for microprocessors would eventually be in the millions, someone else said, "Where are they all going to

Re: Model example for simple family tree

2009-08-11 Thread Mike Dewhirst
sniper wrote: > Hi, > I am new to django and wanted to try it out. > > I would like to create a table for family tree > where Relation is a many to many table which contains Profile ids > > profile_id, relative_id,type,priority. > > RELATIVE_CHOICES = ( > (u'F', u'Father'), > (u

Re: how much python do i need to know to learn/use Django?

2009-08-14 Thread Mike Ramirez
or, he's not wrong. > > ---Peter Herndon > I second this one and if you don't have any knowledge of functional programming, I would recommend adding this to your online education. Mike -- "Kill the Wabbit, Kill the Wabbit, Kill the Wabbit!" -- Looney Tunes, &q

Re: i need your ideas

2009-08-16 Thread Mike Ramirez
m/en/dev/ref/contrib/admin/actions/#ref-contrib-admin-actions Mike -- The Martian landed his saucer in Manhattan, and immediately upon emerging was approached by a panhandler. "Mister," said the man, "can I have a quarter?" The Martian asked, "What&#x

Re: passing parameters in every view...

2009-08-16 Thread Mike Ramirez
tcut render_to_response() you can pass a RequextContext(request) instance to it that will set them for you, making them available in the template you passed to render_to_response(). Mike -- "We never make assertions, Miss Taggart," said Hugh Akston. "That is the moral crime peculiar

misunderstanding

2009-08-16 Thread Mike Dewhirst
e is one of the meta_dict key:value pairs I feel this should not be. Also, when I uncomment the #print line below, the entire meta_dict, including 'title': 'META items' prints. Thanks for any pointers ... Mike views.py (excerpt) --- def display_meta(request): dct =

Re: misunderstanding

2009-08-16 Thread Mike Dewhirst
Karen and Eric - thank you. Yet another door opened for me :) Mike Karen Tracey wrote: > On Sun, Aug 16, 2009 at 9:33 PM, Mike Dewhirst > > Based on what your template does, you don't seem to really want to > combine a dictionary with the key 'title' and the MET

Re: Logging mechanism in Django

2009-08-17 Thread Mike Ramirez
an implement the logging mechanism > for an application. > > Regards, > Lokesh You can look at django-logging [1], it intergrates the python logging module with django as middleware. [1] http://code.google.com/p/django-logging/wiki/Overview Mike -- I feel like I am sharing

Re: Logging mechanism in Django

2009-08-17 Thread Mike Ramirez
Can I capture the log messages into my log file on a daily basis instead of > redirecting to screen. > > Regards, > Lokesh > you would set up the file access similar to using the python logging module [1] import logging logging.FileHandler('myfile') Mike [1] h

Re: FileField problems - url attribute doesn't work, how do I do uploads?

2009-08-17 Thread Mike Ramirez
obj.imagefile = uploadHandler(request.FILES['imagefile'], settings.GALLERY_SAVE_LOCATION) obj.save() admin.site.register(ImageFile, ImageAdmin) The FileFields upload_to[1] option can also take a callable to handle the file fields location, this uploadHandler can be placed there f

Re: Renaming an image to the SLUG after upload

2009-08-23 Thread Mike Ramirez
path and use it in the upload_to= option of the ImageField and save yourself the headache, but the gen_thumb should follow the instructions in handling uploaded files[2]. Mike [1] http://docs.djangoproject.com/en/dev/ref/models/fields/#filefield [2] http://docs.djangoproject.com/en/dev/topics/

Re: Scaling Thumbnails instead of Cropping or Squashing.

2009-08-23 Thread Mike Ramirez
w,h = image.size > > tn = image.resize((size,size), Image.ANTIALIAS) > tn.save(dest) > return dest Try using image.thumbnail() I've found this does keep the dimensions in proportion, regardless of the size passed to it.[1] Mike [1] http://www.pyth

Re: Problems width templatetags

2009-08-25 Thread Mike Ramirez
On Tuesday 25 August 2009 01:44:56 pm Sandra Django wrote: > Hi Mike, excellent answer, thanks. Look, I followed this example: > http://www.djangrrl.com/view/custom-template-tags-in-django/ > But my problem is that don't displays list categories, but neither I get > error. I co

Re: Problems width templatetags

2009-08-25 Thread Mike Ramirez
S setting to include 'django.template.loaders.app_directories.load_template_source', You can put the template tags html file in your app directory also, i.e. app/templates/admin/index.html; I do it this way to seperate the html from template tags from the rest of the html. Mike -- I feel ... JUGULAR ... signature.asc Description: This is a digitally signed message part.

Re: pyfacebook, No module named facebook.djangofb...

2009-08-27 Thread Mike Ramirez
y create this for you (similar to a setup.py), what it really wants is the one from the python install. You should really read the error messages more carefully and look at your tools deeper. Mike -- Tout choses sont dites deja, mais comme personne n'ecoute, il faut toujours recommencer.

Re: Django 1.0.2 + CSS how to?

2009-08-29 Thread Mike Ramirez
ass Media: > css = { > 'screen': ('pretty.css',), > 'print': ('newspaper.css',) > } > > for example. > > Where is this code placed, in which file? Is this what I should do? > Any help or pointers to additional docs for

Re: Store ImageField file using id as filename

2009-08-29 Thread Mike Ramirez
upload handler, just return the relative path for your ImageField to save. In the admin just import this upload handler and overwrite the save_model[2] method. There is one more option, on the post_save signal[3], you can do the move/renaming there. Hope this helps, Mike [1] http://docs.d

Re: How do you configure django+http+ftp?

2009-08-30 Thread Mike Ramirez
ia) and ftp. Run the instances of apache as the user django:django that should solve the problems. Mike -- Alex Haley was adopted! signature.asc Description: This is a digitally signed message part.

Problem subclassing Widget with value_from_datadict

2009-08-30 Thread Mike Ramirez
here is the traceback: http://dpaste.com/87440/ I'm not sure what I'm doing wrong here is the relevant code: http://dpaste.com/87441/ Mike -- "I'm not a god, I was misquoted." -- Lister, Red Dwarf signature.asc Description: This is a digitally signed message part.

Re: Problem subclassing Widget with value_from_datadict

2009-08-31 Thread Mike Ramirez
ing > instantiated. > -- > DR. Hereyou go, nothing special. http://dpaste.com/87647/ Mike -- I see the eigenvalue in thine eye, I hear the tender tensor in thy sigh. Bernoulli would have been content to die Had he but known such _a-squared cos 2(phi)! -- Stanislaw Lem,

Re: Problem subclassing Widget with value_from_datadict

2009-08-31 Thread Mike Ramirez
On Monday 31 August 2009 05:48:18 am Daniel Roseman wrote: > On Aug 31, 11:58 am, Mike Ramirez wrote: > > On Monday 31 August 2009 02:46:27 am Daniel Roseman wrote: > > > I think you're going to need to post your view code as well. It seems > > > that the form is

Re: Problem subclassing Widget with value_from_datadict

2009-08-31 Thread Mike Ramirez
ield(widget=ReCaptchaWidget) > > > > def __init__(self, *args, **kwargs): > > super(ReCaptchaForm, self).__init__(self, *args, **kwargs) > > if kwargs.has_key('userip'): > > self.userip = kwargs.pop('userip') > >

Re: Need help getting the company I work for to go with django

2009-09-01 Thread Mike Ramirez
big selling point, people I know who love sql, tend to fall in love with the orm. Mike -- diplomacy, n: Lying in state. signature.asc Description: This is a digitally signed message part.

Re: JSON serialization of related records.

2009-09-01 Thread Mike Ramirez
serialized data from above: def ajaxview(request): cat = FAQCategory.objects.all().get(pk=1) faqs = FAQ.objects.all().filter(category=cat) json = serializers.serialize('json', faqs) return JSONResponse(json) hope this helps, Mike -- War is peace. Freedom is slavery. Ketchup is a vegetable. signature.asc Description: This is a digitally signed message part.

Re: Showng the primary key in admin view

2009-09-01 Thread Mike Dewhirst
o > achieve this? @property def id_field(self): return self.pk def __unicode__(self): return u'%s : %s' % (self.id_field, self.name) Mike > > Joakim > > > > --~--~-~--~~~---~--~~ You receive

Re: Showng the primary key in admin view

2009-09-02 Thread Mike Dewhirst
Joakim Hove wrote: > Thank you both for answering; however I am afraid we are > misunderstanding eachother here. > > I have created a admin.py file and registered my CustomerClass with > the admin interface. That works, and I can select the CustomerClass > when logged in to the admin interface. >

Re: Showng the primary key in admin view

2009-09-02 Thread Mike Dewhirst
of your own to contain the customer id? It would probably survive dumping and reloading between different databases. Mike I have tried > to instantiate a CustomerAdmin class and listed the "id" field, there > but that only gives run time error. It seems the admin view/template &g

Re: phppgadmin not work if I have a project runing directly like: localhost/

2009-09-02 Thread Mike Ramirez
of the Location '/media/'. If it doesn't have this file, consult the apache docs and phppgadmin docs how to set these up if it's not there for you already. Mike -- No small art is it to sleep: it is necessary for that purpose to keep awake all day. -- Nietzsche signature.asc Description: This is a digitally signed message part.

Re: Showng the primary key in admin view

2009-09-02 Thread Mike Dewhirst
get away with bending the rule and use a pk as a delivery docket number because such a document is fairly short-lived. I wouldn't do it. As a rule. Mike > > Thanks - Joakim > > > > --~--~-~--~~~---~--~~ You received this message beca

Re: How to define variables used in every page?

2009-09-02 Thread Mike Ramirez
ething like 'global' variables in > Django? > > Thanks. You want to look at template context processors [1], this is about the best you'll get for what you want. [1] http://docs.djangoproject.com/en/dev/ref/templates/api/#id1 Mike -- Elbonics, n.: The act

Re: Editors of choice

2009-09-07 Thread Mike Ramirez
but I've been delving into PyQt a lot lately and started using Eric4 and found Eric4 has a django plugin that is helpful and makes it a nice ide for both django and pyqt and sort of has become my editor of choice for programming with both libraries. Mike -- There was, it appeared, a myster

Re: Users Full Name in model form?

2009-09-07 Thread Mike Dewhirst
like this? Visit ... http://docs.djangoproject.com/en/dev/intro/tutorial01 ... and search in that page for "Wait a minute" It indicates that you can return whatever string (actually unicode) representation you want as constructed from the object attributes when you bring an object

Re: Editors of choice

2009-09-08 Thread Mike Ramirez
On Tuesday 08 September 2009 04:11:38 ThinRhino wrote: > Mike, > > Does Eric4 support mercurial? I tried google, but did not find an answer. > > ThinRhino ThinRhino, Unfortunately, no. Only SVN (with subversion and/or pysvn) and CVS. The good news is that these utilize Eri

Re: Deployment on same server: Conflict staging/production

2009-09-08 Thread Mike Ramirez
tention to it for a couple years. http://gufymike.com/archives/detail/18/1/ With this setup I don't need to worry about much in terms of conflicted module names in the project, you just set the correct paths in your scripts that set the sys.path, media directories and so on. Hope this h

Re: Editors of choice

2009-09-08 Thread Mike Dewhirst
ound Eclipse too heavy when associated with SVN. I know there is SVN integration but I couldn't get it going smoothly enough so I gave up and happily went back to TextPad. I'm definitely going to try Joshua's suggestion of pdb. Thanks Mike > > > > > --~--~---

breadcrumb solution

2009-09-08 Thread Mike Dewhirst
'whatever' crumb = bread.dct['last_title'] bread.dct['last_title'] = title # put title and crumb into the view context for extraction # in the template as {{title}} and {{crumb}} Is there a better way? Thanks Mike --~--~-~--~~---

Re: breadcrumb solution

2009-09-09 Thread Mike Dewhirst
Daniel Roseman wrote: > On Sep 9, 7:32 am, Mike Dewhirst wrote: >> I would like to get breadcrumbs working in a simple way. Could anyone >> please help? >> >> I think I need a singleton with a dict like this ... >> >> bread = singleton() >> >> b

Re: breadcrumb solution

2009-09-09 Thread Mike Dewhirst
Thanks David - I do :) Cheers M David De La Harpe Golden wrote: > Mike Dewhirst wrote: >> I would like to get breadcrumbs working in a simple way. Could anyone >> please help? > >> Is there a better way? > > One thing you can do is a "pure template"

Nested Inlines / Multiple ManyToMany field admin support

2009-09-09 Thread Mike W.
e to edit each Author's institutions from the publication admin. Is this possible? In other words, does Admin support ManyToMany fields inside of an Inline adminmodel? Thanks much, Mike Models below- So we have it set up like this: class Publication(Unit): title = models.C

Re: How to generate po files ?

2009-09-09 Thread Mike Ramirez
DJANGO_SETTINGS_MODULE=myproject.settings # django_admin.py makemessages For windows I believe it's: C:\> set DJANGO_SETTINGS_MODULE=myproject.settings C:\> django_admin.py makemessages Mike -- Kington's Law of Perforation: If a straight line of holes is made in a piece of paper, su

Re: How to generate po files ?

2009-09-09 Thread Mike Ramirez
On Wednesday 09 September 2009 10:55:54 Mike Ramirez wrote: > # export DJANGO_SETTINGS_MODULE=myproject.settings > # django_admin.py makemessages > > For windows I believe it's: > > C:\> set DJANGO_SETTINGS_MODULE=myproject.settings > C:\> django_admin.py make

Re: Django & mod_wsgi, multipart/form-data forms, and hell

2009-09-10 Thread Mike Ramirez
in upload.html: {% if logged_in %} {% form %} {% else %} You must be logged in to access this page {% endif %} Or any variation of these. Hope this helps, Mike [1] http://docs.djangoproject.com/en/dev/topics/auth/#limiting-access-to- logged-in-users-that-pass-a-test -- Pr

Re: Django Project Management App

2009-09-10 Thread Mike Dewhirst
Django/Python obviously comprising many man-years of work. If you open source your app it could serve the dual purpose of showing newbies (like me) a working app of only a year or so's sophistication (much easier to get one's head around) plus a project management tool. Go for it :) Mik

Re: django deploy problem

2009-09-11 Thread Mike Ramirez
l force each location to run in it's own interpretter. As it is now they are choosing randomly which interpretter to use and causing the conflict. Please. someone if I'm wrong on the reason about how it is working without this, correct me. Hope this helps, Mike [1] http://www.modpytho

Re: Installing Django

2009-03-28 Thread Mike Ramirez
eads into the Environment variables mentioned previously. But this is just a small guess based on the info provided here. Mike -- Ah, but a man's grasp should exceed his reach, Or what's a heaven for ? -- Robert Browning, "Andrea del Sarto" signature.asc Description: This is a digitally signed message part.

forms with foreign key population

2009-04-02 Thread Mike RA9FTM
Hello. I am new to django. I have read documentation and created a little project. I plan application with many forms. Mostly, I need to populate forms, when I have foreign key in model, like in django admin interface when we click on plus picture, a new window opens. So, I would like to know is

Re: forms with foreign key population

2009-04-03 Thread Mike RA9FTM
Guys, I found this article http://www.hoboes.com/Mimsy/?ART=675 I have tested this one and it working. But is it really correct to do so? Thanks. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" grou

cx_Oracle django and "dumb" connect

2009-04-05 Thread Mike RA9FTM
Hi. I need direct connection to oracle for import some information sometimes. Here is what I do for first test: def orcl_test(request): connstr='scott/ti...@orcl' conn = cx_Oracle.connect(connstr) curs = conn.cursor() curs.execute('select * from dept') rows = [row[2] for row

Re: cx_Oracle django and "dumb" connect

2009-04-05 Thread Mike RA9FTM
Thank you for your answer. I think it will be a problem, beacuse I am already using postgresql database in my django project. On 5 апр, 17:02, Alex Gaynor wrote: > > Instead of importing cx_oracle directly you should do `from django.db import > connection` which gets you a normal PEP-249 databas

Re: django.contrib.auth user password decryption

2009-04-05 Thread Mike Ramirez
ened to Reddit. > > http://blog.moertel.com/articles/2006/12/15/never-store-passwords-in-a-data >base > > Yours, > Russ Magee %-) > I think that every web designer should read this, http://www.owasp.org/index.php/OWASP_AppSec_FAQ and to address this question specifically:

Re: every time that I load a form page, i have to reload the page to make errors go away

2009-04-11 Thread Mike Ramirez
o me it's a lot like the models.permalink decorator on non-model based urls and fits in with the DRY philosophy. Using this style in your code allows you to edit the the url pattern, or the funciton call, or any other part of the url pattern without ever having to change anything else in y

Re: Auto increment in model primarykey

2009-04-21 Thread Mike Ramirez
/models/instances/#auto-incrementing-primary-keys http://docs.djangoproject.com/en/dev/ref/models/fields/#primary-key Mike -- This is the first age that's paid much attention to the future, which is a little ironic since we may not have one. -- Arthur Clarke signature.asc Description: This is a digitally signed message part.

Re: Problem in tutorial

2009-04-23 Thread Mike Ramirez
r > stuff like this. > > Karen > Just a quick question, from my experience, dbshell seems it is just a simple way of launching into the mysql/postgres cli clients. So the question is which mysql program are you talking about? Mike -- Reappraisal, n.: An abrupt change of mind

Re: how to handle database down time gracefully?

2009-04-24 Thread Mike Ramirez
lso didn't go indepth into what each method is, for those I'm not 100% on. But this check, I'm not positive how big of a performance hit it would be or not, since this would be checked on each request. I've normally just set the maintaince flag manually when requ

django model request trim analog

2009-04-27 Thread Mike RA9FTM
Hi all Is there any analog of SQL trim() function in SELECT query? I need to remove spaces in strings. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to djan

Re: dynamic model field assignments

2009-04-29 Thread Mike Ramirez
s" %(self.name) Shell creating a new object with only the name and description parameters: In [1]: from testfun.models import TestFun In [2]: n = TestFun(name="mike", description="Testing is always fun.") In [3]: n.save() In [4]: objs = TestFun.objects.get(name__e

Re: i've looked at other discussions regarding the error ?unable to open database file?

2009-05-04 Thread Mike Ramirez
DATABASE_HOST = '' # Set to empty string for localhost. Not used with sqlite3. DATABASE_PORT = '' # Set to empty string for default. Not used with sqlite3. Mike -- I know. Unless htere is a cookie monster somewhere be

Re: i've looked at other discussions regarding the error ?unable to open database file?

2009-05-04 Thread Mike Ramirez
also. [gufym...@sylia testing]$ rm testing.db [gufym...@sylia testing]$ vi testing.db [gufym...@sylia testing]$ ./manage.py syncdb Creating table django_content_type Creating table django_session Creating table django_site Creating table testfun_testfun -- In vi I just typed :wqa to quit it. Mike

Re: i've looked at other discussions regarding the error ?unable to open database file?

2009-05-04 Thread Mike Ramirez
On Monday 04 May 2009 10:17:09 am Phil Mocek wrote: > On Mon, May 04, 2009 at 08:31:34AM -0700, Mike Ramirez wrote: > > I forgot to mention that sqlite3 expects a file to be there, it > > can't create one on it's own, using ./manage.py syncdb. > > I think you a

Re: How do I handle urls with different names?

2009-05-11 Thread Mike Ramirez
e: pet = Pets.object.get(pk=1) pet.get_absolute_url() or in a template {{ pet.get_absolute_url }} To retrieve the url for the corresponding row. use the string method lower() to make the type and name lower case. i.e. self.type.lower(), self.name.lower() in get_absolute_url. > and then in the view you can filter by type and name individually. > Alex Mike -- "I say we take off; nuke the site from orbit. It's the only way to be sure." - Corporal Hicks, in "Aliens" signature.asc Description: This is a digitally signed message part.

Django superusers

2009-05-14 Thread Mike Driscoll
2.5 and Django 1.0.2 (final). Thanks! Mike --~--~-~--~~~---~--~~ 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 this grou

Re: Django superusers

2009-05-15 Thread Mike Driscoll
Hi Karen, On May 14, 5:09 pm, Karen Tracey wrote: > On Thu, May 14, 2009 at 4:06 PM, Mike Driscoll wrote: > > > Hi, > > > I am working my way through the Django 1.0 book by Ayman Hourieh from > > Packt and I just reached the Admin Interface chapter (which is number

Composite keys

2009-05-15 Thread Mike Driscoll
which is a new requirement. Thanks! - Mike --~--~-~--~~~---~--~~ 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 this gro

Re: Django superusers

2009-05-18 Thread Mike Driscoll
Don, On May 15, 11:08 am, donarb wrote: > On May 15, 7:31 am, Mike Driscoll wrote: > > > The book does not mention anything about the autodiscover() call, > > although it seems to have done everything else right. Once I added > > that, the admin pages starting working

Re: user object in login.html

2009-05-23 Thread Mike Ramirez
% if request.user.is_authenticated %} You are already logged in. If you're having problems, please clear all your cookies and login again. Thanks. {% else } Login form {% endif %} for request.user to be available, make sure you have django.core.context_processors.auth in your TE

Re: user object in login.html

2009-05-23 Thread Mike Ramirez
ontext-processors-auth Mike -- The rich get rich, and the poor get poorer. The haves get more, the have-nots die. signature.asc Description: This is a digitally signed message part.

Re: Is there a version of @login_required that requires the user to log in as a specific user?

2009-05-25 Thread Mike Ramirez
e will work as expected. The exact specifics are upto you, but this is how I do it. Mike -- "Our vision is to speed up time, eventually eliminating it." -- Alex Schure signature.asc Description: This is a digitally signed message part.

Composite keys or sqlalchemy

2009-05-29 Thread Mike Driscoll
SqlAlchemy support are either dead, on life support or have only sporadic commits. Thanks! Mike --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to dj

Re: Installing Django on Windows XP

2009-05-29 Thread Mike Driscoll
the command line. Are you running as an admin user? If not, then that could be why you cannot install Django from that location. - Mike --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group.

Re: Composite keys or sqlalchemy

2009-05-29 Thread Mike Driscoll
Hi Alex, On May 29, 2:49 pm, Alex Gaynor wrote: > On Fri, May 29, 2009 at 2:45 PM, Mike Driscoll wrote: > > > Hi, > > > I asked a similar question about this last year and was told that > > Django would eventually support composite keys, but currently did not. >

Re: Composite keys

2009-06-01 Thread Mike Driscoll
On May 15, 8:12 pm, Russell Keith-Magee wrote: > On Sat, May 16, 2009 at 5:27 AM, Mike Driscoll wrote: > > > Hi, > > > I posted about this over a year ago and Jacob Kaplan-Moss said that > > Django would eventually getcompositekey support, but he didn't know &g

Re: images do not upload

2009-06-01 Thread Mike Ramirez
he path saved to the model should be relative to the media root, so urls generated using {{ MEDIA_URL }}{{ obj.imagefile }} work as expected. If you still have questions just ask. [1] http://docs.djangoproject.com/en/dev/topics/http/file-uploads/#handling-uploaded-files Mike -- 'Tis t

Re: multiple column primary key

2009-06-03 Thread Mike Driscoll
ult Django ORM. Unfortunately, that will break some of the built- in cool stuff of Django, like the admin interface and anything else that depends on the built=in ORM. - Mike --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Group

LDAP support in Django?

2009-06-05 Thread Mike Driscoll
LDAP integration. Anyway, your advice would be welcome. I'm getting rather fed up with a certain other Python web framework's poor documentation and unhelpful community. Thanks, Mike --~--~-~--~~~---~--~~ You received this message because you are su

Re: Should this be its own app?

2009-06-19 Thread Mike Ramirez
'blog', 'socialservices', ) Then build according to my outline. Note to those who would mention django-social, instead of writing a custom one, I am just providing examples for explaining my point of view on how to tell what should be an app and how to lay it out. Mi

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