form_for_model and hidden foreign key?
Please forgive me if this is a stupid question, but I haven't been able to find a good answer searching! Doesn't help that I'm only a few weeks acquainted with both both Django and Python. I'm definitely liking it so far. Anyway, I've got a custom user model with several required foreign keys. I need to have a form that only displays a subset of the model fields, and the required keys are not in this subset! That leads to problems with trying to save the form generated by form_for_model(). class CustomUser(model.Models) client = models.ForeignKey(Client) agent = models.ForeignKey(Agent) type = models.ForeignKey(LeadType,null=True) site = models.ForeignKey(ClientSite,null=True) firstname = models.CharField(blank=True, maxlength=64) lastname = models.CharField(blank=True, maxlength=64) email = models.CharField(blank=True, maxlength=64) phone = models.CharField(blank=True, maxlength=12) ... then in the view I've got def CustomUser_callback(form, **kwargs): display_fields = ('firstname', 'lastname', 'email', 'phone') if form.name in display_fields: return form.formfield(**kwargs) else: return None ... RegistrationForm = forms.form_for_model(CustomUser, formfield_callback=CustomUser_callback) myform = RegistrationForm(request.POST) myform.save() # This won't work because the required foreign keys client, and agent are not set The form display is exactly what I need, showing only the fields listed in display_fields, but I can't figure out how I should specify the client and agent keys (which are known to the view) to allow the form to save. I thought about creating a CustomUser(), setting the fields and just using the model to save... but it just doesn't seem like that should be the 'right' way, even if it works. Any pointers or suggestions would be most appreciated. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: my problem from HELL: Pleas help me out on this
On 2/21/07, enquest <[EMAIL PROTECTED]> wrote: > It seems as soon I import "from bar.models import Test" do then this > class will not show up in the the ADMIN. I restarted apache 100 time, > changed the code 100 times to figure out. Tryied everthing. But as soon > as I do an "import Test" for example the admin wont show it!!! Are these models in different apps? In two files in the same app? If they're in different apps, are both of those in the INSTALLED_APPS setting, and are you certain the DB tables have been created for them? -- "Bureaucrat Conrad, you are technically correct -- the best kind of correct." --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
MultiWidget subclass not calling compress
I have a simple MultiValueField and MultiWidget (that I modified from this example http://groups.google.com/group/django-users/browse_thread/thread/9b64e524dcf9d279/1e1144d1d7d69bb9). from django import newforms as forms class ContactWidget(forms.MultiWidget): def __init__(self,attrs=None,contact_types=()): widgets = (forms.Select(attrs=attrs,choices=contact_types),forms.TextInput(attrs=attrs)) super(ContactWidget,self).__init__(widgets,attrs) def decompress(self,value): if value: return value.split('__') return ['',''] class ContactField(forms.MultiValueField): def __init__(self,contact_types=(),required=True,label=None,initial=None): fields = (forms.ChoiceField(),forms.CharField(max_length=35)) widget = ContactWidget(contact_types=contact_types) super(ContactField,self).__init__(fields,required,widget,label,initial) def compress(self,data_list): if data_list: return '__'.join(data_list) return None contact_choices = ['Office Phone','Home Phone','Cell Phone','Fax','Pager'] contact_pairs = [(c,c) for c in contact_choices] class ContactForm(forms.Form): custom_field = ContactField(label='',contact_types=contact_pairs,required=False) But when I use ContactForm to validate some data the decompress method of ContactWidget doesn't get called, neither does commenting out ContactWidget's decompress method raise the NotImplementedError in / usr/lib/python2.4/site-packages/django/newforms/widgets.MultiWidget as I would expect. >>> d = {'custom_field':'Office Phone__1234567890','submit':'submit'} >>> cf = ContactForm(d) >>> cf.is_valid() True >>> cf.clean_data {'custom_field': u'__'} What have I done wrong? Justin --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
my problem from HELL: Pleas help me out on this
I have two models for testing purpose... I realy need to solve this problem. If not I will have to stop using Django what would be a pitty. But I can't spend an other day searching This problem occurs on a Debian apache2 server (fresh install) model 1 from django.db import models from bar.models import Test # Create your models here. class Foo(models.Model): test = models.CharField(maxlength=40) what = models.CharField(maxlength=10) bar = models.ForeignKey(Test) def __str__(self): return self.test class Admin: pass model 2 from django.db import models # Create your models here. class Test(models.Model): foos = models.CharField(maxlength=40) bars = models.CharField(maxlength=10) def __str__(self): return self.foos class Admin: pass It seems as soon I import "from bar.models import Test" do then this class will not show up in the the ADMIN. I restarted apache 100 time, changed the code 100 times to figure out. Tryied everthing. But as soon as I do an "import Test" for example the admin wont show it!!! On the IRC channel they can't help. So my last hope is this mailing list... Maybe somebody here can help me --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: Postgre and mysql
On 21-Feb-07, at 11:51 PM, James Bennett wrote: > consumer-level hosting plans, and tends to have more "friendly" > administration features (e.g., web-based control panels for managing a > database). for those who *must* go the gui/web way there is pgadmin and phgpgadmin -- regards kg http://lawgon.livejournal.com http://nrcfosshelpline.in/web/ --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: Question about queries
Hi Josh, Try: prev = album.photo_set.filter(id__lt=).order_by('-id')[: 1] --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Changing Default Type For OneToOneField
Hi, I'm just learning Django, so I apologize in advance for what may be a remedial question, but here goes: I created two models. In the first, I defined the Primary Key to be a 60 character CharField into which I'm putting a UUID (uuid.uuid4(), to be specific). In the second model, I created a OneToOneField that linked back to the first model. When Django auto generated the sql for the second table, the primary/ foreign key column it created was of type Integer. That's a type mismatch with the primary key field in the first table. I overcame this by editing the SQL before running it, but syncdb doesn't work, and it's an added step I have to remember to do (unsafe). Is there a way to tell OneToOneField that it should be creating a 60ch CharField instead of an Integer field? Thanks, -Ben --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Question about queries
I've been struggling with a problem recently and since I'm not a programmer, I feel like I'm beating my head against a wall. I have a Django app that will act as a photo gallery for photos I've taken over the years and I've organized those photos into albums. I have a page that lists all the pictures from a particular album and a page that allows you to view a single photo from that album. To the left of that photo is a thumbnail of the photo immediately before the current photo and to the right is the photo that comes next. The problem I'm having is targeting the record immediately before the current record. I've been able to successfully target the next record by doing something like this: slug = photo_id = album = Album.objects.get(slug=slug) next = album.photo_set.filter(id__gt=)[:1] In order to get to the previous I've used the following: prev = album.photo_set.filter(id__lt=)[:1] But alas, this returns the first record encountered that is less than the supplied 'id'. This would inevitably be the first photo in the album. Does anyone have any ideas? Thanks in advance. -Josh --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: error in SQL syntax for allow_empty=True in list_detail.py
thanks, that patch solved it. -abe On Feb 21, 4:52 pm, Michael Radziej <[EMAIL PROTECTED]> wrote: > abe: > > > > > I'm trying to call object_list in > > > django/views/generic/list_detail.py > > > with allow_empty=True > > > but if I use {{object_list.count}} in a template I get the following > > error: > > > (1064, "You have an error in your SQL syntax; check the manual that > > corresponds to your MySQL server version for the right syntax to use > > near 'count,1' at line 1") > > > the generated sql looks like: > > > SELECT DISTINCT > > `db_tmpcompound`.`id`,`db_tmpcompound`.`name`,`db_tmpcompound`.`mol_weight` > > FROM `db_tmpcompound` > > WHERE ((`db_tmpcompound`.`db_nr` < 5)) > > ORDER BY `db_tmpcompound`.`db_nr` ASC LIMIT count,1 > > See this ticket: > > http://code.djangoproject.com/ticket/2351 > > Michael > > -- > noris network AG - Deutschherrnstraße 15-19 - D-90429 Nürnberg - > Tel +49-911-9352-0 - Fax +49-911-9352-100http://www.noris.de- The > IT-Outsourcing Company > > Vorstand: Ingo Kraupa (Vorsitzender), Joachim Astel, Hansjochen Klenk - > Vorsitzender des Aufsichtsrats: Stefan Schnabel - AG Nürnberg HRB 17689 --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Created pluggable board and wiki applications
Hi, Since i haven't found any existing board / wiki applications which would fit my needs and are easy enough to integrate into a custom django project, i have created my own .. i tried to stick to the http://code.djangoproject.com/wiki/DosAndDontsForApplicationWriters as much as possible.. and i see no reason it wouldn't fit into any project .. i have created a site http://sct.sphene.net (which .. of course uses exactly this wiki and board) describing it's functionality and how to use it - http://sct.sphene.net/wiki/show/Documentation) .. i've released it under the BSD license .. so if anyone is interested feel free to download the code and try it out.. Although it does not provide full functionality yet you would expect from a wiki / board (especially user permission handling is very minimal yet) .. it is still quite useful imho.. Please let me know what you think .. thx & cu, Herbert Poul --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
newforms question: select widget
I just want to render a formfield as a select field without having to create a Form class. Why does this not work? from django import newforms as forms ConfForm = forms.models.form_for_model(Conference) form = ConfForm() choices = ( ('Monday','Monday',), ('Tuesday','Tuesday',), ('Wednesday','Wednesday',), ('Thursday','Thursday',), ('Friday','Friday',), ('Saturday','Saturday',), ('Sunday','Sunday',) ) day_of_week = forms.Select('day_of_week') day_of_week.render('day_of_week','Monday',None,choices) exceptions.ValueErrorTraceback (most recent call last) blah...blah... ValueError: dictionary update sequence element #0 has length 1; 2 is required --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: Postgre and mysql
On 2/21/07, Grupo Django <[EMAIL PROTECTED]> wrote: > Hello, I want to know which of these two databases are prefered by > django. I can choose and I'd like to know if there is some differences > in performance or integration (like foreign keys). > If someone knows a comparative between both of them it would be good, > not only about django integration but about everything. Objectively, Postgres supports more SQL features than MySQL, and generally has better data integrity features (MySQL's default table type, for example, doesn't "really" enforce foreign key integrity). MySQL tends to be faster with large numbers of small queries, but Postgres tends to do better with more complex things and also seems to scale better on multi-core systems. MySQL, on the other hand, tends to be more widely supported on consumer-level hosting plans, and tends to have more "friendly" administration features (e.g., web-based control panels for managing a database). Subjectively, I prefer Postgres. -- "Bureaucrat Conrad, you are technically correct -- the best kind of correct." --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: podcast-feed
thanks. that´s exactly what I was looking for. patrick. Am 20.02.2007 um 21:06 schrieb [EMAIL PROTECTED]: > > I did it, but not using the syndication. I just use a generic list > view and point to a template to build the xml. Not hard at all. Here's > my template: > > > http://www.itunes.com/dtds/podcast-1.0.dtd; > version="2.0"> > > Gretsch Pages Radio > http://gretschpages.com/radio/ > Music from the Gretsch Pages Community description> >2007 The Gretsch Pages copyright> > en > > {% for i in object_list|dictsortreversed:"pub_date" %} > > {{i.song_title|escape}} - > {{i.artist.preferred_name}} > http://gretschpages.com/media/ > {{i.song_file}}" type="audio/mpeg" /> > {{i.pub_date}} > http://gretschpages.com/media/ > {{i.artist.avatar }}" /> > > {% endfor %} > > > > > On Feb 20, 7:46 am, "va:patrick.kranzlmueller" > <[EMAIL PROTECTED]> wrote: >> has anyone done a podcast-feed (iTunes) using django syndication? >> >> I know that it´s possible by changing feedgenerator.py. >> if somebody has already done it, it´d be great to share the code and/ >> or give some advice. >> >> thanks, >> patrick > > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: error in SQL syntax for allow_empty=True in list_detail.py
abe: > I'm trying to call object_list in > > django/views/generic/list_detail.py > > with allow_empty=True > > but if I use {{object_list.count}} in a template I get the following > error: > > > (1064, "You have an error in your SQL syntax; check the manual that > corresponds to your MySQL server version for the right syntax to use > near 'count,1' at line 1") > > the generated sql looks like: > > > SELECT DISTINCT > `db_tmpcompound`.`id`,`db_tmpcompound`.`name`,`db_tmpcompound`.`mol_weight` > FROM `db_tmpcompound` > WHERE ((`db_tmpcompound`.`db_nr` < 5)) > ORDER BY `db_tmpcompound`.`db_nr` ASC LIMIT count,1 See this ticket: http://code.djangoproject.com/ticket/2351 Michael -- noris network AG - Deutschherrnstraße 15-19 - D-90429 Nürnberg - Tel +49-911-9352-0 - Fax +49-911-9352-100 http://www.noris.de - The IT-Outsourcing Company Vorstand: Ingo Kraupa (Vorsitzender), Joachim Astel, Hansjochen Klenk - Vorsitzender des Aufsichtsrats: Stefan Schnabel - AG Nürnberg HRB 17689 --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: Postgre and mysql
On 21-Feb-07, at 8:06 PM, Grupo Django wrote: > Hello, I want to know which of these two databases are prefered by > django. I can choose and I'd like to know if there is some differences > in performance or integration (like foreign keys). in brief, postgres tries to be standards compliant - so if you are worried about standards ... -- regards kg http://lawgon.livejournal.com http://nrcfosshelpline.in/web/ --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: Yet another ManyToMany with "Self" question ...
More on this ... it seems that django adds two entries to the join table. Doing: manager.subordinates.add(employee) added two entries: id = 7 from = 1to = 2 id = 8 from = 2to = 1 Is this the correct behavior? I would assume only one relationship should be added (from = 1 to = 2) Hmm ... looking deeper it seems the answer is in the "symmetrical" flag ... let me investigate. -Sandy --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: Yet another ManyToMany with "Self" question ...
Anyone? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Seeking best-practices: modular site hosting multiple URLs
I would like to find references to "best practices" regarding the design of a major site with these characteristics: (1) The site will support multiple URLs, which appear visually to be entirely separate sites but which will share much of the same implementation. The "site" module obviously provides the basic functionality here... that's a given. (2) Each site will offer much the same functionality, that is to say, the same apps such as shopping-cart, messaging and inventory. But once again, each site is visually and functionally distinct. My particular interest here is: how the internal directory-structure (as seen by the developer, not the end-user URIs) and settings can be most-efficiently set up to maximize code-reuse (cohesion) while minimizing (or better yet, eliminating) coupling between the sites. I'm no stranger to Django. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: Postgre and mysql
> Hello, I want to know which of these two databases are prefered by > django. I can choose and I'd like to know if there is some differences > in performance or integration (like foreign keys). http://www.djangoproject.com/documentation/faq/#what-are-django-s-prerequisites "PostgreSQL is recommended, because we're PostgreSQL fans, and MySQL and SQLite 3 are also supported." > If someone knows a comparative between both of them it would be good, > not only about django integration but about everything. I tend to prefer PostgreSQL because I find it more featureful. I have been stung too many times with MySQL when I reach for a particular standard SQL feature only to find it's not there, or that I need to upgrade to the bleeding-edge versions to get the features I want. The history I've seen is that MySQL: started fast but feature-deficient; added/adding SQL features with further releases PostgreSQL: started quite SQL compliant/feature-rich but was a bit slow; grew faster with further releases There are also administrative issues: I find MySQL easier to get up and running as well as administer. PostgreSQL has more of an "enterprise" feel to it which can be both a blessing and a curse (have to start postmaster as a particular postgresql user rather than launching as root and then dropping privs). One might opt to use MySQL or SQLite for development and then migrate to MySQL or PostgreSQL. I've had occasional problems with MySQL corrupting data (usually when there's a high-volume of writing to the DB) so that was the deciding nudge towards PostgreSQL for anything production. MySQL may have improved since my souring experiences. Just my $2.0e-2 (USD) from my experiences with both. -tkc --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: Postgre and mysql
The essential differences to consider are (1) transactional support, and (2) data-types and SQL support. Both systems can be expected to deliver comparable performance under ordinary loads. On Feb 21, 9:36 am, "Grupo Django" <[EMAIL PROTECTED]> wrote: > Hello, I want to know which of these two databases are prefered by > django. I can choose and I'd like to know if there is some differences > in performance or integration (like foreign keys). > If someone knows a comparative between both of them it would be good, > not only about django integration but about everything. > > Thank you. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: Looking for competent Django Developer mod of Existing Client Database package
>From your description, I conclude that your application must be "generally, in good shape, running okay, and so on." That now you simply want it to be extended. Fortunately for you, the Django framework makes this a very straightforward process. (The fact that one Django installation is now supporting multiple site-addresses is, of course, a built-in feature of Django.) The next step would be for you to fully describe what you want changed about the site, and what you want added. You might wish to post those details for all to see so that you won't be bombarded with individual requests. Clearly, a site-modification is done by first cloning the existing site (database and executables), removing all "live" customer- information, particularly financial, and inserting a couple of dummy entries. The source-code is checked-in to a revision control system so that any version of it can be retrieved and so that all changes made to it during the modification process can be tracked. If you chose to have Sundial Services perform the work, a blanket contract called a General Services Agreement (GSA) would be executed, and under that contract, Task Orders would be issued, each of which describes a well-defined unit of work (large or small), with stated delivery times and price. A blanket-retainer maintenance agreement (covering ongoing attention to the site) is also available. The important characteristic is that both parties must have a clear idea of what is to be done. (Often, Task Order #1 is the task of mapping- out the possible future Tasks.) Mike Robinson :: Chattanooga, TN :: (423) 255-9524 :: http://www.sundialservices.com Fantasys wrote: > Looking for a really competent Django person to work on an Existing > Client Database package. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Postgre and mysql
Hello, I want to know which of these two databases are prefered by django. I can choose and I'd like to know if there is some differences in performance or integration (like foreign keys). If someone knows a comparative between both of them it would be good, not only about django integration but about everything. Thank you. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: Pro Django: Web Development Done Right
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Boy, I sure wish I could buy the book already! - --Trey Russell Keith-Magee wrote: > On 2/21/07, Jaroslaw Zabiello <[EMAIL PROTECTED]> wrote: >> I have just found "Pro Django: Web Development Done Right" book in >> Amazon. Is it related with DjangoBook or it is another, different book? > > They are one and the same book. The draft chapters are being published > online for comment to make the final printed product as good as it can > be. > > Yours, > Russ Magee %-) > > > - -- ++---++ Kingfisher Operations - System Administration - Development - Database Administration Trey Darley - Principal ++-++ "Svensson," I say, "kindly remember this most banal of truisms: the most incredible comedies are written by life." "My life is more like a railway timetable." "Just wait till time intervenes. The alchemy of time transforms everything into comedy. Everything..." [J. Skvorecky, The Engineer of Human Souls] ++-++ - -BEGIN PGP PUBLIC KEY BLOCK- Version: GnuPG v1.2.4 (Darwin) mQGiBEI1sRgRBACNV6khv1U8DuxDbMGdZ/Obvu5yFRmzYvgbc2nSBMNuCBXWt5CX qaXccQEvsXKAex6D8UqzbaNCy2+rTuubBAslZqjM7gBtlrbZLmUUntYKpm8MbBAt /Rkrw11tjFL3QHwhup9Oj6NjHTX0aia1Ch9KAFSoa9Navr2rQ/oCQYk0DwCgoVBN Pw0JjR0oBRaPIdjj7hEz7kkD/Ap17h2fopZhXdtpQh9cBovmBnt98cHVnm63tkCl SioHtPiF7tBQ/DQizu3p3zGQ9gfF5n2wopK3OVmLLFeVNJo95UIBtlFe6csAuxMq GOXw1aHdZL9L7aI14W3bRcrjgYpbhrccEpnbKcHsaHwneyaCQBLFGnOBTdy7t7+H JHz0A/wNzoOliS1YlFSouxzbA9BDXa6s9bLQe6ED0cptFNjUdDVjL2LKkc1ac55F bn5KKAL21QiwzFFm7CNgEOBqEFvNCLzD8ElgPoxO7uG6bya7YnArs75wh/WAKRMR gPV7wWillsyT444lwpbnIyTU78D49+lXVxwMWvNBJ0LE7TC3MbQwVmVybm9uIE9s aW4gIlRyZXkiIERhcmxleSwgSUlJIDx0cmV5QHRyZXlrYS5uZXQ+iF4EExECAB4F AkI1sRgCGwMGCwkIBwMCAxUCAwMWAgECHgECF4AACgkQQXaSM49tivCsvgCfUVwH EFYh4jytlVlsVmVtCgmUkjcAoIIFanl3xT/B0F7k7ApYd/YW4pk9uQINBEI1sUMQ CACgdpuh5EMXNYD/kuHvsJNraqvqR5+1r/WvPF6Fmst86UlvALmZkTjECPRCmJk5 LJeOn8PX/uPAe7oP4CzzbvCiWG/VXRL2z3qo50V1hFQ7c+70DKd7oo+CU4yN60A7 wvtjg3DDOhszKuc3GmwUwiz/eiG5XTN0aIbiHH5HMqt0NPnLZcgfhrd0ueS4bHco p8pbCuVXTi7YRi4FynIL8aX8QPVmWWcwUU/Ty68ECLxqGx+QFPSdh0UC6gmPmy34 rG941Bvgjh75oOT2RFsAXGxBI8KY8Dhzszkui3VUy+rGtHr8K/HTxHm6ojuzUtLH nfZoYmW6p1Ds+hnxmygXL4g3AAMFB/47ijbnPWoJvToRP6UwHFdnuWgs9ePfGQyf ejiE6scVYn9FSfUWtt3Vu8lw+rD1nhgBYBPfdnWzTmoYHrliG+jbpSCpLHUcIaRS cm4TIjZGRFZMkscpltRxseDCvcVn6wzMEDoRuGmEhc7JakA1l2FanQa1nXi/UZqQ dxr/tPpGff8vQFjclXS2H9FNIT98gOdFvjVdmpqe5K1vSbr51UEaDfDw5qPgP6fq xwgIqOBFl+DtN3TdZMe7LhsoSOXMPji2iXei9dYOfEjfquHA9HXAPur1ygRwEunR +IXtKjYAysrieltxi3T5ATQAOQJCe6ybDDiLcdmdsatmawYOm5B7iEkEGBECAAkF AkI1sUMCGwwACgkQQXaSM49tivBdEwCfaoHkMuFT0AnC7qhoQ8sGzCKb6JYAn1Av sIdX5IgNnrKxG3XAF/Z6SZ6C =EHLO - -END PGP PUBLIC KEY BLOCK- -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.5 (Darwin) iD8DBQFF3E7dQXaSM49tivARAr6pAJoD+G57QpjSudf23ewdCBMB1KHBDgCePERm w66wJ+2FM8e8UdoxrBBPkj4= =Mozs -END PGP SIGNATURE- --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: Pro Django: Web Development Done Right
On 2/21/07, Jaroslaw Zabiello <[EMAIL PROTECTED]> wrote: > > I have just found "Pro Django: Web Development Done Right" book in > Amazon. Is it related with DjangoBook or it is another, different book? They are one and the same book. The draft chapters are being published online for comment to make the final printed product as good as it can be. Yours, Russ Magee %-) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: Captcha example
Hi Joe, Thanks for taking the time to respond--that makes sense to me. I had to go all the way to Poland but finally found a working code example (Dziękuję!). Here's the link in case it's helpful for someone else: http://www.rkblog.rk.edu.pl/w/p/django-and-captcha-images/ --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: Newforms: Setting field width?
> All my form elements on a newforms form are rather tiny. Is there any > way to specify the width of these fields? By default no length is specified for inputs, so they will be whatever size the browser defaults to. It's not the prettiest, but if you specify the widget to use, you can set attributes for that widget, such as "size" for a TextInput. class SignupForm(forms.Form): username = forms.CharField(widget=widgets.TextInput(attrs={'size': 100})) Another way would be to set the sizes using css. #myform input { width: 100em; } Scott --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Pro Django: Web Development Done Right
I have just found "Pro Django: Web Development Done Right" book in Amazon. Is it related with DjangoBook or it is another, different book? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Pro Django: Web Development Done Right
I have just found "Pro Django: Web Development Done Right" book in Amazon. Is it related with DjangoBook or it is another, different book? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
ImageField and adding username to the path
Hi, in my application, i want to enable the users to upload pics. These pictures are thus linked to the user. I want to reflect that on a filesystem bases by saving the pics in a directory that also has the authenticated user. Getting the authenticated user isn't a problem, customizing the path is. In my model i have this code: IMAGE_PATH = "img/_USER_/icons/" class Icon(models.Model): ... image = models.ImageField(upload_to=IMAGE_PATH, blank=True, help_text="Maximum 100px by 100px, 50 kb") ... def save(self): self.user = threadlocals.get_current_user() if ( self.image ): self.image = self.image.replace("_USER_",str(self.user)) However this doesn't change the image path and it's still saved in img/_USR_/icons/ instead of img//icons. This is confirmed by self.get_image_url() How can i get the _USER_ replaced by the username? Thanks, Benedict --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
cant get date js thingie using form_for_model
hi i was using form_for_model and it worked great - only thing, I didnt get the fancy date entry js thingie like in admin. What do I need to do to get that? -- regards kg http://lawgon.livejournal.com http://nrcfosshelpline.in/web/ --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---