Re: remove timezone support from one app

2014-01-13 Thread smcoll
What i wound up doing was to create a custom ModelField which deals with timezone-naive datetimes/timestamps: https://gist.github.com/smcoll/8405914 Then, i created schema/data migrations in South to convert existing values. On Saturday, January 11, 2014 11:05:54 AM UTC-6, smcoll wrote

Re: remove timezone support from one app

2014-01-11 Thread smcoll
UTC-6, smcoll wrote: > > i have timezone support enabled for my project, but there is one > application which i would like to behave as timezone-naive. How can this > be accomplished? > -- You received this message because you are subscribed to the Google Groups "

remove timezone support from one app

2014-01-11 Thread smcoll
i have timezone support enabled for my project, but there is one application which i would like to behave as timezone-naive. How can this be accomplished? -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and

Re: Admin UI Improvements for Ordered List Using Through Inline?

2012-12-02 Thread smcoll
Take a look at https://github.com/tkaemming/django-orderable. i've used it several times. On Saturday, December 1, 2012 3:24:49 AM UTC-6, Andrew Brown wrote: > > Greetings, > > I'm hopeful someone can point me in the right direction to improve the > admin UI for my app. I need to allow for

Re: How can I contrast two date-time type variables in template layer?

2012-11-23 Thread smcoll
The 'timesince' filter (based on django.utils.timesince) doesn't return a datetime.timedelta object, but a formatted string. So it would be hard to compare the resulting string with anything. i think you're going to need to do one of the following: - do the comparison in your view and add

Re: rendered template + additional data ajax response

2012-11-16 Thread smcoll
You want to include a rendered template in a JSON response? Take a look at https://github.com/eldarion/bootstrap-ajax and this related blog post: http://paltman.com/2012/08/23/twitter-bootstrap-and-ajax/ It's designed with the intention of supporting bootstrap markup, but i believe it's

Re: Adding values in my database via a ManyToMany relationship represented in admin.py

2012-10-19 Thread smcoll
It's true: the Run model does not have a "lines" attribute; the RunHasSample model does. Also, `s1` is not a Line nor a Sample, it's an instance of the intermediary RunHasSample. So you're not going to be able to directly add a Line instance to a Run instance- you'll have to add it to the

Re: loop user.get_profile displays none in a template

2012-10-19 Thread smcoll
i think you'd have to make a method on UserProfile that returns a dict of some of its attributes, and iterate over the result of that method in your template. That, or create a templatetag that adds it to the context. On Thursday, October 18, 2012 10:52:39 PM UTC-5, David Lee wrote: > > how

Re: Adding values in my database via a ManyToMany relationship represented in admin.py

2012-10-19 Thread smcoll
i'm not clear about your models: - the admin inline refers to a RunHasSample model that i don't see in your models.py - the Sample model has an FK to Sample, but looks like the run_has_sample table. Should i presume that's the RunHasSample intermediary model instead? - i

Re: Help getting my GeoDjango setup.

2012-10-16 Thread smcoll
You can add GIS support to your existing project, but as you suspected, your current db will not be sufficient. Unless someone knows how to convert an existing database, i believe you'll need to set up a new database from the postgis template, and move all your data to it. That process might

models.TimeField returning string rather than datetime.time with MySQL backend

2012-02-26 Thread smcoll
i need to interact with an existing MySQL database table, so i built a models.py file in a new app via introspection and then cleaned it up a bit. For the TIME types, i am using models.TimeField, which maps to a TIME type when using the MySQL backend. Here's a sample from that models.py file:

Re: What exactly does order_with_respect_to do?

2009-12-15 Thread smcoll
This is probably a dead thread, but... i think the answer given is incorrect. 'order_with_respect_to' adds an '_order' integer field to the model. Each set of instances that share a parent object of the relation specified by 'order_with_respect_to' get ordered as a set. So in the example, three

over-riding queryset for admin inlines

2009-08-13 Thread smcoll
i'm having trouble getting some instances to show up as inlines in the admin. Since i'm managing multiple sites from one domain, many of those instances won't show up because the condition in their default manager ("is it on this site?") fails. i'd like my admin to use `objects` for everything,

can't get comment moderation working, following docs

2009-08-11 Thread smcoll
i was having trouble enabling comment moderation in my app, so i decided to make a test app that would follow the docs at http://docs.djangoproject.com/en/dev/ref/contrib/comments/moderation/ as closely as possible. Unfortunately, moderation still isn't working for me: - If i create an Entry

FileField/ImageField and the sites framework

2009-07-02 Thread smcoll
i have a project running multiple sites. One of the apps in the project has a model with a FileField and an M2M to `Site`. Since each site has its own MEDIA_ROOT, a model instance saved from SiteA (publishing on both SiteA and SiteB) can only display the file from SiteA, because the file only

two-step admin add_view

2009-05-12 Thread smcoll
i'm looking for advice on how to make the admin add_view better for the Registration model. The 'sessions' m2m and 'fee' fk should be filtered based on the 'event' fk (both Session and RegistrationFee have an 'event' fk as well). Of course, the filtering can't happen until the admin user

Re: IntegrityError in admin with django-tagging

2008-10-02 Thread smcoll
Found help on IRC: Since my TagField is named "tags", i have to set ``tag_descriptor_attr`` to some other name when registering it. tagging.register(Post, tag_descriptor_attr='_tags') On Oct 2, 12:01 pm, smcoll <[EMAIL PROTECTED]> wrote: > Can someone tell me if i set up

Re: IntegrityError in admin with django-tagging

2008-10-02 Thread smcoll
Can someone tell me if i set up the model and admin correctly? On Sep 30, 2:05 pm, smcoll <[EMAIL PROTECTED]> wrote: > i'm trying to get a TagField working in the admin for my model using > django-tagging 0.2.  i get an IntegrityError when i save my model from > the admin- it lo

IntegrityError in admin with django-tagging

2008-09-30 Thread smcoll
i'm trying to get a TagField working in the admin for my model using django-tagging 0.2. i get an IntegrityError when i save my model from the admin- it looks like django is trying to send a python list to the database, where string is expected. i suspect i haven't set it up right. Can someone

display related model data in nfa add/modify view?

2008-07-16 Thread smcoll
i have created a UserProfile model to extend the User. i'd like to show the 'first_name', 'last_name', and 'email' fields from the User model in the UserProfile admin change view, with a link to change the User record. How can this be done using the latest newforms-admin branch? i can't inline