effective dates

2007-07-10 Thread Carl Karsten
status.effectivedate is when a status 'starts', (like closed for repairs.) How do I get the 'current status based on current date' ? so if the following 3 records are in the table: status effective date, description 1/1/2007 - open for business 3/24/2007 - closed for remodeling 5/1/2007 - open wi

Re: dump an object

2007-07-09 Thread Carl Karsten
Jeremy Dunck wrote: > On 7/8/07, Carl Karsten <[EMAIL PROTECTED]> wrote: >> Right look, wrong source. My {{object}} is the results of a calendar display >> with a bunch of these: http://dell29:8000/eventcal/detail/600/ > > I seriously doubt "dell29:8000&

Re: bug in unique_for_year with 0.96?

2007-07-09 Thread Carl Karsten
Filippo Santovito wrote: > I'm trying to use unique_for_year but it seems the Admin simply > ignores this constraint: > i'm using this model for testing and I'm able to add two entry with > the same date: > > class MyModel(models.Model): > class Admin: > pass > myd

Re: faking request path

2007-07-09 Thread Carl Karsten
[EMAIL PROTECTED] wrote: > Hello all! > > Is there an easy way to fake the request path in django and/or pyton? > I'm looking for something like this: > a django page which is called with this URL: > http://www.test.ch/test1/test2/test3 > should thinks it is run in the top-folder that means: htt

Re: dump an object

2007-07-09 Thread Carl Karsten
Jeremy Dunck wrote: > On 7/8/07, Carl Karsten <[EMAIL PROTECTED]> wrote: >> Right look, wrong source. My {{object}} is the results of a calendar display >> with a bunch of these: http://dell29:8000/eventcal/detail/600/ > > I seriously doubt "dell29:8000" i

Re: dump an object

2007-07-08 Thread Carl Karsten
Jeremy Dunck wrote: > On 7/8/07, Carl Karsten <[EMAIL PROTECTED]> wrote: >> Something between that and the admin look/feel. The goal is to show someone >> what data will be displayed ins a some what sane way during development, and >> make it pretty some other day. >

dump an object

2007-07-08 Thread Carl Karsten
For quickly displaying an object on a page (in particular from a generic view), is there something that is slightly better than {{object}} ? Something between that and the admin look/feel. The goal is to show someone what data will be displayed ins a some what sane way during development, and

arrays in templates

2007-07-08 Thread Carl Karsten
I have this working with some extra code in my view, but I would like to know how I could have done it in the template: # view.py from datetime import datetime, date # Week starts on Sunday c=calendar.Calendar(calendar.SUNDAY) # get all the dates that will be displayed, #

Re: importing users from another db

2007-07-07 Thread Carl Karsten
Russell Keith-Magee wrote: > On 7/8/07, Carl Karsten <[EMAIL PROTECTED]> wrote: >> Russell Keith-Magee wrote: >>> Django users have many skills. Unfortunately, mind reading is >>> generally not one of those skills :-) >>> >> Yeah, I see what you

Re: importing users from another db

2007-07-07 Thread Carl Karsten
Russell Keith-Magee wrote: > On 7/8/07, Carl Karsten <[EMAIL PROTECTED]> wrote: >> I am migrating a site from .net/access to django. the MySql Migration Wizard >> gets the data out of access and into a MySql db nice and easy. There is even >> some provision for scr

importing users from another db

2007-07-07 Thread Carl Karsten
I am migrating a site from .net/access to django. the MySql Migration Wizard gets the data out of access and into a MySql db nice and easy. There is even some provision for scripting it, but don't ask me about that cuz I havn't used it yet :) I can write .sql and python easy enough, and I am

Re: mix in view or template?

2007-07-07 Thread Carl Karsten
Carl Karsten wrote: > I am trying to figure out the best place to matchup Events and Dates when > rendering a 'basic calendar.' > > Events: 0, 1, more per date. > Dates: a list of all the dates in a month, so about 30 - one for each day. > > # views.py > class

Re: object_list=[] ?

2007-07-07 Thread Carl Karsten
Malcolm Tredinnick wrote: > On Sat, 2007-07-07 at 14:59 -0500, Carl Karsten wrote: >> # views.py >> class Event(models.Model): >> title = models.CharField(maxlength=255) >> eventdate = models.DateField() >> description = models.TextField(bla

mix in view or template?

2007-07-07 Thread Carl Karsten
I am trying to figure out the best place to matchup Events and Dates when rendering a 'basic calendar.' Events: 0, 1, more per date. Dates: a list of all the dates in a month, so about 30 - one for each day. # views.py class Event(models.Model): title = models.CharField(maxlength=255)

object_list=[] ?

2007-07-07 Thread Carl Karsten
# views.py class Event(models.Model): title = models.CharField(maxlength=255) eventdate = models.DateField() description = models.TextField(blank=True) def __str__(self): return "%(ed)s %(t)s" % {'t':self.title, 'ed':self.eventdate } # models.py # get Events fro

Re: problem with django dev server and subprocess.Popen

2007-07-06 Thread Carl Karsten
Malcolm Tredinnick wrote: > On Fri, 2007-07-06 at 07:18 -0700, Filippo Santovito wrote: >> Hi all, >> I'm having a strange problem with a view. >> Its code runs well if I test if in the shell but seems to block the >> dev server: >> >> #django 0.96 >> def html2pdf(request, url = None ): >> fro

Re: ubuntu 6.06 deployment issues

2007-07-06 Thread Carl Karsten
Graham Dumpleton wrote: > On Jul 6, 2:59 pm, John-Scott <[EMAIL PROTECTED]> wrote: >> On Jul 6, 12:29 am, Graham Dumpleton <[EMAIL PROTECTED]> >> wrote: >> >>> Hmmm, I'm not sure the documentation is actually accurate. When you >>> use manage.py to run up development server for Django, it will >>>

Re: An idea on DB migration

2007-07-04 Thread Carl Karsten
Noam Raphael wrote: > On 7/4/07, Carl Karsten <[EMAIL PROTECTED]> wrote: >> I don't like the "edit the file" part. I can think of 2 alternatives: >> >> 1. add an attribute to one/both of the models. something like >> >> class Book(mod

Re: An idea on DB migration

2007-07-04 Thread Carl Karsten
Noam wrote: > For example, say that I have a directory with the old site (and old > models) and a directory with the new site. The only difference between > them is that I renamed the field store.Book.name to > store.Book.book_name. I will run "django-admin.py migrate oldsitedir > newsitedir". Th

Re: MySQL Got packet bigger than 'max_allowed_packet'

2007-07-04 Thread Carl Karsten
[EMAIL PROTECTED] wrote: > Thanks Martn and Carl. > > I would really like to avoid having to re design the architecture of > the application at this stage (its a case of the requirements changing > after roll out), althougth thanks for the comments re serving large > data volumes. > I have made t

Re: Again, django and MSSQL

2007-07-03 Thread Carl Karsten
mamcxyz wrote: > I try, with not sucess to apply the patch for make worj django and MS > Sql. > > > The tickets is a jungle and not see the logic in how is the thing > organized. I'm building a store based in satchmo for integrate a > couple of local ERP system, based in MS Sql, so I have a moti

Re: MySQL Got packet bigger than 'max_allowed_packet'

2007-07-03 Thread Carl Karsten
Martin Winkler wrote: > Am Tue, 03 Jul 2007 15:07:14 - > schrieb "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>: > >> We are using mysql 5.0.42 and are getting this error when trying to >> insert records of over 5M. > > I may sound nosy, and apologize for that. But don't you think that you > have a

Re: newb: Model DateTimeField and Timedelta

2007-07-03 Thread Carl Karsten
johnny wrote: > My model named: Post > > It has a field created_at as: > created_at = models.DateTimeField(auto_now_add = True) > > Would Post.created_at be of string or datetime ? > > I want to add 2 weeks to it, like Post.created_at + 14 days. Can I do > this? > Post.created_at =Post.created

Re: Sybase support for Django

2007-07-03 Thread Carl Karsten
Russell Keith-Magee wrote: > On 7/3/07, Carl Karsten <[EMAIL PROTECTED]> wrote: >> Russell Keith-Magee wrote: >>> Thats fine. However, as fair warning - this is the first time that >>> Sybase support has been requested (compared to the regular requests >

Re: Sybase support for Django

2007-07-03 Thread Carl Karsten
Russell Keith-Magee wrote: > On 7/3/07, adm <[EMAIL PROTECTED]> wrote: >> Russ, >> I sure can try that. The problem is I haven't gone through the >> Django framework in details as such, which make me quite helpless >> while adding the support. > > Thats fine. However, as fair warning - this

Re: newbie: trying to understand django templates

2007-07-02 Thread Carl Karsten
walterbyrd wrote: > On Jul 2, 5:13 pm, Carl Karsten <[EMAIL PROTECTED]> wrote: > >> "not using X" does not say what you are doing - my best guess is "what will >> be >> available if I just run python?" if so, the answer is "nothing other

Re: newbie: trying to understand django templates

2007-07-02 Thread Carl Karsten
walterbyrd wrote: > > > On Jul 2, 2:30 pm, Carl Karsten <[EMAIL PROTECTED]> wrote: >> walterbyrdwrote: >>> On Jul 2, 1:24 pm, Vincent Nijs <[EMAIL PROTECTED]> >>> wrote: >>>> all the 'settings' are taken care of for you so you

Re: newbie: trying to understand django templates

2007-07-02 Thread Carl Karsten
walterbyrd wrote: > On Jul 2, 1:24 pm, Vincent Nijs <[EMAIL PROTECTED]> > wrote: > >> all the 'settings' are taken care of for you so you don't have to do any >> exports or anything like that. The import statement for Context and Template >> should work fine when you use the above command. >> >

Re: index.html

2007-07-02 Thread Carl Karsten
Dennis Kaarsemaker wrote: > On ma, 2007-07-02 at 12:49 -0500, Carl Karsten wrote: >> how do I set a default anything for when a user hits http://foo.com they get >> index.html or any other file? I can see having a static file that does a >> redirect - wondering if the

index.html

2007-07-02 Thread Carl Karsten
how do I set a default anything for when a user hits http://foo.com they get index.html or any other file? I can see having a static file that does a redirect - wondering if there isn't a better way. Carl K --~--~-~--~~~---~--~~ You received this message becaus

Re: looking for calender and a message board

2007-07-01 Thread Carl Karsten
Justin Lilly wrote: > errr.. sorry. misclicked. You can find the source under the "agenda" folder > of: > > http://justinlilly.no-ip.org/svn/trunk/gtd/ > > If you need anything regarding it, let me know! > -justin Working out pretty good for me. thanks. Hope you don't mind me questioning th

component integration

2007-07-01 Thread Carl Karsten
I am wondering what the 'best practice' is for my current problem, which is basically using someone else's work but keeping it isolated from my own. I am building a site that needs an "event calender." Justin Lilly has done something similar and gave me http://justinlilly.no-ip.org/svn/trunk/

Re: prettier html

2007-06-30 Thread Carl Karsten
oh yeah... thanks. I have head of BeautifulSoup - never used it before. my pages html are now much more readable. Carl K Michael Trier wrote: > Make sure you have an __init__.py in that directory. > > Michael > > On 6/29/07, Carl Karsten <[EMAIL PROTECTED]> wrote:

Re: prettier html

2007-06-29 Thread Carl Karsten
Carl Karsten wrote: > Christian Joergensen wrote: >> Carl Karsten wrote: >>> nicely formated template code generates lots of CRs in the resulting html. >>> I am >>> trying to figure out how to make the html a bit easier to read. >>> >>> fo

Re: prettier html

2007-06-29 Thread Carl Karsten
Christian Joergensen wrote: > Carl Karsten wrote: >> nicely formated template code generates lots of CRs in the resulting html. >> I am >> trying to figure out how to make the html a bit easier to read. >> >> for instance, how can I make this: >> >

Re: prettier html

2007-06-29 Thread Carl Karsten
Doug Van Horn wrote: > On Jun 29, 12:20 pm, Carl Karsten <[EMAIL PROTECTED]> wrote: >> for instance, how can I make this: >> >> > {% ifequal day.day day.today %} class="today"{% endifequal %}> >> >> Not put the CR inside the ? > > I

prettier html

2007-06-29 Thread Carl Karsten
nicely formated template code generates lots of CRs in the resulting html. I am trying to figure out how to make the html a bit easier to read. for instance, how can I make this: Not put the CR inside the ? I realize i may be asking for magic, but I am thinking maybe something like skip

admin and .FileField()

2007-06-27 Thread Carl Karsten
Took me a bit to get .FileField() working in the admin, and im wondering if it needs to be as complicated as it seems. I think it currently violates DRY, and maybe that was intentional for 'security' or 'performance' reasons, or maybe it was just an oversight. I did the following, and got the

porting zion SimpleXMLRPCView to current django

2007-06-26 Thread Carl Karsten
I am trying to get http://svn.zyons.python-hosting.com/trunk/ working under the current django svn. I'll send .patch to zion's way when I am done. I need a recommendation from someone who has an understanding of what this code does. (I could probably hack it into submission, but that's not g

Re: zyons GenericForeignKey

2007-06-26 Thread Carl Karsten
Carl Karsten wrote: > This is probably a zyons problem, but maybe someone here can help this nifty > project. > > [EMAIL PROTECTED]:~/django/zyons/zilbo$ ./manage.py syncdb > Error: Couldn't install apps, because there were errors in one or more models: > zilbo.common.c

zyons GenericForeignKey

2007-06-26 Thread Carl Karsten
This is probably a zyons problem, but maybe someone here can help this nifty project. [EMAIL PROTECTED]:~/django/zyons/zilbo$ ./manage.py syncdb Error: Couldn't install apps, because there were errors in one or more models: zilbo.common.comment: 'module' object has no attribute 'GenericForeignKe

Re: looking for calender and a message board

2007-06-23 Thread Carl Karsten
) did you see the Zyons Event Calendar? looking pretty cool... Carl K > > On Jun 23, 1:37 pm, Carl Karsten <[EMAIL PROTECTED]> wrote: >> I am going to build a site that needs a calender and a message board, plus >> some >> specialized things that will 'integra

Re: Introducing DjangoSites.Org

2007-06-23 Thread Carl Karsten
I just hit it - looks nice - I like the tag cloud. I have been meaning to hit it ever sense I saw your post, but today I had a need and was hoping DjangoSites.Org would help. what follows is not related to content, I realize it is new and will improve over time. As a 'visitor' I get the feel

looking for calender and a message board

2007-06-23 Thread Carl Karsten
I am going to build a site that needs a calender and a message board, plus some specialized things that will 'integrate' with those two features. So it would be good if the whole site used the same glue. Anyone have any suggestions? Carl K --~--~-~--~~~---~--~

Re: persistant dict

2007-06-19 Thread Carl Karsten
Jeremy Dunck wrote: > On 6/19/07, Carl Karsten <[EMAIL PROTECTED]> wrote: >>> Which cache backend are you using? The snippet I linked is for *a* >>> backend. Many of the Django caching backends do need to pickle since >>> they marshal out of process. >&g

Re: persistant dict

2007-06-19 Thread Carl Karsten
Jeremy Dunck wrote: > On 6/19/07, Carl Karsten <[EMAIL PROTECTED]> wrote: > ... >> The django cache set/get does work. Thanks, M. > > Which cache backend are you using? The snippet I linked is for *a* > backend. Many of the Django caching backends do need to pickle

Re: persistant dict

2007-06-19 Thread Carl Karsten
Jeremy Dunck wrote: > On 6/17/07, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > ... >> Use the low-level caching API to store things like this. Write a short >> funciton that retrieves a value from the cache and regenerates it and >> stores it if it is not in the cache. No extra work required. >

Re: persistant dict - using twisted

2007-06-17 Thread Carl Karsten
> > I am considering using twisted to create a little server that does nothing > but > host trie_search(s) (note the lack of trie.) I realize that it will have to > return a string - that is ok, it is just a list of words found in words.txt. > > But twisted seems like overkill. otoh, I do w

persistant dict

2007-06-17 Thread Carl Karsten
I have a function that takes a dict and a string, returns a list: def trie_search(trie, s): ... return res mk_trie(the_trie) takes 15 seconds to build from a static list of 750,000 words.txt so I don't want to call it every time I need to call trie_search(). So I want to build the_tr

db rights

2007-06-12 Thread Carl Karsten
What are the minimum GRANT options I need for running syncdb and the minimum needed for normal use? Everything I find on the web does a blanket ALL, some even on all DBs of the whole server. I couldn't find anything in the docs, and it really should be spelled out. Carl K --~--~-~--~

Re: Jasper Reports

2007-06-11 Thread Carl Karsten
[EMAIL PROTECTED] wrote: > Has anyone successfully used Jasper Reports on the server being called > from a Django view? > > I've done a few things with ReportLab, but we have the need for a > graphical Report Designer, which I don't believe exists for Report > Lab. Check out: http://dabodev.com

Re: [django] Re: Including [django-users] in subject line?

2007-06-11 Thread Carl Karsten
> As I said abive, when I've done that in the past I never find the time > to dig into all my folders. If I'm going to monitor a list, it needs > to go through my inbox and have me take a manual action to move it to > a folder. I think this is the root of your request. I doubt you will find muc

Re: inspectdb and mssql

2007-06-11 Thread Carl Karsten
Malcolm Tredinnick wrote: > On Tue, 2007-06-12 at 06:14 +1000, Malcolm Tredinnick wrote: >> On Mon, 2007-06-11 at 15:07 -0500, Carl Karsten wrote: >>> If I were starting from scratch, I would use MySql. But currently there is >>> a db >>> model in MsSql. t

inspectdb and mssql

2007-06-11 Thread Carl Karsten
If I were starting from scratch, I would use MySql. But currently there is a db model in MsSql. the 2 affections to mssql is 1: it is what the client has (so I don't have to sell them on anyting new) and 2) it is where the model currently is. The plan is to see how far I can get with Ms,

Re: sleep for 30 minutes?

2007-06-10 Thread Carl Karsten
MartinWinkler wrote: > Hi again, > > On Jun 10, 10:37 pm, Florian Apolloner <[EMAIL PROTECTED]> wrote: > >> Why don't you display the image dynamically with django, without >> saving it? >> Example:http://django-captcha.googlecode.com/svn/trunk/djaptcha/views.py > > I already took a look at dja

<    1   2