Auction app

2009-02-01 Thread Erik Allik
Does anyone know of an app written for Django that implements a kind of (simple) web-auction functionality suitable for, say, selling arts, valuable old books, or just random items? Erik --~--~-~--~~~---~--~~ You received this message because you are subscribe

Apps and static/media files

2009-01-29 Thread Erik Allik
I'm having a situation in which two of my reusable apps both use FCKeditor in their admin interface. Since both of them require FCKeditor library files, I'm confused which one should provide them? Both? How? What is the idiomatic/standard way of doing this? Should I instead have them both

Re: Weird error when doing loaddata

2008-11-22 Thread Erik Allik
Django should throw a warning in cases like this, or even prefer the fixture located in the working directory instead. I know the current behavior is documented but it doesn't mean it's intuitive. Regards, Erik Allik On Nov 23, 1:41 am, "Russell Keith-Magee" <[EMAIL PROTECTED]&g

Weird error when doing loaddata

2008-11-22 Thread Erik Allik
I'm doing django-admin.py loaddata with a JSON file containing just [], i.e. an empty fixture, to rule out any possibility of invalid data being in the fixture, but still getting the following traceback: http://dpaste.com/92961/ The DB schema is in sync with the model definitions. The applicatio

Re: edit_inline does not save?

2008-10-28 Thread Erik Allik
Which version of Django are you using? edit_inline is deprecated (or even removed) in Django 1.0. You should be using admin inlines instead. Erik On 28.10.2008, at 12:47, Daniel Austria wrote: > > Hello, > > i got a huge problem. I have got an Idea class and an ideacomment > class. You can gu

Re: How to get site's root url path in Django

2008-10-28 Thread Erik Allik
I don't think you need to even know the root URL as Django takes care of this automatically. Check the mod_python documentation for details. mod_wsgi and FastCGI deployment methods should take care of this transparently. Erik On 28.10.2008, at 8:28, yuanyun.ken wrote: > > Hi, all great Dj

Re: customize auth.users

2008-10-27 Thread Erik Allik
I'd suggest maybe inheriting your custom User admin class from the original one and only override stuff you need so you can automatically take advantage of future changes in contrib.auth. Erik On 27.10.2008, at 12:52, Alfredo Alessandrini wrote: > > I've solve whit this: > > http://wolfram

Overriding admin inline form field

2008-10-23 Thread Erik Allik
Hey, I need to specify the queryset attribute of a ModelChoiceField that's inside a form of an admin inline, but when I set the form field's required attribute to False, I get: Cannot assign None: "MyModel.my_inline_model" does not allow null values. I tried with both required=Tru

Re: select_related and m2m

2008-10-20 Thread Erik Allik
Sorry, found this: http://code.djangoproject.com/ticket/6432 I think I will probably just denormalize. Erik On 20.10.2008, at 17:22, Erik Allik wrote: > > I've a feeling that this has been brought up before so my apologies > just in case my feeling is right! >

select_related and m2m

2008-10-20 Thread Erik Allik
I've a feeling that this has been brought up before so my apologies just in case my feeling is right! I'm doing a qs = MyModel.objects.all().select_related("foobars") where foobars is a m2m relation. Later when doing qs_item.foobars.all(), a database hit is generated. Is this a bug, a featu

Re: Custom Template Tag with {% end... %} tag

2008-10-20 Thread Erik Allik
I guess it was easier for me to type it myself than search through the new documentation. :) Erik On 20.10.2008, at 5:49, James Bennett wrote: > > On Sun, Oct 19, 2008 at 4:20 PM, Erik Allik <[EMAIL PROTECTED]> wrote: >> In the compilation function of your template tag,

Re: filter OR for results...

2008-10-19 Thread Erik Allik
CollegeTeam.objects.filter(team=game.team1) | CollegeTeam.objects.filter(team=game.team2) But I would instead recommend: CollegeTeam.objects.filter(team__in=[game.team1, game.team2]) Erik On 20.10.2008, at 1:22, [EMAIL PROTECTED] wrote: > > I have a model that is tracking all of the college

Re: Custom Template Tag with {% end... %} tag

2008-10-19 Thread Erik Allik
In the compilation function of your template tag, you can force the parser to parse until tag named "endyourcustomtag" by calling nodelist = parser.parse(("endyourcustomtag", ). This will return the contents of your block tag as a list of nodes. Finally you can "drop off" the end tag by ca

Re: delete tables

2008-10-17 Thread Erik Allik
$ manage.py dbshell > DROP TABLE table_name; Django does not currently have a database schema management tool (with the exception of syncdb and sql* commands). Erik On 17.10.2008, at 15:30, Mirto Silvio Busico wrote: > > Hi all, > > what is the django way o deleting all table content and r

Re: Best practice to build a multilingual site

2008-10-13 Thread Erik Allik
I'd add a "lang" field to News and retrieve news based on whether the URL starts with /en/, /sp/ ,/ru/ etc. Erik On 13.10.2008, at 18:48, Alex Rades wrote: > > Hi, > if we have a model like: > > class News(models.Model): >title = models.CharField(..) >content = models.TextField(...) >

Re: 404 not found for media files

2008-10-13 Thread Erik Allik
ocessor activated and also do I need to pass the MEDIA_URL > value into the template from the views/urls? > > Many thanks again > > Huw > > On Oct 13, 10:54 am, Erik Allik <[EMAIL PROTECTED]> wrote: >> First of all, you should set MEDIA_URL to '/media/&#x

Re: 404 not found for media files

2008-10-13 Thread Erik Allik
First of all, you should set MEDIA_URL to '/media/' and Alias /media as /var/www/django_projects/proj_name/media/ or use mod_rewrite. Then you should instead request for {{ MEDIA_URL }}test.js not the hardcoded /media/test.js. This requires that you have request context processor activated

Uploaded file permissions

2008-10-13 Thread Erik Allik
I've discovered that uploading a 1.3MB file results in the file being created with chmod 755, three other files (3.2, 4 and 7.6MB) are created with chmod 600. I discussed this in #django and got told that this is due to larger files being stored in temporary files which might affect permis

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

2008-10-12 Thread Erik Allik
from django.core.urlresolvers import resolve view_func, args, kwargs = resolve('/your/url/here/') print '%s.%s' % (view_func.__module__, view_func.__name__) Erik On 12.10.2008, at 21:38, shabda wrote: > > One of my views is returning a Http404, and I think it is calling a > view function diffre

Re: Access a model's original get_absolute_url

2008-10-09 Thread Erik Allik
that is, AFTER i wrote my previous letter. Erik On 09.10.2008, at 11:32, Erik Allik wrote: > > Carl is right, yes. I realized this myself a few hours before I wrote > my previous letter. :) I actually even WANT to do this after the > ABSOLUTE_URL_OVERRIDES stuff. > > Erik >

Re: Access a model's original get_absolute_url

2008-10-09 Thread Erik Allik
Carl is right, yes. I realized this myself a few hours before I wrote my previous letter. :) I actually even WANT to do this after the ABSOLUTE_URL_OVERRIDES stuff. Erik On 09.10.2008, at 6:00, Carl Meyer wrote: > > On Oct 8, 2:30 pm, Erik Allik <[EMAIL PROTECTED]> wrote: >

Re: Access a model's original get_absolute_url

2008-10-08 Thread Erik Allik
I've thought about this but I'm not sure how. Is there a hook/signal that gets fired when all models have been loaded but ModelBase._prepare hasn't run? Erik On 08.10.2008, at 16:38, Carl Meyer wrote: > > > > On Oct 8, 5:29 am, Erik Allik <[EMAIL PROTECTED]>

Re: static html

2008-10-08 Thread Erik Allik
First of all, why don't you just point the browser at the URL of the commands.html file in the first place? > def list_commands(request): >commands = open('home/.../commands.html') >return HttpResponse(commands) >commands.close() Secondly: when do you suppose the last line of t

Re: Access a model's original get_absolute_url

2008-10-08 Thread Erik Allik
> This does hint that you're using the wrong shovel to hammer in your > screws, however. You've said that you want to change that URL, always. > Hence it's in ABSOLUTE_URL_OVERRIDES. Later you are effectively saying > "no, just joking... I don't want it overridden all the time". If it's > only mea

Access a model's original get_absolute_url

2008-10-07 Thread Erik Allik
Hi everybody, I need a way to access a model's original get_absolute_url after the ABSOLUTE_URL_OVERRIDES settings has taken effect. Currently I've patched Django for this need so it will always alias the existing get_absolute_url method as old_get_absolute_url when it overrides that meth

Re: Sadly shifting to php sob sob. Need help finding right framework

2008-10-06 Thread Erik Allik
I've lately noticed that Drupal is very cool, especially if you know Django. The URL system is similar, source code is elegant and lightweight, it does have forms, and the framework provides a lot of stuff out of the box plus a lot of reusable modules (like Django apps). Erik On 06.10.2008

Re: Flatpages, get_absolute_url() and ABSOLUTE_URL_OVERRIDES

2008-10-05 Thread Erik Allik
Malcolm, what if I did the from django.core.urlresolvers import reverse part in the function itself that gets called? def my_flatpage_url(o): from django.core.urlresolvers import reverse return '%s%s' % (reverse('my-site-index'), o.url) ABSOLUTE_URL_OVERRIDES = { 'flatpages.flatpage'

Re: Flatpages, get_absolute_url() and ABSOLUTE_URL_OVERRIDES

2008-10-04 Thread Erik Allik
from django.core.urlresolvers import reverse def get_flatpage_absolute_url(o): return '%s%s' % (reverse('site-index'), o.url) ABSOLUTE_URL_OVERRIDES = { 'flatpages.flatpage': get_flatpage_absolute_url } Actually I think this would work too: ABSOLUTE_URL_OVERRIDES = { 'flatpag

Re: Editable template code in admin?

2008-10-03 Thread Erik Allik
class Snippet(models.Model): name = models.CharField() code = models.TextField() then write a template tag that takes the name of a Snippet, does snippet = Snippet.objects.get(name=name), and outputs the result of Template(snippet.code).render(). Basically you simply have to

Re: django performance with cache on dreamhost.

2008-10-03 Thread Erik Allik
Have you profiled your application? How many SQL queries is it doing during a request processing cycle? You could write a web app in pure asm code and still get 1 req/sec if you did something really stupid in your code so it's not generally about Django. Erik On 03.10.2008, at 16:32, Ales

Re: Django model version control

2008-10-03 Thread Erik Allik
What if, for each model under version control, you'd create an identical table (except the ID field would be a foreign key, not a primary one). Any time a migration is run on that model, the same migration could be run on the "twin" table, too. Erik On 02.10.2008, at 18:34, David Hall wrot

Re: Are a lot of people using SQLAlchemy with Django?

2008-10-02 Thread Erik Allik
There is a SQLAlchemy DB backend for Django that allows you to write Django ORM models on top of a SQLAlchemy ORM layer. But that's just if you need the Django ORM. For example if you want to use a database engine that is not supported by Django but is supported by SQLAlchemy. Or I guess i

Re: How to Create Real Foreign Keys

2008-10-01 Thread Erik Allik
Are you using the MyISAM or InnoDB storage type? MyISAM does not support integrity constraints, afaik. Erik On 01.10.2008, at 16:44, Chris wrote: > > I'm running MySQL as my backend, and I've noticed Django doesn't > create "real" foreign keys for the ForeignKey column. Just indexes. Is > thi

Re: How to invoke a request to an URL inside a web app without making a real request?

2008-10-01 Thread Erik Allik
Don't forget to modify the request object that you pass to the view accordingly if the view actually uses it or passes it to a function that does. Otherwise you may run into weird bugs. Erik On 01.10.2008, at 14:13, bruno desthuilliers wrote: > > On 1 oct, 09:52, maverick <[EMAIL PROTECTED]

Re: Using mod_python with Lighttpd - advice on the best set up

2008-09-30 Thread Erik Allik
Apache can also start/restart your FastCGI process(es) as needed. Erik On 30.09.2008, at 13:33, Graham Dumpleton wrote: > > > > On Sep 30, 8:24 pm, Kip Parker <[EMAIL PROTECTED]> wrote: >> After both your replies and some googling I'm starting to lean >> towards >> a FastCGI set up of some so

Re: image path in CSS - won't work???

2008-09-30 Thread Erik Allik
You should always use paths relative to the CSS file. Like this: url(../img/menu.jpg) Btw did you try going to that image file from the browser? If you're using the built in development server, you need to set up static file serving. Erik On 30.09.2008, at 12:13, Bobo wrote: > > Hi ever

Re: Integrating into PHP-based site...

2008-09-29 Thread Erik Allik
For look-and-feel, check out http://www.openplans.org/projects/deliverance/ If you need to share logic/data, you could have either side expose a lightweight data feed (XML or JSON). Or as a simpler (but maybe not as elegant) alternative you could simply share parts of the same database. Erik

Re: Best way to preserve a queryset across GETs?

2008-09-29 Thread Erik Allik
Forgot to say, you need a way to clean up the Search model's table from time to time using a cron job or similar or otherwise you may run into problems. An expiry_date field on the Search model would be necessary to decide which searches to delete. You have to realize, though, that this ap

Re: Best way to preserve a queryset across GETs?

2008-09-29 Thread Erik Allik
It can be achieved using a Search model, but only if you only need search on a single model. class YourModel(models.Model): ... clsss Search(models.Model): yourmodels = models.ManyToManyField(YourModel) So the search form is POST not GET. After POST'ing, you do the searching, then crea

Re: Q - returning a data to the template. (many models).

2008-09-28 Thread Erik Allik
Since a Company could have multiple Products, it's not really possible to show the product as well with the way you do the querying. I would instead do a search on the Product model and then simply iterate over the resulting products displaying the company for each of them, too: def search(

Re: Where to put signals?

2008-09-28 Thread Erik Allik
was made on, > so it will be better to wire up each model. > > Thanks again anyway, > benjamin > > Am 28.09.2008 um 17:14 schrieb Erik Allik: > >> The way I see it is that your comment notification is not tied to >> any particular application that has commentable mod

Re: Where to put signals?

2008-09-28 Thread Erik Allik
The way I see it is that your comment notification is not tied to any particular application that has commentable models but instead is more like a project related thing. So depending on your source layout, I'd put them somewhere in the project. Basically this relates to the application reu

Re: recommended method for administrative scripts?

2008-09-26 Thread Erik Allik
With sorl.thumbnail you don't have to do that at all. It allows you to specify resize size on the fly, then caches the resulting image and always recreates the image if the size changes automatically. Erik On 26.09.2008, at 22:50, ssam wrote: > > Hello > > I have just made my first django s

Re: Apache with home directory Django

2008-09-26 Thread Erik Allik
of python out of my home dir. It's not > hard... All you need to do is to compile your own version of python > (or use your hosts mine was 2.3 so i got 2.5.1) and change your > PATH. Everything should work from there. > > James > > On Fri, Sep 26, 2008 at 6:01 AM,

Re: How to get unique names for items in admin site

2008-09-26 Thread Erik Allik
You might want to remove the id field as it's not needed. You also might consider converting siteid and authid to ForeignKey fields to the Model that corresponds to the table that these fkeys are referencing. So if you have Auth and Site models, you could do: site = models.ForeignKey(Site,

Re: shared model

2008-09-26 Thread Erik Allik
You don't have to put your model to the root of your project to be able to share it amongst your apps. You can reference models across applications. You might consider creating another application for that shared model, too. Erik On 26.09.2008, at 15:46, Gabriel Rossetti wrote: > > Gabrie

Re: nested applications and syncdb question

2008-09-26 Thread Erik Allik
This might be off topic, but maybe you should consider splitting your application into multiple smaller reusable applications? If the models of a single application need categorizing, you might have a sign of needing to split them up. A talk on reusable applications by James Bennet from Dja

Re: Apache with home directory Django

2008-09-26 Thread Erik Allik
ed environment for your project. If you have SSH access to the hosting machine which you hopefully do, you should be able to compile anything you might need for the environment such as database drivers or PIL and any other extensions that require compilation. Regards, Erik Allik On 26.

Re: OS path in python

2008-09-22 Thread Erik Allik
Shouldn't that be os.path.abspath(os.path.dirname(__file__)) instead just in case the .py file is executed with a relative path? And Bobby, I would instead use the Sites framework to compute the URL of the site, not rely on a local folder name. Erik On 23.09.2008, at 0:51, Plamen Dragozov w

Re: MooTools

2008-09-22 Thread Erik Allik
You should consider Pinax at http://pinaxproject.com/. Cloud27.com is powered by Pinax. It's a community site platform you can customize to your needs. Erik On 22.09.2008, at 22:14, Xenocide001 wrote: > > i was wondering how to make django project along with Mootools, the > project itself i

Re: Where can a save confirmation page be hooked into the admin? (similar to delete confirmation)

2008-09-22 Thread Erik Allik
> confirmation page and just a few lines of code. > > Thanks, > Jacob > > On Sep 22, 6:40 pm, Erik Allik <[EMAIL PROTECTED]> wrote: >> You should check out the ModelAdmin class and how to override certain >> parts of it such as the save_model, change_view and add_v

Re: Where can a save confirmation page be hooked into the admin? (similar to delete confirmation)

2008-09-22 Thread Erik Allik
You should check out the ModelAdmin class and how to override certain parts of it such as the save_model, change_view and add_view methods. Hope that helps. Erik On 22.09.2008, at 13:08, Jacob Rigby wrote: > > I want to emulate the delete confirmation page behavior before saving > certain mo

Re: Django + Active Directory + Firebird DB ???

2008-09-22 Thread Erik Allik
Hi and welcome to Django! On 22.09.2008, at 11:39, Bubblegum wrote: > I am searching for a solution to following problem. I was asked to > write a simple web UI for particular organization, who uses M$ Active > Directory for authentication/authorization purposes. Moreover their > DBs are Firebir

Re: Adding www. prefix to get_absolute_url

2008-09-21 Thread Erik Allik
You should instead use named URLs and the django.core.urlresolvers.reverse function in your get_absolute_url methods. That way you'll leave it to the URL system to handle. I believe you shouldn't use absolute URLs (with http:// and domain) at all. Just make sure in your web server config t

Re: credit card transactions

2008-09-20 Thread Erik Allik
You should check out Satchmo. They've got the satchmo.payment app but it's not yet usable as a standalone app as far as I'm aware (there are plans though I've heard). You can check out Satchmo's source code if you're interested. Maybe you can even help refactor it to be more usable as a st

Re: webfaction django installation

2008-09-20 Thread Erik Allik
You'll have to set up another app for serving static media using the control panel. I used a separate subdomain for that app as well to speed up media loading by browsers but that's optional. Then simply use the URL of that app as your MEDIA_URL. Erik On 21.09.2008, at 0:28, Bobby Roberts

Re: DJANGO 1.0 : How to avoid converting to entities

2008-09-20 Thread Erik Allik
djangobook.com is outdated. It states that it covers "0.96 and higher", but the "and higher" part is misleading because it doesn't cover 1.0 as far as I know. Erik On 20.09.2008, at 15:49, tsmets wrote: > > OK ! > I found it : http://code.djangoproject.com/wiki/AutoEscaping > > {% autoescap

Re: DJANGO 1.0 : How to avoid converting to entities

2008-09-20 Thread Erik Allik
Django auto-escapes all variable output in templates. You can read the docs about this. Erik On 20.09.2008, at 15:32, tsmets wrote: > > > I am writting a home brewed version of http://dpaste.com > I manage to convert/colorize most the code with pygment. > > However when I print the content of

Re: specifying MEDIA_URL in CSS files

2008-09-19 Thread Erik Allik
I still can't understand why you can use relative URLs to images in your CSS files. If you keep your CSS files together with your image files, nothing will break if you move them to another URL. Sorry if I'm missing something obvious. Erik On 18.09.2008, at 20:56, MrJogo wrote: > > Erik: I

Re: Application Best Practices - Please advise!!

2008-09-17 Thread Erik Allik
A video from DjangoCon 2008 by James Bennett about exactly the same thing: http://www.youtube.com/watch?v=A-S0tqpPga4 Erik On 17.09.2008, at 16:13, WillF wrote: > > > Hi I am new to django and python, and I have a question about best > practices > with regards to applications. From what I

Re: How to attach file with send mail

2008-09-17 Thread Erik Allik
A few months ago I had a similar need and I believe the documentation helped me out. Erik On 17.09.2008, at 11:23, laspal wrote: > > Hi, > I wanted to know how I can attach a file while sending mail to the > user. > Sending mail is working fine but now I have to send a file with a > mail. > W

Re: Absolute URL vs Relative URL, or ~ ?

2008-09-16 Thread Erik Allik
Seems like you have a lot of URLs hardcoded -- you shouldn't do that. Use MEDIA_URL for static media files and the {% url %} tag for dynamic URLs (or django.core.urlresolvers.reverse in Python code). Erik On 16.09.2008, at 11:02, est wrote: > > Today, my boss came to me and asked: "Please m

Re: Best distribution practices for pluggable apps?

2008-09-15 Thread Erik Allik
There's a topic in this group about general guidelines to packaging and distribution of pluggable apps. About templates, I'm sure you should include them under the app directory. Project template directory is normally searched before app template directories so any implementors of your app

Re: Abstract Superclass and Foreign Keys

2008-09-15 Thread Erik Allik
Maybe you should check out generic foreign keys. Not sure if it's appropriate solution though. Erik On 16.09.2008, at 4:10, Peter Bailey wrote: > > Hi all. I have a set of classes (web page items like radios, > checkboxes, etc.) They are built on a superclass - Item. I need a > join table to

Re: Is this group censored, or is the archive just buggy?

2008-09-15 Thread Erik Allik
I'm not sure if this is related, but some of my letters sent to this group aren't showing up. At the same time, a few people have replied to my letters without me actually having received these letters. Weird. Erik On 15.09.2008, at 23:10, catsclaw wrote: > > Hi -- > > I've been having m

Re: Introducing django-cms

2008-09-15 Thread Erik Allik
database to HTML. I'm not even sure if that's necessary because I think most of the time the dynamic URLconf approach works fine. Regards, Erik Allik On 15.09.2008, at 18:40, [EMAIL PROTECTED] wrote: > > Hi everybody > > As one of the contributors of django-cms, we (www.di

Re: User subclass vs. User-Profile

2008-09-15 Thread Erik Allik
I guess if you subclassed the User model, you'd have to change all places that use it to use YourUserModel instead, otherwise there's no point (someone correct me if I'm wrong). So I'd stick with the user- profile approach. Erik On 15.09.2008, at 17:33, Brot wrote: > > Hello, > > what is y

Re: django+xmlrpc on mod_python+apache

2008-09-15 Thread Erik Allik
Who's sending the XML-RPC requests, a web browser? If yes, check out some docs/articles about XmlHttpRequest security and cross-domain request limitations etc. Erik On 15.09.2008, at 17:31, roychan wrote: > > > Hi Guru, > > I have an xmlrpc service running on django (like this: > http://co

Re: django-projekt - vcs - media folder

2008-09-15 Thread Erik Allik
Just curious, maybe I'm missing something: why do you not keep your / media/admin/ files under version control? Erik On 15.09.2008, at 19:26, patrickk wrote: > > our environment looks like this: > all media-files uploaded with the admin-interface are in /media/ > uploads/. this directory is no

Re: Problems with signals accessing kwargs

2008-09-14 Thread Erik Allik
Or: def mail_on_create_intro(sender, created=None, **kwargs): if created: email_body = 'A new intro at ' + instance.url email_subject = 'New intro' else: email_body = 'An intro has changed at ' + instance.url email_subject = 'Changed Intro' mail_

Re: specifying MEDIA_URL in CSS files

2008-09-13 Thread Erik Allik
You should instead simply use relative URLs to images in CSS files. Style sheets and images are (normally) always at the same location relative to each other so nothing will break if you change their location. Of course if your images are in a different domain than your style sheets, that'

Re: Introducing django-cms

2008-09-09 Thread Erik Allik
How does it integrate with other/custom django apps? Erik On 08.09.2008, at 17:15, Thomas Steinacher wrote: > > Hello Djangonauts! > > I would like to introduce django-cms, a free, BSD-licensed content > management system based on Django. It is seamlessly integrated with > Django's admin interf

Django-mptt admin

2008-09-08 Thread Erik Allik
Hi, Does anyone have actual working code for administering models that use django-mptt? It'd be nice if the code was free, but if it's not, maybe we can work something out. Erik Allik --~--~-~--~~~---~--~~ You received this message because you are

Re: Upload images to database

2008-09-08 Thread Erik Allik
Since you're asking about the need, let me bring you an example: (images and documents are both just files so we can discuss storing files in the database not just images) I have a bunch of documents that my customer can upload through the admin interface. He can then assign read permissions

Re: Upload images to database

2008-09-08 Thread Erik Allik
I've been kinda wanting the same thing. I think you could implement a DbImageField and a database file storage back end. Keep us in touch, I'm interested. Erik On 08.09.2008, at 12:08, nsash wrote: > > How can I upload an image in the database? As it is now , in database > is saved only t

Re: URL configuration with Django deployed in a subdirectory

2008-08-29 Thread Erik Allik
Just to let you know, if you upgraded your Django version, you wouldn't have to manually specify base_url in you URLconf because Django will do it for you. I'm not sure what's causing your problem though. Erik On 29.08.2008, at 22:40, bryanzera wrote: > > I am a new Django user with Djang

Re: Using http header information in settings.py

2008-08-29 Thread Erik Allik
For the iPhone templates issue, I'd set up two projects instead of one -- one for regular browsers, one for the iPhone. Then I'd simply redirect from the regular one to the iPhone one as needed. Although this has the negative side effect of having more than one URL per resource, but you co

Re: creating and using postgresql sequences using django orm?

2008-08-29 Thread Erik Allik
I'm not sure if this will work for you, but I'd simply create a "helper" table and Django model for that and insert new entries there to get the next number in the sequence. You might even find it useful for storing other data such as when a certain number in the sequence was generated and

Re: running Django on a very small VPS

2008-08-27 Thread Erik Allik
You should check out http://lincolnloop.com/blog/2008/mar/25/serving-django-cherrypy/ or simply google for "django cherrypy". Looks cool to me, I'm planning on using this in WebFaction which has 80MB RAM for the cheapest plan. Erik On 27.08.2008, at 23:14, Edwin W wrote: > > I was just

Re: Template inherite and direct_to_template

2008-08-27 Thread Erik Allik
You have assumed that child templates also inherit any context that is passed to the parent templates. Unfortunately, this is not the case. This is not a limitation, but in fact makes sense -- passing the context happens when templates are rendered (in your case, in URLconf where you use di

Re: Calling attributes from other models

2008-08-26 Thread Erik Allik
Are there any plans to make list_display support stuff like artist__hometown, too? I've been missing this one a lot because the helper method approach is both slow and doesn't allow for sorting/filtering/searching etc, besides cluttering up the models with code that shouldn't be there. Erik

Re: Example of template tag I can modify?

2008-08-24 Thread Erik Allik
If you consult the documentation, you will see it has code examples. It seems to me that what you're looking for are inclusion tags. Django is famous for its high quality documentation so I doubt it can't help you. Erik P.S. no HTML tables for layout! :) On 25.08.2008, at 3:05, Leaf wrote

Re: Admin problems :(

2008-08-24 Thread Erik Allik
You should consult the documentation (not djangobook.com) about how the admin site should be set up. Erik On 24.08.2008, at 17:20, Shadow wrote: > > Hi, I'm having some issues with the admin app (using svn rev #8520). > > 1) I can't get my apps models to show (logged in as superuser). > > I'v

Re: Admin: Showing attributes in drop list

2008-08-24 Thread Erik Allik
You could define the __unicode__ (or __str__) method for the Customer class: class Customer(models.Model): def __unicode__(self): return '%s %s' % (self.first_name, self.last_name) On 24.08.2008, at 15:22, Gerard Petersen wrote: > > Hi All, > > With some relational m

Re: First App: devel server - can't establish a connection to 127.0.0.1

2008-08-23 Thread Erik Allik
"python manage.py runserver 0.0.0.0:8000" is always easier than looking up the IP address using ifconfig -- It simply listens on all IP addresses. :) Erik On 24.08.2008, at 4:13, Jeff Anderson wrote: > Rob wrote: >> Not for me! :( I get a "Unable able to connect. Firefox cannot >> establish

Re: Track usage

2008-08-23 Thread Erik Allik
You can try Google Analytics at http://google.com/analytics/ You could develop a Django application for that, but I see no reason. Erik On 24.08.2008, at 2:01, [EMAIL PROTECTED] wrote: > > I need to track access to my Django based website. Is there a > standard or recommended way of doing tha

Re: 500.shtml

2008-08-21 Thread Erik Allik
Did you check the web server log? If you're using the built in server, just look at the console output it produces. Because we can't help you with the information you provided. Erik On 22.08.2008, at 3:05, Ronaldo Z. Afonso wrote: > > Hi all, > > This is my first post to this list. I'm try

Re: How to know which fields a model contains?

2008-08-21 Thread Erik Allik
Do you mean something like Publisher._meta.fields? Erik On 21.08.2008, at 22:38, Alexis Bellido wrote: > > Hello, I'm reading the Django book and after reviewing the database > API I was wondering if there was some method to find out which fields > a model contains. > > For example, if I have a

Re: auto urls for methods

2008-08-21 Thread Erik Allik
http://dpaste.com/72986/ Although I wouldn't recommend this approach in general. This doesn't actually make things simpler, just more complicated. I didn't test this code either, but assuming you won't actually use this, it doesn't matter. Erik On 21.08.2008, at 13:00, James Bennett wrot

Re: ifequal doesn't evaluate expressions

2008-08-20 Thread Erik Allik
I've always felt that Django provides a lot of stuff out of the box that most other frameworks don't. To name a few: auth, admin, sites, contenttypes, permissions, comments etc. Maybe some have gotten too much of the good thing and are now wanting for more? :) On the other hand, even though

Re: limit choices to logged-in user

2008-08-20 Thread Erik Allik
I'm just wondering, but in general, isn't the use of threadlocals kind of hacky? Shouldn't there be a more approach to this? Erik On 20.08.2008, at 0:12, brentp wrote: > > On Aug 19, 9:14 am, patrickk <[EMAIL PROTECTED]> wrote: >> it´s basically for autopopulating a form. I´m not setting the

Re: check box problem

2008-08-19 Thread Erik Allik
only a few fields are selected) and in the template, I believe, you can use that same list to only display the selected fields. Something like that should work: http://dpaste.com/hold/72370/ Regards, Erik Allik On 19.08.2008, at 12:55, laspal wrote: > > hi, > My modes is : > c

Re: Invalid block tag: 'autoescape'

2008-08-19 Thread Erik Allik
any Django version you like. Regards, Erik Allik On 19.08.2008, at 15:29, Steve Holden wrote: > > tom17 wrote: >> I developed something using the trunk, now we have a change in the >> requirement and we need to use the 0.96 version as the hosting >> service >> prov