Re: How can I run syncdb task without loading any initial_data fixtures?

2007-07-16 Thread Russell Keith-Magee
On 7/17/07, Manoj Govindan <[EMAIL PROTECTED]> wrote: > > Given the (admittedly uncommon) "select only" nature of the app, I > think my statement accurately reflects my need. You think. For the moment. Until one day, something subtle changes in the implementation of get_foobar() which _does_ chan

Re: How can I run syncdb task without loading any initial_data fixtures?

2007-07-16 Thread Manoj Govindan
> If there are times that you don't want to load the data, then it isn't > initial data. Put it in a different fixture, and load it when you need > it. > I am bit confused now. Are you implying that the developer should not prepare an initial_data fixture (with data that is absolutely essential f

Re: How can I run syncdb task without loading any initial_data fixtures?

2007-07-16 Thread Manoj Govindan
> IMHO, this is a dangerous statement to make - what if one test makes > an (mistaken) change in the database? Then all your subsequent tests [snip] My application does *not* make any inserts/updates to the database. It merely selects and presents data based on user inputs (application is up here

Re: How can I run syncdb task without loading any initial_data fixtures?

2007-07-16 Thread Russell Keith-Magee
On 7/17/07, Manoj Govindan <[EMAIL PROTECTED]> wrote: > > Hi Russ, > > Quote: initial_data is intended for data that must _always_ be in your > database. > > Shouldn't developers have the option to run syncdb without loading > initial_data? For example: a model has changed and the developer > mere

Re: How can I run syncdb task without loading any initial_data fixtures?

2007-07-16 Thread Russell Keith-Magee
On 7/17/07, Manoj Govindan <[EMAIL PROTECTED]> wrote: > > Hi Russ, > I *did* try loading fixtures by making use of Django's own TestCase. > > However, this proved to be too expensive in terms of time taken to run > tests given that: > 1) Deriving test classes from Django's TestCase slows execution

Re: How can I run syncdb task without loading any initial_data fixtures?

2007-07-16 Thread Manoj Govindan
Hi Russ, Quote: initial_data is intended for data that must _always_ be in your database. Shouldn't developers have the option to run syncdb without loading initial_data? For example: a model has changed and the developer merely wishes to synchronize the database without loading any data. Regar

Re: regex in url

2007-07-16 Thread james_027
hi kenneth, thanks a lot, i think should be looking at official python doc more than the dive into python. cheers, james On Jul 17, 12:47 pm, Kenneth Gonsalves <[EMAIL PROTECTED]> wrote: > On 17-Jul-07, at 9:36 AM, james_027 wrote: > > > Yes I am looking for the explanation of ?P syntax, is thi

Re: How can I run syncdb task without loading any initial_data fixtures?

2007-07-16 Thread Manoj Govindan
Hi Russ, I *did* try loading fixtures by making use of Django's own TestCase. However, this proved to be too expensive in terms of time taken to run tests given that: 1) Deriving test classes from Django's TestCase slows execution down considerably, even in the *absence* of fixtures. 2) As my te

Re: How can I run syncdb task without loading any initial_data fixtures?

2007-07-16 Thread Russell Keith-Magee
On 7/17/07, Manoj Govindan <[EMAIL PROTECTED]> wrote: > > I have created an initial_data fixture for using with my test cases. > However I do not want these to be loaded every time I run syncdb after > making a change during development. Is there a way to turn off loading > initial_data, perhaps u

How can I run syncdb task without loading any initial_data fixtures?

2007-07-16 Thread Manoj Govindan
I have created an initial_data fixture for using with my test cases. However I do not want these to be loaded every time I run syncdb after making a change during development. Is there a way to turn off loading initial_data, perhaps using a command line switch? Thanks, Manoj --~--~-~--~

Re: Spawning Subprocesses under mod_python

2007-07-16 Thread Nimrod A. Abing
On 7/17/07, Giovanni Giorgi <[EMAIL PROTECTED]> wrote: > > I have used the subprocess module with success. > I have used it only on command line based script under Linux, but I > think it can work inside mod_python. > If you plan to use it I suggest you to reboot the apache one a day, to > prevent

Re: regex in url

2007-07-16 Thread Kenneth Gonsalves
On 17-Jul-07, at 9:36 AM, james_027 wrote: > Yes I am looking for the explanation of ?P syntax, is this > something related to python's regex or django's own regex. python -- regards kg http://lawgon.livejournal.com http://nrcfosshelpline.in/web/ --~--~-~--~~~-

Re: regex in url

2007-07-16 Thread james_027
Yes I am looking for the explanation of ?P syntax, is this something related to python's regex or django's own regex. thanks james On Jul 17, 11:57 am, "Russell Keith-Magee" <[EMAIL PROTECTED]> wrote: > On 7/17/07, james_027 <[EMAIL PROTECTED]> wrote: > > > I am very new to django as well as py

Re: regex in url

2007-07-16 Thread Russell Keith-Magee
On 7/17/07, james_027 <[EMAIL PROTECTED]> wrote: > I am very new to django as well as python. how is it that ?P > seems to be ignore by the regex function? I can't see any explanation > in django's documentation. is this something magic or hack my django? What do you mean by ignored? Are you get

regex in url

2007-07-16 Thread james_027
hi, urlpatterns = patterns('', (r'^polls/$', 'mysite.polls.views.index'), (r'^polls/(?P\d+)/$', 'mysite.polls.views.detail'), (r'^polls/(?P\d+)/results/$', 'mysite.polls.views.results'), (r'^polls/(?P\d+)/vote/$', 'mysite.polls.views.vote'), ) I am very new to django as well as

Re: Improve the dynamic generation of a form with newforms library

2007-07-16 Thread Russell Keith-Magee
On 7/16/07, yml <[EMAIL PROTECTED]> wrote: > > This is not bat but i would prefer if instead of the list of tuple > containing my forms could directly instantiate a "all in one" form. > This would avoid the loop on list_answer_forms. This is were I get > stuck. Could you please let me know how t

Re: SQL VIEWs as Django Models for aggregation --- delete() issues with django.db.models.query: delete_objects

2007-07-16 Thread Russell Keith-Magee
On 7/17/07, JeffH <[EMAIL PROTECTED]> wrote: > > Russ: Thanks for your reply! > > 1. I don't consider my views-as-models approach elegant at the > implementation level, but: Its a bit of a nifty hack. However, I was talking more about views as a general tool - it would be nice to support them. Th

get 1000,00 dolars per day

2007-07-16 Thread newbar
get 1000,00 dolars per day Simply click on the business link http://www.cash-dreams.biz --~--~-~--~~~---~--~~ 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@googl

Re: Unique=true

2007-07-16 Thread Brian Morton
If you are using NewForms, you should implement this in the clean() method for a field. See the newforms docs and unit tests for more details. On Jul 16, 4:49 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > OK, fixed the above problem -- figured out that it was related to my > setting uniqu

Re: is there any host servers that supports Django based sites?

2007-07-16 Thread Kenneth Gonsalves
On 17-Jul-07, at 3:21 AM, Michael wrote: > and the most important reason that made me leave django and use php > instead is finding a REAL job. > after the freelance period, I hope to find a job in some company, > unfortunately, there is no requests for Django developers, and the > requests for

win install problem

2007-07-16 Thread Carl Karsten
I have been working on a site for a few weeks. I have been checking my changes into svn, and use that to update a demo box. the demo box runs under a different user, has django in a different path, and my files in a different path. I did this on purpose just to make sure nothing was relying

Re: order_with_respect_to still dead wth MySQL?

2007-07-16 Thread John Shaffer
Note that the ticket is marked "new" rather than "closed: fixed". This usually means that it is still an issue. A triager might look at it and mark it "ready for checkin" rather than "patch needs improvement", which will give it a much better chance of getting into trunk. --~--~-~--~~

Re: is there any host servers that supports Django based sites?

2007-07-16 Thread James Bennett
On 7/16/07, Michael <[EMAIL PROTECTED]> wrote: > after many indecisions, I decided to leave Django and keep working > with PHP > I'm really disappointed that I had to make this decision :-( I can certainly sympathize; back in my freelance days I enjoyed writing Python and fell in love with Dja

Re: is there any host servers that supports Django based sites?

2007-07-16 Thread Marc Garcia
Why not getting a VPS hosting (or a dedicated server) and install whatever you want? Then you can sell hosting to your customers if needed. PS: May be in 6-7 months there will be more offers fos django developers than for php :) On Jul 17, 12:01 am, SamFeltus <[EMAIL PROTECTED]> wrote: > Web Fac

Re: recursive relation

2007-07-16 Thread rskm1
On Jul 16, 3:36 pm, "Lic. José M. Rodriguez Bacallao" <[EMAIL PROTECTED]> wrote: > How can I make a recursive one-to-many relation? > > -- > Lic. José M. Rodriguez Bacallao According to http://www.djangoproject.com/documentation/model-api/#many-to-one-relationships ``To create a recursive relati

Re: objects.filter

2007-07-16 Thread Tim Chase
> Okay, I am having a problem and I don't know why. I am doing > an objects.filter on a model called Asset it looks like this > asset = Asset.objects.filter(process_stage = state or > 'imaging') this should return any Asset that is equal to the > state variable or 'imaging' but it is just returnin

Re: is there any host servers that supports Django based sites?

2007-07-16 Thread SamFeltus
Web Faction works great and is very affordable, FWIW On Jul 16, 4:51 pm, Michael <[EMAIL PROTECTED]> wrote: > thank you all for helping me understand the 'Django-way'. > > after many indecisions, I decided to leave Django and keep working > with PHP > I'm really disappointed that I had to make

Re: is there any host servers that supports Django based sites?

2007-07-16 Thread Michael
thank you all for helping me understand the 'Django-way'. after many indecisions, I decided to leave Django and keep working with PHP I'm really disappointed that I had to make this decision :-( I like python AND django, honestly I think it's the best web framework that ever been made :) furt

objects.filter

2007-07-16 Thread [EMAIL PROTECTED]
Okay, I am having a problem and I don't know why. I am doing an objects.filter on a model called Asset it looks like this asset = Asset.objects.filter(process_stage = state or 'imaging') this should return any Asset that is equal to the state variable or 'imaging' but it is just returning the ones

Re: SQL VIEWs as Django Models for aggregation --- delete() issues with django.db.models.query: delete_objects

2007-07-16 Thread JeffH
Russ: Thanks for your reply! 1. I don't consider my views-as-models approach elegant at the implementation level, but: * it is dead simple to use once set up (it's just the Django model and database API) * it allows for limited aggregation support (views are created at install time, so real a

Re: How to make dictionary out of model instance

2007-07-16 Thread Niels
On Jul 16, 11:18 pm, Niels <[EMAIL PROTECTED]> wrote: Grumble. Safari ate my code. That should read (new try...) def instance_dict(i): return dict(map( lambda a, b=i: (a, getattr(b, a)), [f.attname for f in i._meta.fields] )) --~--~-~--~~~---~--~~ You re

order_with_respect_to still dead wth MySQL?

2007-07-16 Thread Austin Govella
Does order_with_respect_to still not work? http://code.djangoproject.com/ticket/1760 I'm getting an error: * (1093, "You can't specify target table 'tasks_action' for update in FROM clause") -- Austin Govella Thinking & Making: IA, UX, and IxD http://thinkingandmaking.com [EMAIL PROTECTED]

Re: How to make dictionary out of model instance

2007-07-16 Thread Niels
Or yet another option: def instance_dict(i): return dict(map( --~--~-~--~~~---~--~~ 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 unsubscr

Unique=true

2007-07-16 Thread [EMAIL PROTECTED]
OK, fixed the above problem -- figured out that it was related to my setting unique=True on a field. But that raises the larger question... I have a bit of data that may or may not exist... a identifier on the user that not all users will have, but if they DO have it, it needs to be unique to tha

Django and ActionScript 3 Templates

2007-07-16 Thread SamFeltus
I was wondering if anyone had used Django to generate ActionScript for the MXMLC compiler? I have been tinkered with using TurboGears to create/edit Flash movies. Here is an example of the ongoing comical experiment... http://samfeltus.com/as3/mardi_gras.html I'm considering writing some gene

recursive relation

2007-07-16 Thread Lic. José M. Rodriguez Bacallao
How can I make a recursive one-to-many relation? -- Lic. José M. Rodriguez Bacallao Cupet - Todos somos muy ignorantes, lo que ocurre es que no todos ignoramos lo mismo. Recuerda: El arca de Noe fue construida por aficionados, el ti

RE: is there any host servers that supports Django based sites?

2007-07-16 Thread Sells, Fred
I suggest you contact webfaction or others and ask them to give you 1 month of free hosting of a developed site, with the plan that your client would then pay to have his stuff hosted there if he liked it. After a few successes, you might get them to give you a generic beta site. > -Original

RE: is there any host servers that supports Django based sites?

2007-07-16 Thread Chris Brand
> can I run Django-based site on host provider that supports Python but > has NO django installed?? You might find some useful information in this thread : http://groups.google.com/group/django-users/browse_thread/thread/1c67d892907 d1abb/8fd08f175a11ac82?lnk=gst&q=httpd.conf&rnum=1#8fd08f175a11a

template not raising error (newforms related ?)

2007-07-16 Thread olivier
Hi all, I'm having some debugging issue with Django templating and newforms. I'm using a form_for_model class, and I define a custom layout method, in the vein of as_ul or as_table). It looks like : EntryForm = forms.form_for_model(models.Entry, form = CustomForm) class CustomForm(forms.BaseFor

Re: is there any host servers that supports Django based sites?

2007-07-16 Thread Tim Chase
> can someone please answer on my easy newbie question? > can I run Django-based site on host provider that supports Python but > has NO django installed?? This sounded kinda zen when I first heard it...running Django apps on a host without Django, sound of one hand clapping, and all that. The

Re: is there any host servers that supports Django based sites?

2007-07-16 Thread Michael
can someone please answer on my easy newbie question? can I run Django-based site on host provider that supports Python but has NO django installed?? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" gr

Problem with James Bennett's django-registration

2007-07-16 Thread [EMAIL PROTECTED]
When I try to register as a user, I get: IntegrityError at /registration/ (1062, "Duplicate entry '' for key 2") Any ideas? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this grou

Re: Can Google index Django's pages?

2007-07-16 Thread Joseph Heck
You can optimize a bit for Google as well by implementing a sitemap (see: http://www.djangoproject.com/documentation/sitemaps/) -joe On 7/13/07, felixhummel <[EMAIL PROTECTED]> wrote: > > Thanks for this fine answer, Julio! > Now nothing is going to hold me back! ;) > > On Jul 13, 8:22 pm, "Juli

Re: flatpages issues

2007-07-16 Thread John-Scott Atlakson
Ah ha! I just looked through my settings.py file and noticed the setting: SITE_ID = 1 I decided to double check the raw data for the django_sites table and my site id is '2'. (I think id 1 used to be 'example.com' but I had deleted it instead of renaming it, thus creating a mismatch with SITE_ID).

Re: Throwing error in admin using ManyToManyField(Site)

2007-07-16 Thread Jeff
SOLVED Apparently, making a call to Site.objects.get_current() in your models.py throws an error when loading a module in Admin. Anyone have an idea why? On Jul 16, 12:14 pm, Jeff <[EMAIL PROTECTED]> wrote: > Another note: if I comment out 'sites = models.ManyToManyField(Site)' > from Team, it

Re: Error from python manage.py syncdb

2007-07-16 Thread theju
Your postgresql database is not running. So $ su postgres then go to the postgres user's home directory and then $ postgres -D data/ The database server starts running...then try your syncdb...it'll work. Cheers Thejaswi Puthraya --~--~-~--~~~---~--~~ You recei

Re: flatpages issues

2007-07-16 Thread Jacob Kaplan-Moss
On 7/16/07, John-Scott <[EMAIL PROTECTED]> wrote: > Can someone in the know confirm or deny that adding the catch-all line > to urls.py is in fact required to invoke flatpages? No, it's not; the fallback middleware works fine for me. If it's not working for you, chances are you've got something m

Re: Throwing error in admin using ManyToManyField(Site)

2007-07-16 Thread Jeff
Another note: if I comment out 'sites = models.ManyToManyField(Site)' from Team, it loads fine. The same if I use it as a ForeignKey field. I'm using the latest stable, 0.96. On Jul 16, 11:01 am, Jeff <[EMAIL PROTECTED]> wrote: > I'm throwing an error when loading the admin edit page for an ins

Re: Spawning Subprocesses under mod_python

2007-07-16 Thread Giovanni Giorgi
I have used the subprocess module with success. I have used it only on command line based script under Linux, but I think it can work inside mod_python. If you plan to use it I suggest you to reboot the apache one a day, to prevent yourself againt resource and/or memory leaks. On Jul 16, 9:25 am

Meeting of Python users in Munich

2007-07-16 Thread Marek Kubica
Hi Pythoneers in and around Munich! On Wednesday the 18th of July there is going to be a Python user meeting in Munich to which all Django users are invited as well. If you're interested, here's the original announcement: I hope to see

Re: flatpages issues

2007-07-16 Thread John-Scott
Can someone in the know confirm or deny that adding the catch-all line to urls.py is in fact required to invoke flatpages? I checked out the source for djangoproject.com and it has this as the last item in urlpatterns: (r'', include('django.contrib.flatpages.urls')), If this is required, should

Throwing error in admin using ManyToManyField(Site)

2007-07-16 Thread Jeff
I'm throwing an error when loading the admin edit page for an instance of a model. The exception itself is a TypeError, "Cannot resolve keyword 'team' into field." It is being raised at db.models.query line 938. I've included the full trace below. The model is Team, which has a ManyToMany rela

Re: Error from python manage.py syncdb

2007-07-16 Thread John Dey
Russ, Thanks for your response. I changed the django port from 5433 (Linux Journal--July 2007) to 5432 and the tables were created. Thanks again. John On Jul 16, 2007, at 9:39 AM, Russell Keith-Magee wrote: > > On 7/16/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: >> >> Is the ser

Re: HttpResponseRedirect and IE6

2007-07-16 Thread Bob Dively
I'm also having a problem with redirecting and IE6. User enters data in an HTML form, clicks save button and gets IE's "The page cannot be displayed" error. In this case the initial URL is /household123/client/ add/ and the browser should be redirected to /household123/. However, the URL is is sti

memcached Cookie Problems

2007-07-16 Thread Alexander
Hi, I'm currently streamlining my django app for speed. I'm using memcached on my server (apache, django svn trunk version: 5718) with the following settings.py: CACHE_BACKEND = 'memcached://127.0.0.1:11211/' CACHE_MIDDLEWARE_SECONDS = 180 MIDDLEWARE_CLASSES = ( 'django.contrib.sessions.middl

generic views and selection for foreignkey

2007-07-16 Thread Przemek Gawronski
Hi, in the model I've got: class Client(models.Model): name = models.CharField(maxlength=200) class Workorder(models.Model): client = models.ForeignKey(Client) name = models.CharField(maxlength=200) As for input I'm using generic views (create_update.create_object,..). How can I get an

Re: ip to location

2007-07-16 Thread Malcolm Tredinnick
On Mon, 2007-07-16 at 13:36 +, cesco wrote: > Thanks but I was asking for something more precise, like latitude and > longitude (approximated, of course) rather than the country which > would be too vague for my application. Any other suggestion? Given the privacy implications, hopefully you

Re: Error from python manage.py syncdb

2007-07-16 Thread Russell Keith-Magee
On 7/16/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > Is the server running locally and accepting > connections on Unix domain socket "/tmp/.s.PGSQL.5433"? This is a Postgres error, telling you that the psycopg can't connect to the Postgres DB. You need to play around with

Re: ip to location

2007-07-16 Thread cesco
Thanks but I was asking for something more precise, like latitude and longitude (approximated, of course) rather than the country which would be too vague for my application. Any other suggestion? Thanks again On Jul 16, 1:07 pm, xaranduu <[EMAIL PROTECTED]> wrote: > cesco schrieb: > > > Hi, > >

Re: Efficient reverse access on ForeignKey?

2007-07-16 Thread Russell Keith-Magee
On 7/16/07, jj <[EMAIL PROTECTED]> wrote: > > Excellent, this works! > > Now, probably the documentation is misleading. From documentation/db- > api: > > > You cannot access a reverse ForeignKey Manager from the class; it > must be accessed from an instance. Example: > Blog.entry_set

Error from python manage.py syncdb

2007-07-16 Thread jsdey
Can't set tables using 'python manage.py syncdb'. -- Version .96 of django; server started on 8080; can see django page from browser. Created postgresql database 'aft' for user 'robo7' now password; set settings.py error from syncdb option: [EMAIL PROTECTED] mysite]$ python manage.py syncdb Trac

Re: Efficient reverse access on ForeignKey?

2007-07-16 Thread jj
Excellent, this works! Now, probably the documentation is misleading. From documentation/db- api: You cannot access a reverse ForeignKey Manager from the class; it must be accessed from an instance. Example: Blog.entry_set # Raises AttributeError: "Manager must be accessed via insta

Re: How to make dictionary out of model instance

2007-07-16 Thread [EMAIL PROTECTED]
On Jul 16, 11:53 am, Eratothene <[EMAIL PROTECTED]> wrote: > I need to make dictionary out of django.auth.model.User instance in > such format: What about using vars() >>> from foo.main.models import * >>> d = District() >>> vars(d) {'id': None, 'borough_id': None, 'name': ''} >>> L. --~--~--

Re: Flash Message template tag

2007-07-16 Thread James Bennett
On 7/15/07, rtconner <[EMAIL PROTECTED]> wrote: > So one of the (very few) things I had not been happy with regarding > Django is its flash message handling. So I wrote something that would > make me happy. Its just a template tag add-on. Since so far Django has > been so great to me, I wanted to

Improve the dynamic generation of a form with newforms library

2007-07-16 Thread yml
Hello Djangonauts, After spending sometimes to learn using the test/fail/correct cycle I have finally reach a point where I have something that more or less do what I want. However since one of the objectives of the project I am working on was to improve my knowledge on django I would like to rea

Re: About create a database table dynamicly

2007-07-16 Thread Ned Batchelder
Nick, if all of your dynamically-created tables in fact have the same schema (set of columns), then you definitely should make one table for all your users to share. Be sure to index the columns that will be used in your WHERE clauses, and your table will perform fine. --Ned. Malcolm Tredinni

Re: How to make dictionary out of model instance

2007-07-16 Thread Russell Keith-Magee
On 7/16/07, Eratothene <[EMAIL PROTECTED]> wrote: > > I need to make dictionary out of django.auth.model.User instance in > such format: > > {'username':'val1', 'password':'val2', 'email':'', > 'first_name':'val3', 'last_name':'val4' ...} > > In order to populate this data in to the custom form. I

Re: Efficient reverse access on ForeignKey?

2007-07-16 Thread Russell Keith-Magee
On 7/16/07, jj <[EMAIL PROTECTED]> wrote: > > Now I'd like to restrict the query to books which have been printed in > 'Holland': > q = q.filter(foreign_print_set__country='Holland') Try: q = q.filter(foreignprint__country='Holland') foreignprint doesn't get an underscore unless it is

Re: ip to location

2007-07-16 Thread xaranduu
cesco schrieb: > Hi, > > does anyone in the django community know of a public algorithm to get > the location from the ip. > If such a thing doesn't exist do you know of a service with an API > which does it? > Or maybe such a functionality will be available with the upcoming > Geodjango? > > Man

Re: permalink decorator

2007-07-16 Thread Robert
On 16 Lip, 11:51, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > Although you give the traceback, you don't say what exception is raised. > So it's hard to guess. > > A first step to debug this would be to try it at the interactive prompt > ("manage.py shell") and see what happens when you call >

Re: How to make dictionary out of model instance

2007-07-16 Thread Eratothene
Really dirty way! But IT DOES WORK, and it is so simple. Thanks a lot Ben van Staveren --~--~-~--~~~---~--~~ 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@googleg

Re: How to make dictionary out of model instance

2007-07-16 Thread Ben van Staveren
If you have an instance, you could just do: myUserModelInstance.__dict__ -- that'll get you the data you want, and a bunch of extra stuff you most likely don't want. I don't really recommend doing this either, since it's not "the right way" IMO, but it solves your problem. On 16/07/2007, a

How to make dictionary out of model instance

2007-07-16 Thread Eratothene
I need to make dictionary out of django.auth.model.User instance in such format: {'username':'val1', 'password':'val2', 'email':'', 'first_name':'val3', 'last_name':'val4' ...} In order to populate this data in to the custom form. I have read all documentation available in order to resolve this

Re: permalink decorator

2007-07-16 Thread Malcolm Tredinnick
On Mon, 2007-07-16 at 09:41 +, Robert wrote: > Hello, > > I would like to use the permalink decorator for get_absolute_url > method. > > Here's the code: > > There's a 'Post' model with 'created' -> models.DateTimeField() > field.. (and others) > > @models.permalink > get_absolute_url(sefl

permalink decorator

2007-07-16 Thread Robert
Hello, I would like to use the permalink decorator for get_absolute_url method. Here's the code: There's a 'Post' model with 'created' -> models.DateTimeField() field.. (and others) @models.permalink get_absolute_url(sefl): return (post_detail, None, { 'year' : self.created.y

Re: Site framework

2007-07-16 Thread Glebb
On 12 heinä, 05:30, "Russell Keith-Magee" <[EMAIL PROTECTED]> wrote: > On 7/11/07, Glebb <[EMAIL PROTECTED]> wrote: > > > I'm not aware of anything that would be causing this sort of problem. > To help you debug, we will need to see some actual code - 'it > complains' isn't really that helpful as

Make Money through Internet

2007-07-16 Thread [EMAIL PROTECTED]
http://www.makemoneyadsense.bravehost.com Check out this website. It is a free guide to create a free website and make money through Google adsense and some other simillar ad programs. It also tells about sites for get paid to click ADs, get paid to post discussions, blogs, comments and photos.

Efficient reverse access on ForeignKey?

2007-07-16 Thread jj
Suppose I'm building a large complex query on a Book (via the HTTP query string -details omitted): q = Book.objects if year: q = q.filter(publication_date__year=year) if month: q = q.filter(publication_date__month=month) etc. (more complex queries in practice) Now

ip to location

2007-07-16 Thread cesco
Hi, does anyone in the django community know of a public algorithm to get the location from the ip. If such a thing doesn't exist do you know of a service with an API which does it? Or maybe such a functionality will be available with the upcoming Geodjango? Many thanks Francesco --~--~---

Re: Two huge forms delema

2007-07-16 Thread Eratothene
It did worked! class A(forms.Form) a = field b = field class B(A) c = field def __init__(self): super(B, self).__init__() del self.fields[a] On Jul 15, 7:49 pm, Nathaniel Whiteinge <[EMAIL PROTECTED]> wrote: > I don't have much experience with sub-classing forms, but I suspect

Re: is there any host servers that supports Django based sites?

2007-07-16 Thread Nicola Larosa
> Michael wrote: >> I can convince him to use other hosting service (ie - webfraction) Carl Karsten wrote: > at the final location (webfraction) Il looks like a few people need to look up the difference between "faction" and "fRaction". ;-) > Not sure I would recommend installing apache on you

Re: About create a database table dynamicly

2007-07-16 Thread Malcolm Tredinnick
On Sun, 2007-07-15 at 23:37 +0800, nick feng wrote: > Hi Ned, > > Thanks for your reply. > First, your question is my doubt. > And my problem is, if I did the same thing as you said, I will create > a table contains a great deal of data in it, this may cause the > "select" operation very slow, t

Spawning Subprocesses under mod_python

2007-07-16 Thread Nimrod A. Abing
Hello, I'm just wondering if anyone has any experiences spawning subprocesses under mod_python on Linux/Unix. My specific use case is something in the line of an os.system() call with the exception that I will be using its replacement using Popen() as detailed here: http://www.python.org/doc/2.4

Re: About create a database table dynamicly

2007-07-16 Thread nick feng
Hi Ned, Thanks for your reply. First, your question is my doubt. And my problem is, if I did the same thing as you said, I will create a table contains a great deal of data in it, this may cause the "select" operation very slow, the users may feel it hard to suffer from Best Wishes, Nick