Denver Django users

2012-05-03 Thread Brian Rosner
don't hesitate to email me :-) Brian Rosner http://twitter.com/brosner -- You received this message because you are subscribed to the Google Groups "Django users" group. To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/ahnYC8wsFNIJ. To post to t

Re: [pinax-users] Learn DJango first, then learn Pinax; or just learn Pinax straight-off?

2011-09-26 Thread Brian Rosner
before diving into Pinax. NOTE: the documentation linked is for the development version of Pinax. -- Brian Rosner http://twitter.com/brosner -- 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@

Re: Selling Django

2010-06-18 Thread Brian Rosner
drops in activity. I use it everyday and am constantly thinking of things to do to improve it. Activity will pick up over time. There has been a ton of changes since 0.7. See http://github.com/pinax/pinax/compare/0.7.X...master (Github won't even load the full list since it so big :-) ) B

Re: Deploying for designers

2010-01-23 Thread Brian Rosner
been recently using http://github.com/ask/ghettoq for a database backend. This makes dealing with the queue dependancies much better since you can run it off SQLite for development. As long as the designer has access to Python 2.5+ (and your code can run on it) pretty much everything is there

Re: Formsets issue

2009-02-18 Thread Brian Rosner
urceRoleForm.__init__ after this slight modification. Then you can simply check for None and deal with the fields attributes that way. Brian Rosner http://oebfare.com --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups

Re: Formsets issue

2009-02-18 Thread Brian Rosner
dictToSend, > context_instance=RequestContext(request)) One thing I am noticing here is that if the formset fails to validate you are not putting the formset in the dictToSend to be rendered with the error messages. The best way to do this is just simply unindent the formset assignment t

Re: FormSet issue. Pre-populating from queryset

2008-12-11 Thread Brian Rosner
ides model formsets that know how to deal with this internally. Go read up on inline formsets which is a layer on top of model formsets. http://docs.djangoproject.com/en/dev/topics/forms/modelforms/#inline-formsets -- Brian Rosner http://oebfare.com --~--~-~--~~~---~--

Re: inline forms/subforms: how to use inlineformset_factory ?

2008-11-29 Thread Brian Rosner
nce is passed to the template. Also, don't call a FormSet class or instance 'form'. That is just going to be confusing. It is better named FormSet (or some variant depending on the models) for a class and formset for instances. This will help you see the differences and when you are

Re: Creating formsets through AJAX

2008-11-19 Thread Brian Rosner
On Wed, Nov 19, 2008 at 10:23 PM, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > > > On 20 nov, 06:01, "Brian Rosner" <[EMAIL PROTECTED]> wrote: >> On Wed, Nov 19, 2008 at 9:53 PM, [EMAIL PROTECTED] >> >> <[EMAIL PROTECTED]> wrote: >

Re: Creating formsets through AJAX

2008-11-19 Thread Brian Rosner
I have written some information on that ticket that may be of use to you. -- Brian Rosner http://oebfare.com --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send emai

Re: Creating formsets through AJAX

2008-11-19 Thread Brian Rosner
On Wed, Nov 19, 2008 at 9:14 PM, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > On 20 nov, 05:01, "Brian Rosner" <[EMAIL PROTECTED]> wrote: >> On Wed, Nov 19, 2008 at 8:59 PM, Brian Rosner <[EMAIL PROTECTED]> wrote: >> > On Wed, Nov 19, 2008

Re: Creating formsets through AJAX

2008-11-19 Thread Brian Rosner
On Wed, Nov 19, 2008 at 8:59 PM, Brian Rosner <[EMAIL PROTECTED]> wrote: > On Wed, Nov 19, 2008 at 8:43 PM, Luper Rouch <[EMAIL PROTECTED]> wrote: >> For django to save the formset correctly when it is submitted, I have to >> manually set INITIAL_FORMS to 0 in javascri

Re: Creating formsets through AJAX

2008-11-19 Thread Brian Rosner
ying to shove a square object through a round hole. Why are you using a model formset when there is "real" queryset? Model formsets are simply a thin layer over formsets. It sounds like you need to those to cleanly write your code and not resort to hacking a model formset to work without a

Re: Using raw_id_fields with a many-to-many field

2008-10-29 Thread Brian Rosner
rather be 'group' if anything. > The resulting admin tool generates a separate Membership ID field > (table row) with a spyglass next to it. Each spyglass sets or replaces > the single ID in that row. I presume you are asking a question here? That extra row is technica

Re: Email notification on updates?

2008-10-29 Thread Brian Rosner
oaded to their own background process for processing as well. > > Advice? If you want more direct feedback, check out the #pinax channel on freenode. :) -- Brian Rosner http://oebfare.com --~--~-~--~~~---~--~~ You received this message because you are subscribed

Re: Context Processor in Admin

2008-09-17 Thread Brian Rosner
o differentiate between the two you can put a conditional around kwargs["add"] and/or kwargs["change"] which will be True in their respective cases. -- Brian Rosner http://oebfare.com --~--~-~--~~~---~--~~ You received this message because you are su

Re: Inline models in the admin interface not re-savable

2008-08-22 Thread Brian Rosner
of the save() methods? > Looks like you are hitting http://code.djangoproject.com/ticket/7888. I am working on a fix today actually. Keep an eye out there. -- Brian Rosner http://oebfare.com --~--~-~--~~~---~--~~ You received this message because you are su

Re: formset and __init__

2008-08-20 Thread Brian Rosner
"my_own_argument"] = "my value" return super(MyBaseFormSet, self)._construct_form(i, **kwargs) > > On Aug 20, 5:21 pm, "Brian Rosner" <[EMAIL PROTECTED]> wrote: >> On Wed, Aug 20, 2008 at 9:10 AM, patrickk <[EMAIL PROTECTED]> wrot

Re: formset and __init__

2008-08-20 Thread Brian Rosner
> extra=5). > question is: where do I set path_server & path? You must subclass django.forms.formsets.BaseFormSet and override _construct_form to pass in your parameters. Then you can pass your FormSet subclass as the base of the FormSet returned by formset_factory like so: formset_fa

Re: superuser has no rights with newforms admin

2008-07-19 Thread Brian Rosner
e app you would also keep around register calls for the default AdminSite instance for the user common case. Brian Rosner http://oebfare.com --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users&qu

Re: newforms-admin branch has been merged into trunk

2008-07-19 Thread Brian Rosner
On Jul 18, 2008, at 6:22 PM, Ariel Mauricio Nunez Gomez wrote: > BTW: Bryan, you've gotta redo the commits visualization[1] for > another big explosion!! I plan on updating the visualization right after we release 1.0. :) --~--~-~--~~~---~--~~ You received thi

newforms-admin branch has been merged into trunk

2008-07-18 Thread Brian Rosner
branch is now closed. Onward to 1.0! [1]: http://code.djangoproject.com/changeset/7967 [2]: http://code.djangoproject.com/wiki/BackwardsIncompatibleChanges Brian Rosner http://oebfare.com --~--~-~--~~~---~--~~ You received this message because you are subscribe

Re: Newforms Admin - Overriding the Save Method of an Inline Model

2008-07-02 Thread Brian Rosner
ck into how model formsets work. It might help you uncover why this is. > > Brian Rosner http://oebfare.com --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, s

Re: newforms and views.generic.create_update.create_object

2008-06-26 Thread Brian Rosner
On Jun 26, 2008, at 1:23 PM, timc3 wrote: > > Might be a stupid question but how did you apply the patch? Get inside your Django directory and execute:: patch -p0 < the_path.diff That should get it going. Let me know if you have any more questions. Brian Rosner http://oe

Re: Unexpected Keyword Argument 'radio_admin'

2008-06-26 Thread Brian Rosner
hed your copy of Django from newforms-admin to trunk.\ Brian Rosner http://oebfare.com --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email

Re: Display image in django admin

2008-06-19 Thread Brian Rosner
On Jun 19, 2008, at 11:34 AM, Leon Yeh | New Avenue.net wrote: > > def thumbnail(self): > return """""" % (self.photo) After the function add thumbnail.allow_tags = True. Brian Rosner http://oebfare.com --~--~-~--~~---

Re: correct list for newforms admin questions? named urls / replacing admin root page

2008-06-17 Thread Brian Rosner
the newforms-admin branch. See ticket #6470 [1]. At this point your best bet is to hardcode the URLs. [1]:http://code.djangoproject.com/ticket/6470 Brian Rosner http://oebfare.com --~--~-~--~~~---~--~~ You received this message because you are subscribed to the G

Re: auto generate models

2008-06-13 Thread Brian Rosner
sure that the ORM generates the SQL you would expect from a foreign key. -- Brian Rosner http://oebfare.com --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, sen

Re: Change field and Admin meta class properties dynamically

2008-05-28 Thread Brian Rosner
elopment closely [2] most pain can be mitigated. [1]: http://code.djangoproject.com/wiki/NewformsAdminBranch [2]: http://code.djangoproject.com/log/django/branches/newforms-admin Brian Rosner http://oebfare.com --~--~-~--~~~---~--~~ You received this message because

Re: Help with custom validator - please, please, please

2008-05-15 Thread Brian Rosner
lean_name(self): > value = self.cleaned_data["name"] > if name == "Brian": > raise forms.ValidationError, u"You are not allowed to be named > Brian." > return value Oh, and if name == "Brian" should

Re: Help with custom validator - please, please, please

2008-05-15 Thread Brian Rosner
.register(Person, PersonAdmin) That is the code required, I haven't tested it, but it should work. Clearly don't drop it into one file as it is best to split that code out, but shown for ease of coding ;) Let me know if you have any furth

Re: IntegrityError on newforms-admin

2008-05-09 Thread Brian Rosner
On May 9, 4:31 am, Nuno Mariz <[EMAIL PROTECTED]> wrote: > I'm using newforms-admin and I've got a "duplicate key violates unique > constraint" when I'm added new record(with the same value on field > that already exists in the db) in admin interface. > I've an "unique=True" in the field, should

Re: Pre-processing and preparing data in a separate thread or process?

2008-04-15 Thread Brian Rosner
> Of course, you'll have to develop a good workflow so that either your > user is notified on that page when the import is completed (possibly > through some ajax-y interface either by polling or using a Comet > system) or, the easy way out, just provide a page that provides a > status, where your

Re: newforms-admin InlineFormSet usage?

2008-03-07 Thread Brian Rosner
> I gave a look at newforms.models and I see this "InlineFormSet" class, > but I can't really understand how to use it, nor I can find docs on > this matter, the only thing I found (don't ask me how) is > http://code.djangoproject.com/ticket/6632 .. that explains the various > FormSets (including

Re: Newforms-admin: filter_horizontal doesn't work

2008-03-07 Thread Brian Rosner
> "Hold down "Control", or "Command" on a Mac, to select more than one." > > and NO select boxes, search input etc! What revision of newforms-admin are you using? Also, what browser is this behavior is displayed i

Re: Reporting with Django

2008-02-14 Thread Brian Rosner
b [1] python library. [1]: http://www.reportlab.org/ -- Brian Rosner http://oebfare.com --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to dj

Re: Python & Django Noob at Django Sprint at PyCon 2008?

2008-02-14 Thread Brian Rosner
ge. I look forward to seeing you at PyCon this year! [1]: http://code.djangoproject.com/wiki/SprintIdeas [2]: http://code.djangoproject.com/wiki/SprintPyCon2008 -- Brian Rosner http://oebfare.com --~--~-~--~~~---~--~~ You received this message because you are su

Re: newforms-admin inlines question

2008-02-11 Thread Brian Rosner
It should be "extra" without the "s". [1]: http://code.djangoproject.com/ticket/6075 -- Brian Rosner http://oebfare.com --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To pos

Re: newforms-admin replacement for core=True in inline models?

2008-02-03 Thread Brian Rosner
n issue in trac if you can't find > anything matching. http://code.djangoproject.com/ticket/5878 -- I am still unsure of the correct way to fix this, but it is a known issue. -- Brian Rosner http://oebfare.com --~--~-~--~~~---~--~~ You received this mess

Re: Newbie trying to install django-trunk from svn on Ubuntu 7.10

2008-02-01 Thread Brian Rosner
port PYTHONPATH=/home/user/django-trunk -- Brian Rosner http://oebfare.com --~--~-~--~~~---~--~~ 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@googlegroup

Re: Newbie trying to install django-trunk from svn on Ubuntu 7.10

2008-02-01 Thread Brian Rosner
't need to be switching between versions very often or it is a production server, for example. -- Brian Rosner http://oebfare.com --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" gro

Re: Stylesheet Inheritance

2008-02-01 Thread Brian Rosner
using the RequestContext to ensure {{ MEDIA_URL }} is displayed correctly in your templates. (This will only work if you are using HEAD of Django trunk, otherwise you must write your own context_processor). -- Brian Rosner http://oebfare.com --~--~-~--~~~---~--~---

Re: newforms validator_list

2008-02-01 Thread Brian Rosner
ield1 is filled, field2 is not required.) As I pointed out above this is still newforms. This type of validation is very possible since the form clean_FIELD methods are never passed its own value. It is the job of the developer to pull out the values from cleaned_data that a clean_FIELD

Re: newforms and updating

2008-01-25 Thread Brian Rosner
est.FILES, instance=instance) if form.is_valid(): form.save() else: form = MyModelForm(instance=instance) return render_to_response("mytemplate.html", { "form": form, }, context_instance=RequestContext(request)) -- Brian Rosner ht

Re: Adding a request.user to a ModelForm instance

2008-01-07 Thread Brian Rosner
uest.user #excluded in PlaceForm > newplace.save() Wow, you are so close to making this work :) You are passing in "False" to commit which will always be a True statement. Remove the quotes to pass in the boolean value False. It should then work. > > Exeption after exe

Re: File Upload perfomance

2007-12-31 Thread Brian Rosner
red in memory then written to disk. Clearly you can see this being a problem with large files of 600-900 MB. Check out [1] which has patches to stream large files to disk before saving it in its destination directory as defined by upload_to in your FileField. [1]: http://code.djangoproject.com/t

Re: how to handle a zero-based pagination in templates as one-based?

2007-12-20 Thread Brian Rosner
zero-based, but > page_range (for the template-output) is one-based. > > this wouldn't be a problem if i could switch to 1-based object- > pagination. so how do i dow? write my own object-pagionation-subclass? > > -- Brian Rosner http://oebfare.com --~--~

Re: database API filter() vs get()

2007-12-17 Thread Brian Rosner
database won't be hit until it is evaluated. Ex. it is iterated over in a for loop, you do a[0].id, or you provide a step in the slice a[::2]. .get will actually hit the database when called. -- Brian Rosner http://oebfare.com --~--~-~--~~~---~--~~ You re

Re: How do you add the edit of another object from another object's admin view

2007-12-17 Thread Brian Rosner
Yes, you can. This is called edit_inline in Django. Check out [1] and read that section. It will show you how to accomplish edit_inline. [1]: http://www.djangoproject.com/documentation/model-api/#many-to-one-relationships Thanks. -- Brian Rosner http://oebfare.com --~--~-~--~--

Re: New Forms Foreign key field Filtered choices

2007-11-02 Thread Brian Rosner
What you really need is to use the formfield_callback argument to form_for_instance. This allows you to override the default fields that are returned for a given field in the model [1]. There is an open bug, [2], that will allow for an easier way of overriding the queryset that is ultimately ren

Re: newforms-admin raw_id_fields performance problem

2007-10-09 Thread Brian Rosner
moved from it. Patches are welcome. (And no Malcolm, > that's not directed at you ;) Your wish is my command ;) http://code.djangoproject.com/ticket/5720 > > Joseph > > [1] > http://code.djangoproject.com/browser/django/branches/newforms-admin/django/contrib/admin/options.py#L503

Re: How to make a mapping/alias db table? (many-to-many)

2007-08-22 Thread Brian Rosner
> If I added the join table manually would Django still work? Or does it > need to "know" about the table? Yes, it would work fine. Django is expecting it and doesn't find it and throws that error about not finding it. Until a schema evolution solution gets merged into trunk

Re: age in years calculation

2007-08-21 Thread Brian Rosner
Err, my bad. I wasn't thinking. I need to stop writing replies after having a few beers. ;) On Aug 21, 9:09 pm, Brian Rosner <[EMAIL PROTECTED]> wrote: > There isn't a solution to your particular problem. Your problem is > that you are accepting invalid data. Nobody can

Re: age in years calculation

2007-08-21 Thread Brian Rosner
There isn't a solution to your particular problem. Your problem is that you are accepting invalid data. Nobody can be born on a day that doesn't exist. I'd recommend verifying that the data be entered into the database is valid. On Aug 3, 5:37 am, Bram - Smartelectronix <[EMAIL PROTECTED]> wro

Re: Presentations about Django?

2007-08-10 Thread Brian Rosner
with the promotion of Django and keeping those presentations consistent. -- Brian Rosner http://www.brosner.com/blog --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this gro

Re: Meta class preventing table add

2007-06-25 Thread Brian Rosner
oach_email`,`coach_phone`,`team_picture`,`_order`) VALUES > > ('2','2005-09-10','2','','','','','',(SELECT COUNT(*) FROM > `football_team` WHERE `school_id` = '2'))" > > > This error

Re: newforms, manytomany, default value.

2007-06-16 Thread Brian Rosner
eate the form from several > _models_ when the user is trying to add new information and 3) how to > instantiate the multiple save objects from the POSTed form. > > Many thanks for your kind assistance in what I know must be quite a > simple operation. You might want to check out

Re: "showable" but not "editable" field in the Admin screens

2007-05-22 Thread Brian Rosner
You may also want to check out http://code.djangoproject.com/ticket/3990. On May 22, 5:19 am, "Seiji - technics" <[EMAIL PROTECTED]> wrote: > Hi all, > > Is there a way to show as specific field in the admin screens but > without permitting to edit it? > I want something similar to "editable=Fals

Categorization of Two Models

2007-05-22 Thread Brian Rosner
ement this? I first thought about using generic relations, but not 100% sure on how to go about it. -- Brian Rosner http://www.brosner.com/blog --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users&

Re: How do they do the filters in admin?

2007-05-03 Thread Brian Rosner
key/ > value pair to the end of the link. > > /?object_id__exact=2 > > How then, does this get implemented into the query to yield correct > results? > > Sincerely, > > > Check out the ChangeList class here: http://code.djangoproject.com/browser/django/tr

Re: How do I pass label's attributes in newforms

2007-04-25 Thread Brian Rosner
> I don't think it's possible to add a class attr to the label tag that Django generates through its lazy form methods. You can pass an attrs dictionary to a widget. Check into widgets, there are some good examples in the newforms_admin branch. The only other alternative to specifyi

Re: Newforms: adding a date picker

2007-04-14 Thread Brian Rosner
You will want to check out how to create widgets. Here might be an example you are looking for as well as a an example in general. http://code.djangoproject.com/browser/django/branches/newforms-admin/django/contrib/admin/widgets.py On 2007-04-14 11:32:53 -0600, Ray Cote <[EMAIL PROTECTED]> s

Re: Drop-down choice or create new; how to handle?

2007-04-10 Thread Brian Rosner
provide, but I have a quick question about the UI of it. How would something this this handle a foreign key model that had more than one required field to save itself? Just wondering if you came across something like that. To me it would seem that creating a custom widget that

Re: Index in admin

2007-04-09 Thread Brian Rosner
orms-admin is on its way to help resolve this issue. Take a look at newforms-admin branch: django/newforms/formsets.py. This is what is going to be used for edit_inline functionality which does enable the functionality to be there. --

Re: newb: newforms and passing an extra parameter: forms.SalesForm(request.POST, p_id)

2007-03-16 Thread Brian Rosner
p_id into SalesForm. It sounds like there is a simpler solution to this as opposed passing it into the form class which shouldn't really care about p_id at all. -- Brian Rosner http://www.brosner.com/blog --~--~-~--~~~---~--~~ You received this message because

Re: django on mediatemple (dv) box?

2007-03-07 Thread Brian Rosner
o server: /etc/httpd/ > modules/mod_python.so: undefined symbol: apr_table_compress > > i've seen on some other forums that my apr version needs to be 0.9.4, > and that is the version i'm running. any idea what that might be? > > thanks again! > > On Mar 7, 10:34 am, Brian

Re: django on mediatemple (dv) box?

2007-03-07 Thread Brian Rosner
l put itself where it should go. I believe this is in /etc/httpd/modules which symlinks to /usr/lib/httpd/modules. Restart apache and you should be ready to go. -- Brian Rosner http://www.brosner.com/blog --~--~-~--~~~---~--~~ You received this message because you

Field default values don't seem to work as expected

2007-02-27 Thread Brian Rosner
If I have the given model in an app: class Product(models.Model): name = models.CharField(maxlength=150) list_price = models.FloatField(max_digits=10, decimal_places=2, default=0.00, blank=True) price = models.CharField(max_digits=10, decimal_places=2) cl

Re: Using NEWFORMS to select data from the MODEL

2007-02-13 Thread Brian Rosner
use. You can have multiple forms for each instance. My ModelInstanceForm uses a prefix since I wrote this code to allow a form with data in one model and a foriegn key form like listing the products that belong to a product page. So this may not work for you out of the box, but y

knowing not much about character encodings

2007-02-06 Thread Brian Rosner
Hey all, I am writing a new Django based application that will replace our current shopping cart system. All is great on that front and Django has been amazing. I have written xcart_convert.py that sends queries to the current database to pull out all of the information and move it over to the

Re: newbie strange behavior

2007-01-26 Thread Brian Rosner
Ah, that does make sense. Yeah I am running with a production server, but using a virtual host to contain out the production site from development. I suppose I can just build another Apache and strip it down for my development needs. Thanks for the tip. On Jan 26, 11:11 am, "Waylan Limberg" <[