Re: Best practices for multiple sites

2009-01-12 Thread felix
I'm running 3 sites on a shared db right now. I would say your option 2 I keep most of the functionality in the apps (shared), each of those apps have views, so the views are certainly shared / not duplicated in my case each site is quite distinct and has specific models and views on top of the

Re: Decoupling between projects and app in 4-part tutorial.

2009-01-13 Thread felix
this was for me also a slight trick to learn. I got more from blog posts than the docs (and I love the django docs) the trick is that your PYTHONPATH (and don't forget the python path of your deployment server) should point to the dir above your project dir and the dir above your apps dir. I

Re: Django Continuous Integration

2009-01-13 Thread felix
On Tue, Jan 13, 2009 at 7:45 PM, mguthrie wrote: > > Revision Control: How do you layout your development repository? I'm > using Subversion for my setup but would be interested in hearing what > else others are using (Mercurial, Bazaar, Git, etc) I have django and

Re: Help with m2m relationships through intermediary tables

2009-01-14 Thread felix
page of these positions you can fetch them directlly AuthorNewspaper.objects.all() an.author an.newspaper an.date -felix http://crucial-systems.com On Mon, Jan 12, 2009 at 11:35 AM, Asif <asifrahm...@gmail.com> wrote: > > I've created a few models that have m2m r

Re: Blueprint css versus YUI grids versus ?

2009-01-19 Thread felix
I've also enjoyed blueprint for its clarity and speed. ideally I would love to assign more semantic .classes and #ids and then use a style sheet that assigns to styles to styles (yo dawg ... ) .detail { {% blueprint 'span-8' %} {% blueprint 'box' %} border: 1px solid {{ui.bordercolor}}; }

Re: Access production database via development environment

2009-01-20 Thread felix
it didn't work ? you got the (remote) server correctly specified etc. ? I haven't tried that myself. I used to do this all the time with my old dev environment (a php framework), its very nice to run the dev code using the remote production db just to check. http://crucial-systems.com On

Re: Problem with contenttype/renaming of an app

2009-01-24 Thread felix
look in auth_permission I would just rename them by hand or by sql http://crucial-systems.com On Sat, Jan 24, 2009 at 8:19 PM, Benjamin Buch wrote: > > Hi, > > during development, I messed around with an app name. > First it was called 'body copies' (no native speaker!),

how to: munge words and numbers into a URL, then reverse it ?

2009-01-27 Thread felix
there is some hashing function or combination of URL encoding that can do this : given some parameters : 'music' 'artist' 32L 2L 100 100 ( artist id 32, 2nd picture, dimensions 100 x 100 ) I wish to generate a fake filename eg: tartan_ba6e5e06e794f1368ed3ec20b4594eec.png and then be able to

Re: Django imagefield at development server

2009-01-27 Thread felix
no problem uploading using the dev server no idea. you didn't leave a pdb in your code, did you ? what is the output if any in the shell ? On Tue, Jan 27, 2009 at 2:58 PM, Akhmat Safrudin wrote: > > dear list, > i am a noob, > i just starting a project, then

Re: how to: munge words and numbers into a URL, then reverse it ?

2009-01-27 Thread felix
oded number which is ugly > enough for non-developers :D > you are free to choose encoding, and can nest them in multiple algos to > make the thing more complex > > greetings, > Puneet > > > On Tue, Jan 27, 2009 at 4:48 PM, felix <crucialfe...@gmail.com> wrote

Re: Django imagefield at development server

2009-01-27 Thread felix
do that when the code is the admin ? only if you have edited anything in django code base itself . On Tue, Jan 27, 2009 at 9:35 PM, Akhmat Safrudin <akhmat.safru...@gmail.com>wrote: > > felix wrote: > > no problem uploading using the dev server > > > > no idea.

Re: ContentTypes and fixtures

2009-01-29 Thread felix
ids. there would have to then be a part of the structure that resolved foreign key ids by a lookup in the host environment where the structure is being installed (eg looking up the content ids) the other use for this system would be federating data from site to site. felix :crucial

Re: free django hosting

2009-01-30 Thread felix
http://code.google.com/p/google-app-engine-django/ of course some restrictions apply your mileage may vary felix :crucial-systems.com On Sat, Jan 31, 2009 at 1:12 AM, xankya <suzan.sha...@gmail.com> wrote: > > hi, > anybody know free

remember me on this computer vs SESSION_EXPIRE_AT_BROWSER_CLOSE

2009-01-31 Thread felix
o approach this ? is it the SessionMiddleware that should be replaced ? felix :crucial-systems.com --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send e

Re: Autogenerate a Model on Save

2009-02-02 Thread felix
ave() # and if you are using that in the admin then add it to the admin too: class OrderAdmin(admin.ModelAdmin): form = OrderModelForm and register it felix :crucial-systems.com On Mon, Feb 2, 2009 at 8:50 PM, Alfonso <allanhender...@gmail.com> wrote: > > I

Re: Autogenerate a Model on Save

2009-02-02 Thread felix
obj.save() > > > # and if you are using that in the admin then add it to the admin too: > > class OrderAdmin(admin.ModelAdmin): > > form = OrderModelForm > > > and register it > > > > > > felix :crucial-systems.com > > > > O

Re: FileField and moving or updating files

2009-02-02 Thread felix
storage import default_storage default_storage.save( path, file) you can upload to "tempUploads/file.xxx" and then search for files whose names are still in tempUploads and thus not yet processed felix :crucial-systems.com On Mon, Feb 2, 2009 at 11:26 PM, timc3 <t...@timc3.com>

increasing upload speed

2009-02-03 Thread felix
experience with large uploads ? any wisdom to share ? felix :crucial-systems.com --~--~-~--~~~---~--~~ 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: FileField and moving or updating files

2009-02-03 Thread felix
ing a new path look at django.core.files.move felix :crucial-systems.com On Tue, Feb 3, 2009 at 8:24 PM, azimix79 <az...@cantemo.com> wrote: > > Hi, > I have the same problem as above. > I'm sure your solution works Felix, but it is important for me to > avoid resaving

dynamically assigning settings on startup with wsgi

2009-02-03 Thread felix
re a known difference or reason why this should not work ? thanks felix :crucial-systems.com --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send e

Re: dynamically assigning settings on startup with wsgi

2009-02-03 Thread felix
nevermind moral: if it seems illogical it probably is something else On Wed, Feb 4, 2009 at 12:38 AM, felix <crucialfe...@gmail.com> wrote: > > adict = { > 'DATABASE_PASSWORD' : "something" > } > > in settings.py : > > locs = vars() > for key,valu

Re: FileField and moving or updating files

2009-02-03 Thread felix
and btw. if you have any wisdom regarding uploading really large files then please share ! I posted another thread on that. On Tue, Feb 3, 2009 at 8:50 PM, felix <crucialfe...@gmail.com> wrote: > > oh if its already where you want it (as long as its in the MEDIA ROOT) > then ju

Re: increasing upload speed

2009-02-04 Thread felix
On Wed, Feb 4, 2009 at 2:48 AM, Malcolm Tredinnick wrote: > So if you're thinking that > those are the bottlenecks, rather than the network, actually I assumed the network *was* the primary bottleneck. I was just inquiring if anybody had experiences to share with

Re: Admin widget for geotagging

2009-02-05 Thread felix
its also on my to do list right now I have an ajax auto-complete for filling out the addresses, but I would prefer the one line google-geo-code version I like the way they did it here: http://djangopeople.net/ On Thu, Feb 5, 2009 at 10:19 AM, Ales Zoulek wrote: > > I

Re: how to do a three table join with django models

2009-02-05 Thread felix
Results.objects.all().select_related('profile','testcase') that was easy that's A join B,C if it was A join B join C (my example) class Release fk Artist class Artist fk Label class Label Release.objects.all().select_related('artist','artist_label') note selecting the C class

Re: Changing the structure of an already running site

2009-02-05 Thread felix
try deseb http://code.google.com/p/deseb/ Its ... magic (good and bad. mostly good in this case) I simply run: ./manage.py evolvedb and the SQL to be run is shown to me with the option to run it and then the option to save it as a schema evolution. the idea is that you would run it on

Re: Best practice question: subclassing external app components

2009-02-09 Thread felix
, registration etc. things from here are used on every site I work on 3 would be the best choice I think. for capitalizing the labels on fields you should try just doing css felix :crucial-systems.com On Mon, Feb 9, 2009 at 12:35 AM, zinckiwi <zinck...@gmail.com> wrote: > &

WeakForeignKey - on delete set null rather than delete me

2009-02-09 Thread felix
ents ? prior art that I didn't find ? easier solutions ? naming advice ? I'll happily write up a ticket and patch felix :crucial-systems.com --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Djan

ModelForm not saving fields that are not in the form

2009-02-11 Thread felix
y = self.cleaned_data['country'] self.instance.postal_code = self.cleaned_data['postcode'] return super(EditContactForm, self).save(commit) what do I have to do to get these fields to be saved ? thanks felix :crucial-systems.com --~--~-~--~~~---~--~~ You rec

Re: Really slow functional tests

2009-02-11 Thread felix
do you have large initial_data fixtures ? tables get flushed and initial_data is added each time. felix :crucial-systems.com On Wed, Feb 11, 2009 at 1:50 PM, Andrea Reginato <andrea.regin...@gmail.com>wrote: > > Hei guys, I've a question related to some tests I've make

Re: ModelForm not saving fields that are not in the form

2009-02-11 Thread felix
nevermind the admin class wasn't calling super() in save_model once again an hour of being stuck, then solved the problem minutes after posting On Wed, Feb 11, 2009 at 1:57 PM, felix <crucialfe...@gmail.com> wrote: > > I have fields in the model that do not appear in the form. &g

Re: Javascript problem

2009-02-13 Thread felix
use Firefox with Firebug installed if you aren't already. you can then see if you get any 404s and if any of the included files failed with syntax errors or if something happened during javascript runtime to kill it also, I like django-compress quite a bit for css and js felix :crucial

Re: Javascript problem

2009-02-13 Thread felix
.js is not loaded" in firebug. > > I don't see what to do next. What is strange also is that my > > background-body images are loaded on safari (no pb) and not on > > firefox... > > Any solution? > > thx > > > > On 13 fév, 18:19, felix <crucialfe...@gm

Re: Disabling middleware for tests

2009-02-16 Thread felix
that we are running as a test ? felix :crucial-systems.com On Mon, Feb 16, 2009 at 9:33 PM, stryderjzw <stryder...@gmail.com> wrote: > > > > from settings import * > > > > #CSRFMiddleware breaks authtests > > MIDDLEWARE_CLASSES = list(MIDDLEWARE_CL

Re: Django and php can they mix?

2009-02-17 Thread felix
if you don't have extensive pre-existing php (legacy) code I would say do it all in django. even if you wrote some already in php you will save more time by throwing it away and reimplementing in django then you will trying to make them co-exist or by trying to use a legacy db schema. if you

markdown fails, can't figure out how or why

2009-02-18 Thread felix
I'm getting a failure on my deployed server and I can't figure out what might cause it. I've gotten it a few times. something to do with markdown going to the URL myself (its fetching the RSS feed) doesn't trigger the error ! from the stack trace I have no way of knowing what went in can

Re: Modifying pythonpath in settings.py

2009-02-19 Thread felix
possible side effect: I wrote some class that runs during settings.py and customizes settings (dev/live/beta) it logs when doing that, and so I've noticed that settings gets parsed 4 times ! loading ENVIRONMENT: local_settings.py SITE_URL is: http://127.0.0.1:8000 loading ENVIRONMENT:

sporadic mysterious errors

2009-02-28 Thread felix
That its searching for 'crucial.default_rss' is some kind of clue. Any help or direction of where to investigate much appreciated. felix :crucial-systems.com --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google

http://code.google.com/p/django-ajax-selects/

2009-03-02 Thread felix
I've posted a working first draft for many-to-many and foreign-key lookups using jQuery. Works for any form including in the admin -f --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post

Re: Q search with foreign key

2009-03-03 Thread felix
use two underscores to address the other table/model institution_institution vs institution__institution django querysets rock ! On Tue, Mar 3, 2009 at 10:19 PM, Jesse wrote: > > I tried that option and received this error: > > Cannot resolve keyword

Re: ManyToMany relationship on self through other table

2008-09-30 Thread felix
are you actually getting a runtime error or an error when trying to syncdb ? On Sep 30, 10:52 am, chris <[EMAIL PROTECTED]> wrote: > Hi there, > > Just starting to use django, so forgive me if this has been answered > before (a quick search at djanog-search did not turn up something > useful).

Re: accessing the http conf setting: PythonOption django.root

2008-09-30 Thread felix
ah right, WSGI requests won't have this django_root environ var. so its the completely non-intuitive SCRIPT_NAME (I know, its the server that refers to it as this) this works : {% django_root %} @register.tag def django_root(parser,token): return DjangoRootNode() class

Re: ManyToMany relationship on self through other table

2008-09-30 Thread felix
probably don't want people to edit a Person on a form anyway and select from a long list. it would be an "add" or something, right ? On Sep 30, 1:31 pm, chris <[EMAIL PROTECTED]> wrote: > On Sep 30, 8:07 pm, felix <[EMAIL PROTECTED]> wrote: > > > are yo

Re: overwrite get_absolute_url /contrib/auth/User

2008-09-30 Thread felix
and related to this: if your django site needs to be running at someplace besides '/' (say for a beta installation or a subsite) then permalinks and reverse will work correctly, but user.get_absolute_url() will not it will return /user/username/ rather than /subsite/user/username/ so, def

Re: Using forloop counter to index into a query set

2008-09-30 Thread felix
malcom is suggesting this: def view(request): blah blah blah ... zipped = [] for p in products: v = find the vendor for this product zipped.append( ( p, v) ) # add them as a tuple # or more pythonically if its easy to find your vendor: zipped = [ (p, vendor

Re: egregiously long model names, hashes, constraints

2008-09-30 Thread felix
whoops, you are right. those weren't the same tables. two with the exact same tables are posted in the ticket: http://code.djangoproject.com/ticket/9253 On Sep 30, 3:23 am, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > Please open a new ticket about this. Looks like there is an assumption

Re: Using forloop counter to index into a query set

2008-09-30 Thread felix
rms ] >     context = { 'products': zipped } > >  {% for form, product in products %} >    {{product.vendor}} {{product.model_name}} {{product.model_num}} > {{form}} >  {% endfor % > > Any suggestions? > > On Sep 30, 9:45 am, felix <[EMAIL PROTECTED]> wrote: > >

Re: ManyToMany relationship on self through other table

2008-10-01 Thread felix
, chris <[EMAIL PROTECTED]> wrote: > Dear Felix, > > Thanks for following up on this.  I put the traceback up > here:http://paste.pocoo.org/show/86707/ > > I will try to follow your advice to work around the error and define > the tables differently, since you are right about

Re: Custom fields (a repost)

2008-10-01 Thread felix
did you look through this: http://www.djangosnippets.org/snippets/1097/ which is similar > Now this is where I lose the plot: > a. How to get it to validate. (clean and co.) when you select the desired whatever it should put it into the form's hidden field as an id or text field so that's

Re: Boosting your productivity when debugging Django apps

2008-10-06 Thread felix
yes, I get this all the time. the input that I type isn't echoed to the screen/output but it does work. its really annoying. has anyone figured out why or if there's a cure ? otherwise I love using pdb, its invaluable. On Aug 22, 9:33 pm, Tim Chase <[EMAIL PROTECTED]> wrote: > >    

bug?: get_%s_display on CharField with choices (select field)

2008-10-09 Thread felix
bug?: get_%s_display on CharField with choices (select field) I think I found a bug. I'm using a select input type widget by passing in 'choices' to a CharField given: class ReleaseFeedback(models.Model): RATINGS = ( (1,'*'),(2,'**'),(3,'***'),(4,''),(5,'*') ) rating =

Re: bug?: get_%s_display on CharField with choices (select field)

2008-10-10 Thread felix
On Oct 10, 3:08 am, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > > I think I found a bug. > You have, but it's in your code, not Django. :-) brilliant :) yeah I wasn't entirely sure. it smelled like a bug. > If you look at ReleaseFeedback.get_rating_display at the > interactive prompt,

Re: Why does MySql gives warning? Incorrect string value: '\xE6\x9D\xB1\xE8\xA8\xBC...' for column 'title' at row 1

2008-10-12 Thread felix
thanks too for this. rather than alter the table manually of course, it should have been created correctly the first time. mysql will create new tables with the character encoding of the database. you can set that this way: alter database cruxxial_md CHARACTER SET = utf8; now tables created

Re: Possible pug with Model inheritence - Inserts instead of Update

2008-10-12 Thread felix
well this is interesting and curious what you are trying to do. why are you trying to do this self.id= None ? what is the real world purpose ? can you give a non abstract example ? in any case since Bar is a subclass of Foo there are two database tables. you set Bar id to None, but the object

Re: Possible pug with Model inheritence - Inserts instead of Update

2008-10-12 Thread felix
s None, Django does an Insert, I want an > insert to happen all the time. (Sort of like trying to get > FullHistory, wherein I can roll back my object to a previous state. I > can do save(force_insert = True), but that also gives me an > Exception.) > > On Oct 12, 6:32 pm, felix

Re: How can I check which view is being called in response to a specific Url?

2008-10-12 Thread felix
another way is to use the javascript Bookmarklet. go to Documentation > Bookmarklets also the debug footer http://www.djangosnippets.org/snippets/766/ is very useful, I just added in the code erik allik posted: from django.core.urlresolvers import resolve view_func, args,

Re: Keeping track of song play count in django and flash

2008-10-12 Thread felix
i'm looking at this problem too. 1. either the flash player can send a javascript/ajax ping to a url where it can be logged 2. or the songfile can be a django served url which logs and then redirects to the actual static URL. probably the second is easiest. On Oct 10, 9:28 pm, M Godshall

Re: get_object_or_404 error

2008-10-15 Thread felix
you are doing it correctly for normal django. its something to do with the Poll model that you are getting from google app engine sorry I can't help more than that. -felix jseleuco wrote: > Hi all, > > Just started today with the Python, Django and Google app engine and > having

html in feed description

2008-10-15 Thread felix
For either RSS and Atom feeds, I want to return html in the feed item's description: post_feed_description.html but the content including the CDATA tag is escaped: ... ![CDATA[ pa href="http://www.mutato.com/ beautifulmutants/html/gallery/mharper.html"img src="http://

Re: Custom template tag problem: "No module named models"

2008-10-15 Thread felix
this gets me every time. the error is yes because the template tag is called bookmarks.py and its inside a module called bookmarks.py rename it to bookmarks_tags.py ... and now DELETE THE DAMNED OLD bookmarks.pyc file ! python is still finding the old compiled file. its happened to me

Re: Custom template tag problem: "No module named models"

2008-10-16 Thread felix
enamed). > > Like I said before, when I take out the import line (from > bookmarks.models import Bookmark) the library loads (even when called > bookmarks.py) and only hits an error when it tries to access > Bookmark.objects.all(). > > > > On Oct 15, 6:22 pm, felix <[EMAIL PR

Re: everything works except apache seeing django app

2008-10-16 Thread felix
possibly it may be on YOUR pythonpath but it won't be on apache's pythonpath. here is my /etc/apache2/extra/httpd-vhosts.conf # SUSTAIN BETA PythonPath "['/home/crucial/gitpo/djapps','/home/crucial/gitpo/pluggables','/home/crucial/gitpo','/home/crucial/gitpo/sustain'] + sys.path"

Re: everything works except apache seeing django app

2008-10-16 Thread felix
is your app like this testSite __init__.py models.py settings.py etc. ? ie. its not one folder deeper testSite actualSite __init__.py models.py settings.py and did you restart apache ? flix >

Re: delete tables

2008-10-17 Thread felix
here's what I'm using: from django.core import management from django.db import connection cursor = connection.cursor() # don't delete these tables # note that I'm also keeping auth_user tables =

Re: [solved] Re: delete tables

2008-10-17 Thread felix
Busico <[EMAIL PROTECTED]>wrote: > Wanderful! > This was exactly what I needed! > > There is any documentation about "call_command" and the other commnds you > used? > > > Thanks alot. > Mirto > > felix ha scritto: > > > here's what I'm us

Re: problem testing application named "core"

2008-10-22 Thread felix
most probably, yes. core contrib db dispatch etc... are all django's apps/modules and that is probably what was running surprisingly I don't see tests.py in core, db etc. those tests must live elsewhere. there are tests for some of the contrib apps also don't name a templatetag the same name

Re: Creating a system with multiple types of users

2008-10-22 Thread felix
perhaps when you create-save the models (Providers, Customers etc.) it adds that User to the appropriate group. but I'm not sure I would use groups. That would make the most sense if there were people with overlapping roles. somebody who is Agent + Provider you could use the permissions

Re: Permissions in template tags

2008-10-22 Thread felix
the easiest way is to pass in the context to the template tag : @register.inclusion_tag("edit_link_tag.html",takes_context=True) def edit_link_tag(context,obj,name=None): """returns a link to edit the model if you have permission to do so """ user = context['user'] and so on

Re: emulate existing session in automated test

2008-10-22 Thread felix
look at RequestFactory: http://groups.google.com/group/django-developers/browse_thread/thread/db86050095ebe5db?pli=1 which would mean not calling post, but calling the view directly I've written a custom Unit test class just for views that's proving quite useful, but it doesn't yet do this

Re: Different settings.py files for server and development

2008-10-23 Thread felix
at the very bottom of settings.py : from local_settings import * this overwrites just the imported keys/values -flx On Thu, Oct 23, 2008 at 11:55 PM, Dana <[EMAIL PROTECTED]> wrote: > > Hello everyone, > > I know a form of this question has been asked before on this group but > I can't for

Re: wrong redirect from admins "View on site" link

2008-10-25 Thread felix
its gets the domain value from the Site object. I'm guessing that you have that domain set to "localhost" the view that actually does the relocation is at django.contrib.contenttypes.views shortcut site = Site.objects.all()[0] site.name site.domain site.domain = "127.0.0.0:8000" site.save()

Re: Multi-Table Inheritance

2008-10-25 Thread felix
yes, it should work fine. use the admin of the forms just as for any single table model -flix On Fri, Oct 24, 2008 at 7:47 PM, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > Does anyone have any suggestions on how to use mutli-table inheritance > with model forms or some other way of

Re: Receiving emails via app

2008-10-26 Thread felix
of your apps avail to you) or import the settings and the most minimal amount of django that you'll need. or if you are really lazy, just write a view that processes the mails and set a cron to fetch the page every once in a while ( just wget or curl it ) -felix On Sun, Oct 26, 2008 at 8:13

Re: Can python/django match the features of php/zend framework?

2008-10-26 Thread felix
python libraries are in general much much better than php libraries. besides django itself, there's a wealth of usable and well maintained libraries. I've been working with gdata, and its very nice: _youtubeGDataHost = 'gdata.youtube.com' _youtubeFeedBase = '/feeds/api/' import gdata

Re: Model inheritance question

2008-11-02 Thread felix
see also this: http://www.djangosnippets.org/snippets/1031/ for a tumblelog I have been actually fetching queries for each item type, concatenating them as lists, then sorting by date. that's much simpler since its usually mostly display. I mostly use model inheritance in situations where I need

Re: Logout- Back Button

2008-11-14 Thread felix
this is not a django issue, but a browser issue. you can solve it only with javascript. either clear the browser history (so that there is no back) or put something on the page(s) that checks for the auth cookie either whenever the page is loaded/fronted or checks it periodically. if the auth

get_or_create and foreign keys

2008-12-06 Thread felix
this is not the issue previously posted by somebody else. I think I found a bug with Manager get_or_create and foreign key fields when specifying with foreigntable__id class ObjectPermission(models.Model): permission = models.CharField(blank=False, max_length=20) user =

Re: TextMate Django Bundle

2008-12-17 Thread felix
its called Python Django Templates but actually its an HTML mode look under the HTML alphabetically and thanks to whoever made this ! very useful. On Wed, Dec 17, 2008 at 11:11 PM, Adam Nelson wrote: > > Does anybody have this working in TextMate? > > "Python Django

Re: django and favicon.ico problem

2008-12-17 Thread felix
you can put it directly in your http-vhosts.conf file ServerName crucial-systems.com DocumentRoot /home/crucial/crucial-stack/crucialwww ... etc... Alias /favicon.ico "/home/crucial/crucial-stack/crucialwww/favicon.ico" ... WSGIScriptAlias /

Re: MySpace clone using Django? Is it possible?

2008-12-20 Thread felix
oh for that you will need to use Fusebox On Fri, Dec 19, 2008 at 7:41 PM, lekvar...@gmail.com wrote: > > Hi, I wanna know wich of the well known frameworks is the best choice > for myspace-clone community website. > > CakePHP ? Zend Framework? Symfony? > Django :)? >

Re: Restricting add in the admin

2008-12-20 Thread felix
just a thought: you might consider allowing multiple front page objects and having a way to select the current one. this could come in handy to switch what is currently the front page (or to audition the new front page). otherwise : create one using initial_data so that your application

Re: SyncDB failure

2008-12-20 Thread felix
On Fri, Dec 19, 2008 at 2:29 PM, James PIC wrote: > > On 12/17/08, Russell Keith-Magee wrote: > > > > > A better solution would be to come up with a name munging scheme that > > guaranteed to give unique permission names that will always fit into

Re: SyncDB failure

2008-12-20 Thread felix
here's the exact ticket you are looking for: http://code.djangoproject.com/ticket/1820 On Sat, Dec 20, 2008 at 2:19 PM, felix <crucialfe...@gmail.com> wrote: > > On Fri, Dec 19, 2008 at 2:29 PM, James PIC <james...@gmail.com> wrote: > >> >> On 12/17/0

Re: model inheritance and admin (qs-rf & nf-a)

2008-06-21 Thread felix
! On 19 Jun., 22:01, felix <[EMAIL PROTECTED]> wrote: > I second that.  I've just spent the day quite happily refactoring my > app to use niftymodelinheritance... and the admin doesn't work. > whoops. > > I think this should be stated in the docs for sure. > > On Jun 2

ModelInheritance : how to do isinstance() on a parent class object

2008-06-28 Thread felix
Contact Company(Contact) Person(Contact) If I have a Contact it might be a Person or a Company and I'm looking for the best way to find out. Especially in cases where I'm listing these objects, doing a separate trial and error database query (as I show below) isn't the best solution. Actually

Re: ModelInheritance : how to do isinstance() on a parent class object

2008-06-29 Thread felix
On Jun 29, 1:28 am, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > > Actually it might be nice if the top parent class table had a > > content_type field (or similar to avoid coupling to > > contrib.contenttypes) so we could easily deduce the leaf class. > > ...The reason is that it > breaks

Re: ModelInheritance : how to do isinstance() on a parent class object

2008-06-29 Thread felix
content_type = self.content_type model = content_type.model_class() if(model == Contact): #actually we could also check if self is not Contact that throw a shit-out-of-wack error return self return model.o

Re: tweaking auth, making usernames unique within a company

2008-07-07 Thread felix
do you mean that you want someone to be able to have a duplicate username as long as they are at a different company ? if so, why ? maybe that requirement should just be worked around. but there is certainly a way to do it without hacking User. -f;lix On Jul 7, 4:58 pm, brydon <[EMAIL

common problem: set author, update date on save

2008-07-07 Thread felix
I'm using newforms-admin This is a very common situation: on saving a Post wish to set the author to be request.user wish to set created_on and updated_on perhaps wish to set request ip address but it is actually the form object that does the saving. but IMO none of these things are on the

Re: reverse not working with (r'^comments/(.*)', include('django.contrib.comments.urls')),

2008-09-09 Thread felix
Tredinnick <[EMAIL PROTECTED]> wrote: > On Sun, 2008-09-07 at 06:18 -0700, felix wrote: > > This should be dirt simple, but isn't working: > > > main urls.py : > >  (r'^comments/(.*)', include('django.contrib.comments.urls')), > > This pattern says you want to *c

Re: Customized ManyToMany in Admin

2008-09-12 Thread felix
now this will hit the database for each item in the select, to go fetch the language object to get the language name. so for extra credit, where do we add a select_related() for the widget ? On Sep 12, 7:43 pm, TiNo <[EMAIL PROTECTED]> wrote: > Probably more like: > def __unicode__(self): >  

apache PythonPath problem + solution

2008-09-28 Thread felix
Hello, I wrote up this big problem to ask you kind folx for help, and in the course of that I figured it out. But I'm still going to post it just to share the experience. I have an apache config problem, maybe someone can help. I am setting up the production version on my site : apache conf

Re: apache PythonPath problem + solution

2008-09-28 Thread felix
better explain this, but > when I pushed that in the past others felt it was clear enough > already. Despite that, people still have problems, that or people > don't actually read the documentation. :-) > > Graham > > On Sep 29, 10:39 am, felix <[EMAIL PROTECTED]> wrote: > > >

Re: unable to resolve URL in template

2008-09-28 Thread felix
is it actually called url.py or urls.py ? maybe you don't have the urls file in there that you are assuming you do. try inserting an egregious syntax error in there just to see if its even being loaded. On Sep 27, 8:21 pm, Chuck Bai <[EMAIL PROTECTED]> wrote: > In my url.py, I define the root

Re: relating auth user to company model

2008-09-29 Thread felix
since you can't add fields to User, you should add it to Company Company employees = models.ManyToManyField(User,editable=False) # a user can actually be in several companies user.company_set.all() this is because the Company model is allowed to contribute to the User class

egregiously long model names, hashes, constraints

2008-09-29 Thread felix
syncdb fails on my deployment server (mysql 5.0.67 on ubuntu) with : File "./manage.py", line 11, in execute_manager(settings) ... _mysql_exceptions.OperationalError: (1059, "Identifier name 'releasesnewsletter_id_refs_abstractmailing_ptr_id_62770683bbc11c0b' is too long") the same

Re: Using forloop counter to index into a query set

2008-09-29 Thread felix
it might be easiest to write a custom tag there {% vendor_of_product product forloop.counter %} is product an array ? On Sep 30, 2:31 am, SnappyDjangoUser <[EMAIL PROTECTED]> wrote: > Hi Folks, > > How can I use a forloop counter to index into a query set as in the > example below? > > (I

accessing the http conf setting: PythonOption django.root

2008-09-29 Thread felix
I'm trying to fix some urls in my templates these are urls linking to the admins site that cannot use the {% url %} tag or reverse. these urls are "absolute" in that they don't use reverse (which is preferable, god bless django) but the admin urls are not addressable by name, so I link to them

custom form in admin debugging confusion

2009-03-29 Thread felix
class ContactAdmin(Admin): form = EditContactForm EditContactForm has a save method that is never called by the Admin but its clean() function does get called 60 def clean(self): 61 import pdb; pdb.set_trace() my confusion is that due to the snakey admin code the

Re: how to use email instead of username for user authentication?

2009-04-07 Thread felix
I use an EmailBackend for auth, found on django snippets http://www.djangosnippets.org/snippets/74/ (though the one pkenjora posted looks the same but slightly better.) and a generate_username to create a clean unique username when creating accounts, also found on django snippets

  1   2   3   >