distinct doesn't work after sorting by reverse foreign key

2008-12-04 Thread ryan
For instance, I have two objects: 1) Blog 2) Entry with a ForeignKey to Blog, and a Date field titled DateAdded Now, I want to list all my blogs, ordering by the most recent added entry. I tried: blog.objects.all().sort_by('entry__dateAdded').distinct() But the result was that is a given blog h

Re: distinct doesn't work after sorting by reverse foreign key

2008-12-04 Thread ryan
t... ) On Dec 4, 9:24 pm, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > On Thu, 2008-12-04 at 19:09 -0800, ryan wrote: > > For instance, I have two objects: > > 1) Blog > > 2) Entry with a ForeignKey to Blog, and a Date field titled DateAdded > > > Now, I w

Re: distinct doesn't work after sorting by reverse foreign key

2008-12-04 Thread ryan
t... ) On Dec 4, 9:24 pm, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > On Thu, 2008-12-04 at 19:09 -0800, ryan wrote: > > For instance, I have two objects: > > 1) Blog > > 2) Entry with a ForeignKey to Blog, and a Date field titled DateAdded > > > Now, I w

Re: distinct doesn't work after sorting by reverse foreign key

2008-12-04 Thread ryan
on would expect. On Dec 4, 10:17 pm, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > On Thu, 2008-12-04 at 20:15 -0800, ryan wrote: > > thanks for the thorough reply! I now understand how to proceed. > > > However, I'm not convinced that distinct shouldn't do th

Re: distinct doesn't work after sorting by reverse foreign key

2008-12-04 Thread ryan
hat most users would expect from a distinct() function? On Dec 4, 10:22 pm, ryan <[EMAIL PROTECTED]> wrote: > There's no mind reading required. I have a queryset of Blog objects, > not entry objects (or SQL rows for that matter). When I call distinct, > I would expect a "di

Re: AlreadyRegistered Exception after newforms-admin merge

2008-09-10 Thread ryan
Good catch. Thank you On Aug 3, 10:14 pm, "Pedro Valente" <[EMAIL PROTECTED]> wrote: > I'm not sure if it's your case, but I got the AlreadyRegistered errors > because before the merge I used the NFA branch and had an admin import > inside __init__.py (not needed anymore). > > I had forgotten abo

GEOIP_LIBRARY_PATH in settings.py

2008-10-16 Thread ryan
Is this correct?: GEOIP_LIBRARY_PATH = '/home/USERNAME/geoip/lib/libGeoIP.a' --~--~-~--~~~---~--~~ 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

Re: ViewDoesNotExist No module. where is it being called, I don't want it to.

2008-10-17 Thread ryan
"I do have A feild in my times model named user" Is it a ForeignKey to Django's User model? If so you need to import that at the top of your models.py file -ryan On Oct 17, 3:42 pm, KillaBee <[EMAIL PROTECTED]> wrote: > I keep getting this error that says ViewDoesNotEx

Re: ViewDoesNotExist No module. where is it being called, I don't want it to.

2008-10-17 Thread ryan
no, i just checked yr code. that's not it. On Oct 17, 5:25 pm, ryan <[EMAIL PROTECTED]> wrote: > "I do have A feild in my times > model named user" > > Is it a ForeignKey to Django's User model? > If so you need to import that at the top of your models

upload_to ignored outside of admin?

2009-06-23 Thread ryan
class Creative(models.Model): creative = models.FileField(upload_to='creative') element = models.ForeignKey(Element) #views.py(1) attachment = request.FILES[attachment_num] element.creative_set.create(creative=attachment) #views.py(2) attachment = request.FILES[attachment_num] Creative.o

model subclasses

2009-06-26 Thread ryan
Let's say I have a Polygon model class Polygon(Models.model): side_length = models.IntegerField() Depending on the view I'm in, I want to calculate the perimeter of the polygons as a square, or as a triangle (or anything other polygon). What I'd like to do is somehow create a subclass of po

differences in seek method for TemporaryUploadedFile & InMemoryUploadedFile

2009-07-20 Thread ryan
In the following code, the second loop of "for row in csv_reader:" is empty when dealing with an InMemoryUploadedFile object. Setting FILE_UPLOAD_MAX_MEMORY_SIZE equal to zero forces the use of a TemporaryUploadedFile object and solves the problem. It seems that seek(0) doesn't work with an InMe

Re: differences in seek method for TemporaryUploadedFile & InMemoryUploadedFile

2009-07-20 Thread ryan
answering my own question, i think this has something to do with an exhausted iterator -ryan On Jul 20, 12:39 pm, ryan wrote: > In the following code, the second loop of "for row in csv_reader:" is > empty when dealing with an InMemoryUploadedFile object.  Setting > FILE_UPL

django-facebookconnect

2009-04-02 Thread Ryan
think. -- Ryan Mark http://ryan-mark.com 847 691 8271 --~--~-~--~~~---~--~~ 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

inline model's choices field empty in admin

2009-06-02 Thread ryan
When I edit a User in the admin, the sales_team and user_class dropdowns are empty. If anyone can point out my error or point me to the django core code that ignores the choices, I would greatly appreciate it. #models.py SALES_TEAM_CHOICES = enumerate(('CLS','CCS','TPS')) USER_CLASS_CHOICES = en

Re: inline model's choices field empty in admin

2009-06-02 Thread ryan
) user_class = models.IntegerField(choices=USER_CLASS_CHOICES) last_name = models.CharField(max_length=40) first_name = models.CharField(max_length=30) This behavior is not mentioned as a caveat in http://docs.djangoproject.com/en/dev/ref/models/fields/#choices ryan On Jun 2, 11:22 am

Re: inline model's choices field empty in admin

2009-06-02 Thread ryan
Thank you sir. I got this from "Python Web Dev. w/ Django". An unforseen side effect. ryan On Jun 2, 12:05 pm, Daniel Roseman wrote: > On Jun 2, 4:53 pm, ryan wrote: > > > This additional model, which uses the same choices is emptying the > > choices dropd

__all__in instead of __in

2009-06-04 Thread ryan
= models.ManyToManyField(Station, blank=True, null=True) >>> from myapp.models import Station, Order >>> from django.contrib.auth.models import User >>> u = User.objects.get(username__exact='ryan') >>> user_stations = u.get_profile().station.all().values_list('p

Re: __all__in instead of __in

2009-06-04 Thread ryan
answering my own question, seems like: Order.objects.filter(Q(station=1), Q(station=2), Q(station=3)) -ryan On Jun 4, 2:29 pm, ryan wrote: > #models.py > class Station(models.Model): >     station_name = models.CharField(max_length=20) > > class Order(models.Model)

Re: __all__in instead of __in

2009-06-04 Thread ryan
_gte=today) terrestrial_active_orders = all_terrestrial_active_orders.exclude (station__in=excluded_terrestrial_stations) On Jun 4, 3:05 pm, ryan wrote: > answering my own question, seems like: > > Order.objects.filter(Q(station=1), Q(station=2), Q(station=3)) > > -ryan > >

Handling IntegrityError on transaction middleware commit

2009-11-27 Thread Ryan
I had an IntegrityError come up on transaction commit (using postgres) today on a production site -- trying to insert an invalid foreign key value (an admin deleted something she shouldn't have). The problem was that instead of emailing me the exception like usual, django logged the exception to m

override TabularInline get_formset - need to call super method?

2010-05-07 Thread ryan
Hi I'm trying to change the extra value based on a related object's attribute. The relevant bit of code starts with: ## begin alterations This way of doing it works, but should I be calling super() at the end? if so, why? I've been reading up on super a lot. ---

Re: override TabularInline get_formset - need to call super method?

2010-05-07 Thread ryan
would this be preferable? from admin.py class HDChannelInline(admin.TabularInline): model = HDChannel extra = 0 template = 'admin/edit_inline/tabular.html' def get_form

Re: Ajax header not sent in all browsers

2010-06-09 Thread Ryan
If you simplify things down to something like the snippets below, does the alert display 'Said it was NOT ajax' for you? It shouldn't (and doesn't for me). Also, do you have the Tamper Data Firefox add-on installed to validate the headers being sent in? That could help narrow things down. urls.py

select_related removes broken Foreign Keys, but How?

2010-06-16 Thread ryan
I noticed this first in the Django Admin. If you have 100 rows in Table A, and 5 of those have a foreign key entry pointing to a nonexistent item in Table B, rather than throwing an error, the admin displays 95. This happens if you set list_select_related = True, or if one of the list_display fiel

Strange cookie error, only for some IE users?

2010-10-21 Thread Ryan
At a client site, I have occasionally had her customers complain that they get cookie errors when they try to log in, even though they have cookies enabled and they are able to log in to other sites. Clearing out their cookies doesn't seem to help. Most (95-99%) users can log in fine. The affect

Re: Strange cookie error, only for some IE users?

2010-10-21 Thread Ryan
Solved my own problem. User's clocks were set ahead so the Internet Explorer (pinnacle of stupid design) expired the cookie instantly. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroup

How to set individual cache items so they don't timeout?

2010-11-24 Thread Ryan
How do I go about caching an item so it doesn't timeout if I don't want to set the default timeout to zero? Thanks, Ryan -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@go

Re: How to set individual cache items so they don't timeout?

2010-11-24 Thread Ryan
backend setting enables a thin wrapper around Django’s memcached (or locmem) cache class that allows cache times of “0”, which memcached interprets as “forever” and locmem is patched to see as forever." Ryan On Nov 24, 2:02 am, Ryan wrote: > I found this thread about how a timeout of 0 (= infi

Proxy model ContentType question

2010-02-17 Thread Ryan
In django/contrib/contenttypes/models.py (get_for_model), I noticed that for a proxy model object, the contenttype being returned is of the base concrete class since it sets opts to the _meta of proxy_for_model . If one uses a generic relation in the admin app, you can set the generic contenttype

Re: Proxy model ContentType question

2010-02-19 Thread Ryan
aving wrapped the ContentType get_by_natural_key call). I'm wondering what other implications there are if I continue to use the get_by_natural_key as a way to get the proxy content type. On Feb 16, 10:05 pm, Ryan wrote: > In django/contrib/contenttypes/models.py (get_for_model), I noticed

Re: Is there any way to custom group models in the admin panel?

2007-07-12 Thread Ryan
I am interested in this as well. I've searched for a way to organize models in the admin panel but I haven't found anything. It seems illogical to create multiple apps simply for the fact to separate them in the admin panel. --~--~-~--~~~---~--~~ You received this

Re: Best Practices to Make your Apps Portable

2007-07-26 Thread Ryan
I like this setup. I will use this as a basis for my own upcoming project. Thanks. RG On Jul 25, 11:12 am, Sebastian Macias <[EMAIL PROTECTED]> wrote: > Thanks a lot for the feedback everyone. > > I have come up a perfect setup and folder structure (at least > perfect for my needs) that will a

Re: choices/ and getting rid of the dashes?

2007-09-09 Thread Ryan
Use initial when calling your form class. formClass = forms.form_for_model(Person) form = formClass(initial={'gender': 'm'}) On Sep 6, 4:31 pm, Mark Green <[EMAIL PROTECTED]> wrote: > Hi all, > > This is my model: > > class Person(models.Model): > GENDER_CHOICES = ( > ( 'm', 'Male' )

Canberra developers

2008-05-19 Thread Ryan
I live in Canberra, Australia and I'm putting together a web start-up, hopefully using the Django framework. Does anyone know of any competent Django developers, or at least Python coders, in my neck of the woods? --~--~-~--~~~---~--~~ You received this message beca

Negative numbers comparison bug(?)

2007-04-10 Thread Ryan
blem with SQL's between syntax or if it's Django? If it helps, the values are floats (decimal 5,2). Could anyone please help me? Thanks in advance, Ryan --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups

Location of non-app-specific static files?

2012-11-03 Thread Ryan
templates directory at this level. Does any one have any input on this? Thanks, Ryan -- 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/-/4H39KqmnTugJ.

Re: Location of non-app-specific static files?

2012-11-05 Thread Ryan
That is not a bad idea as everything that is project specific, but not app specific, would live in one place. Thanks, Ryan On Sunday, 4 November 2012 15:14:43 UTC, Xavier Ordoquy wrote: > > Hi, > > One thing I've seen - and adopted - is to have one application that > conta

Editing .po files for RTL languages

2012-01-23 Thread Ryan
I'm needing to translate several Django sites/apps into arabic (a Right-To-Left language) and I'm having difficulty editing the .po files when the message to translate contains Left-To-Right variables or HTML markup. Whether I'm using TextMate, TextWrangler or poedit, if I'm editing a translation

South African Django Developers

2011-05-04 Thread Ryan
Are there any Django developers in Johannesburg, South Africa? If so, who can I get in touch with? Thanks. -- 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 th

Django admin and jQuery select filtering

2011-05-27 Thread Ryan
this more dynamic so the same code could be used for most (if not all) forms? Any help would be greatly appreciated. Many thanks, Ryan -- 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: choice_set.all()

2011-05-29 Thread Ryan
Can you post your model code please? -- 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 django-users+unsubscr...@googlegroups.com. Fo

Re: Form and ForeignKey Limiting

2011-05-29 Thread Ryan
Could you not change the queryset of the ModelChoiceField in the view? That way you will have access to the current user from request.user. -- 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@google

Re: Auditing Record Changes in All Admin Tables

2011-05-29 Thread Ryan
This will show you how to achieve this in the django admin: https://docs.djangoproject.com/en/dev/ref/contrib/admin/#django.contrib.admin.ModelAdmin.save_model -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to

Re: Django dynamic form simple Example

2011-05-29 Thread Ryan
t<http://code.google.com/p/django-dynamic-formset/>jQuery plugin in order to allow the user to add or remove more forms dynamically. Hope this helps, Ryan -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send

Re: Form and ForeignKey Limiting

2011-05-29 Thread Ryan
/#django.contrib.admin.ModelAdmin.save_model. Just make sure you set editable=False in your model definition for manager in the Task model. Ryan -- 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: custom User class

2011-05-29 Thread Ryan
If all you want to do is store additional information about your users, the recommended way to do this is to use a user profile: https://docs.djangoproject.com/en/dev/topics/auth/#storing-additional-information-about-users Ryan -- You received this message because you are subscribed to the

Re: Form and ForeignKey Limiting

2011-05-29 Thread Ryan
e required queryset when you create the form instance in your view. Ryan -- 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 d

Re: Django - UserProfile m2m field in admin - error

2011-05-29 Thread Ryan
I can confirm that I get the same error. I wonder if it is anything to do with the two different forms auth uses for user creation and change? On a side note, how did you get your code so nicely formatted? Ryan -- You received this message because you are subscribed to the Google Groups

Re: Auditing Record Changes in All Admin Tables

2011-05-31 Thread Ryan
That code is supposed to go in the models admin definition like so: admin.py: -- class AuditAdmin(admin.ModelAdmin): def save_model(self, request, obj, form, change): obj.user = request.user obj.save() Ryan -- You received this message

Re: Auditing Record Changes in All Admin Tables

2011-06-01 Thread Ryan
: obj.updated_by = request.user else: obj.created_by = request.user obj.save() class Entity1Admin(AuditAdmin): pass admin.site.register(Entity1, Entity1Admin) Hope that helps, Ryan -- You received this message because you are subscribed to the Google

Re: Auditing Record Changes in All Admin Tables

2011-06-01 Thread Ryan
That bit is the easy bit :p Just change request.user to request.user.username Ryan -- 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/-/RXpUd1BTX2

column cannot be null

2011-06-01 Thread Ryan
blank = True means that a django form will not require a value, but the database still does so it's expected that you provide a value elsewhere. In order to allow a null entry into the database, you will need to add null = True to that definition aswell Hope this helps, Ryan -- You rec

Re: Auditing Record Changes in All Admin Tables

2011-06-01 Thread Ryan
No problem. One final piece of advice would be to move the readonly_fields out of Entity1Admin and into AuditAdmin. That way you only have to define it once and inherit from it as with all the other options rather than re-defining it for each new model. Ryan -- You received this message

Re: confused over use of XYZ.objects.get() method

2011-06-04 Thread Ryan
are trying to span a relationship. So these two should actually be question__id and assessment__id. However the line above that with question = question and assessment = assessment should work fine when you have a question that is actually in the database. Hope that helps you, Ryan -- You

Re: ManyToManyField limit_choices_to that instance via Django admin.

2011-06-07 Thread Ryan
This is possible, but I'm not sure if you could do it via limit_choices_to. The admin docs shows how to accomplish this here: https://docs.djangoproject.com/en/dev/ref/contrib/admin/#django.contrib.admin.ModelAdmin.formfield_for_manytomany Ryan -- You received this message because yo

Re: VERY cheap django hosting?

2011-06-11 Thread Ryan
Do you know how their python is provided? mod_python? mod_wsgi? fgci? Thanks, Ryan -- 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/-/6KIjlspcjIw

migrate command fails with foreign key to user model

2014-04-28 Thread Ryan
I have used django in the past, but not for some time. So the changes surrounding the user models are new to me. I downloaded v1.7b2 and proceeded to start a new development I am planning. However I came across a problem when trying to run migrate after generating the migrations on an app th

Re: migrate command fails with foreign key to user model

2014-04-28 Thread Ryan
. > > Le lundi 28 avril 2014 04:54:32 UTC-4, Ryan a écrit : >> >> I have used django in the past, but not for some time. So the changes >> surrounding the user models are new to me. I downloaded v1.7b2 and >> proceeded to start a new development I am planning. H

Re: Syncing two django applications via cURL

2008-11-13 Thread Ryan Nowakowski
. http://www.python.org/doc/2.5.2/lib/httplib-examples.html - Ryan On Thu, Nov 13, 2008 at 10:13:25AM -0800, Kurczak wrote: > > Hello everyone, > I've got this unusual problem - I've got few django sites, and I need > to synchronize Users and profiles between them. (it&#

Re: FastCGI and Django as a continuously running server

2008-11-13 Thread Ryan Nowakowski
On Wed, Nov 05, 2008 at 11:21:14AM -0800, russellneufeld wrote: > The one thing left that I'd like to do is set up Django to run > continuously, even when there are no http requests. My application > runs a bunch of periodic background tasks in addition to serving up > web content, and it seems

Re: How to create a form with dynamic number of fields?

2008-11-16 Thread Ryan Witt
}) Does this help? It would let you dynamically add elements and handlers to the form that django is aware of, thus you get all the benefits of using the form framework. Let me know if this is a bit thick and I'll be happy to explain it and perhaps blog a more coherent example. --Ryan

Re: How to create a form with dynamic number of fields?

2008-11-16 Thread Ryan Witt
}) Does this help? It would let you dynamically add elements and handlers to the form that django is aware of, thus you get all the benefits of using the form framework. Let me know if this is a bit thick and I'll be happy to explain it and perhaps blog a more coherent example. --Ryan

Re: Django processes under Apache

2009-02-22 Thread Ryan Kelly
as "daemonic" so they're cleaned up automatically when Django exits. Cheers, Ryan -- Ryan Kelly http://www.rfk.id.au | This message is digitally signed. Please visit r...@rfk.id.au| http://www.rfk.id.au/ramblings/gpg/ for details signature.asc Description: This is a digitally signed message part

model inheritance without a new database table

2009-02-22 Thread Ryan Kelly
the User class, but figured there must be a better way :-) So, is there a way to have a model subclass avoid the creation of a new database table,and just take its data straight out of the table for its superclass? Thanks, Ryan -- Ryan Kelly http://www.rfk.id.au | This message is digi

Re: model inheritance without a new database table

2009-02-22 Thread Ryan Kelly
k and see if I can help out on the ticket at all. Cheers, Ryan -- Ryan Kelly http://www.rfk.id.au | This message is digitally signed. Please visit r...@rfk.id.au| http://www.rfk.id.au/ramblings/gpg/ for details signature.asc Description: This is a digitally signed message part

Re: model inheritance without a new database table

2009-02-24 Thread Ryan Kelly
27;t add any fields will get pure-python inheritance by default. In the meantime, I hope some other people might find this trick useful. Cheers, Ryan -- Ryan Kelly http://www.rfk.id.au | This message is digitally signed. Please visit r...@rfk.id.au| http://www.rfk.id.au/ra

Re: model inheritance without a new database table

2009-02-24 Thread Ryan Kelly
class that still lived in its own (manually created) database table. My current patch uses "virtual", so I can do the following: def MyUser(auth.models.User): class Meta: virtual = True def an_extra_method(self): print "hooray!"

Re: model inheritance without a new database table

2009-02-24 Thread Ryan Kelly
dn't let that hold things up. I'll think about it and come > up with a name later on, unless a better option appears beforehand. Originally I named it "use_superclass_table" but decided that was just too ugly to deal with. "interface_only"? Glad not to b

Re: model inheritance without a new database table

2009-02-25 Thread Ryan Kelly
Thanks again for your feedback on this Malcolm, I've created the following ticket in Trac: Proxy models: subclass a model without creating a new table http://code.djangoproject.com/ticket/10356 Cheers, Ryan -- Ryan Kelly http://www.rfk.id.au | This message is digi

Re: Browser Testing - Selenium or Windmill

2009-02-28 Thread Ryan Kelly
prehensive than for Windmill - probably because the latter is a younger project. In the end I went with Windmill because it seemed to fit my development/thinking style better than Selenium - so of course your mileage may vary. Cheers, Ryan -- Ryan Kelly http://www.rfk.id.au | This message

Possible bug with DateTimeFields and admin site

2009-03-18 Thread Ryan Duffield
"html_name" -- in the case outlined above, both fields have html_name's of "start_date". Is this a bug? Cheers, Ryan --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" gro

Flatpages-like application and caching

2009-07-03 Thread Ryan K
u from the database to create the XHTML, what is the best method to cache this resulting XHTML. Are there any applications that already exist that extend flatpages to include one level deep sub navigation? any help is greatly appreciated! Cheers, Ryan Kaskel http://consulting.ryan

Checking if a ForeignKey field is NULL

2009-07-04 Thread Ryan K
Lets say I retrieve from my database an object foo and foo's model has a ForeignKey field, baz, with null and blank set to True. Will a simple test like if foo.baz ... test whether the field is set to NULL or not? Cheers, Ryan --~--~-~--~~~---~--~~ You rec

Django and its caching system help

2009-07-05 Thread Ryan K
quicker than disk access? Do I even need to do this considering Django has a cache system? Any help would be greatly appreciated. Cheers, Ryan --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users"

Circular imports problem

2009-07-08 Thread Ryan K
this problem? Cheers, Ryan --~--~-~--~~~---~--~~ 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

Re: Circular imports problem

2009-07-08 Thread Ryan K
def run(self): pass def build_menu_from_link_mod(... def build_menu_from_menu_mod(.. I hope this better specifies the issue. Should I import these in the run method for each Thread subclass? On Jul 8, 4:47 pm, Alex Gaynor wrote: > On Wed, Jul 8, 2009 at 3:45 PM, Ryan K wrote:

Middleware help -- screwing up the admin

2009-07-08 Thread Ryan K
I'm getting a very strange error: TypeError at /admin/ object.__new__() takes no parameters I've isolated the problematic code to my middleware for an application I built called staticpages. It uses the same mechanism and so the same middleware as flatpages. This is the code: from django.http

Re: Middleware help -- screwing up the admin

2009-07-08 Thread Ryan K
Please ignore this. I'm an idiot and placed the reference to the middleware in the template_context_processros settings. And so strange errors resulted. Please delete if possible. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Goog

Re: Some post_related_objects_save signal or workaround?

2009-07-09 Thread Ryan K
Is there any reason you can't create your own signal and put it in the rounds save() method and then just call the parents save? http://docs.djangoproject.com/en/dev/topics/signals/#defining-and-sending-signals Cheers, Ryan On Jul 9, 6:12 am, Eugene Mirotin wrote: > Hello! >

post_save signal bug

2009-07-10 Thread Ryan K
d in my code: Menu 2 Cool Sites 222 http://www.google.com/";>Google Inc http://www.microsoft.com";>Microsoft http://www.ryankaskel.com";>Ryan Kaskel http://www.yahoo.com";>Yahoo Homepage If I don't change anything in the menu, eventually it gets

Re: post_save signal bug

2009-07-10 Thread Ryan K
I modified the above _cached_menu method to just create a new object every time (shown below). It only seems to get the links right, a ManyToMay field, after I save it _twice_? Hmmm...how I get the updated many2many table? def _cache_menu(self, menu, xhtml): """ Stores xhtml into

Does post_save signal need to be in models.py?

2009-07-11 Thread Ryan K
al is installed? Cheers, Ryan --~--~-~--~~~---~--~~ 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 t

Question regarding post_save signal and ManyToMany field objects

2009-07-13 Thread Ryan K
l() Can anyone help with this behavior? Cheers, Ryan --~--~-~--~~~---~--~~ 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 fro

Re: .views._CheckLogin.__call__ didn't return an HttpResponse object

2009-07-14 Thread Ryan K
Are you returning render_to_response in the view? On Jul 14, 6:12 am, alecs wrote: > Hi all :) Can u help me with .views._CheckLogin.__call__ didn't return > an HttpResponse object . I'm trying from my view 'jump' to another > view by calling     mail_to_user(request,username,dummy)       The >

Re: .views._CheckLogin.__call__ didn't return an HttpResponse object

2009-07-14 Thread Ryan K
To be a little more explicit, perhaps your view code contains: render_to_response('template.html",{},RequestContextInstance) as opposed to return render_to_response(...) Cheers, Ryan --~--~-~--~~~---~--~~ You received this message because you are sub

Re: Question regarding post_save signal and ManyToMany field objects

2009-07-14 Thread Ryan K
adding print statements to your > save methods or handlers and running the dev server from terminal). > The reason is that when you initially create the object, related > objects have to link to the existing object, so the parent object is > saved before them. > > On Jul 13, 9:

Re: .views._CheckLogin.__call__ didn't return an HttpResponse object

2009-07-14 Thread Ryan K
nd create a non view function that handles mail. Cheers, Ryan On Jul 14, 6:33 am, alecs wrote: > Ok, a simple question: > Are there any possibilities to call from current view another view. > For instance you have a large view and in the middle of it you need to > perform THE SAME actions

Re: Object attributes in change_form.html

2009-07-14 Thread Ryan K
I'm not sure but try {{ original }} ...here is the code: http://code.djangoproject.com/browser/django/trunk/django/contrib/admin/options.py context = { 860 'title': _('Change %s') % force_unicode (opts.verbose_name), 861 'adminform': adminForm, 862

Re: Question regarding post_save signal and ManyToMany field objects

2009-07-14 Thread Ryan K
I use signals to generate an XHTML menu and cache it in my database. I do this in a thread. Someone said don't use threads. What is the consensus on that? Cheers, Ryan On Jul 14, 10:43 am, Alex Gaynor wrote: > On Tue, Jul 14, 2009 at 9:35 AM, Russell Keith-Magee > > > > >

Re: post_save signal bug

2009-07-16 Thread Ryan K
390. (this post if for anyone searching the topic) On Jul 11, 1:57 am, Ryan K wrote: > I modified the above _cached_menu method to just create a new object > every time (shown below). It only seems to get the links right, a > ManyToMay field, after I save it _twice_? Hmmm...how I get the

Re: problems with large data

2009-07-16 Thread Ryan K
I'm starting to see that I too need to participate in Django sprints to help incorperate the features I want in Django and I think we all should and perhaps you do which is great. This is great software there is still a lot of work to be done. Ryan Kaskel http://consulting.ryankaskel.com

Re: Checking if user is logged in and log in form

2009-07-19 Thread Ryan K
> urlpatterns = patterns('', > (r'^someurl/', login_required(direct_to_template), { 'template': > 'template.html', }), > ) http://groups.google.com/group/django-users/browse_thread/thread/e9f85ce0666da8c/ Cheers, Ryan http://consulting.

Re: Checking a User in another Table ...

2009-07-19 Thread Ryan K
What exactly are your models? If you are using a ManyToMany fields you could do it Rating.objects.get(user=request.user) and see if that returns anything. Cheers, Ryan On Jul 19, 10:06 am, The Danny Bos wrote: > Hey there, this should be easy, but my code just won't play along. > &

Re: ModelForm and ForeignKeys

2009-08-22 Thread Ryan Bales
I have experienced this same issue, and that link didn't really help. I am trying to hook into a legacy database using "inspectdb", and I can't index the tables. class Character(models.Model): guid = models.IntegerField(primary_key=True) name = models.CharField() ... ... class

Strange error while trying to access admin: rendering fails (latest SVN)

2009-08-26 Thread Ryan K
ython Python Version: 2.6.2 - Cheers, Ryan --~--~-~--~~~---~--~~ 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 unsub

Re: Strange error while trying to access admin: rendering fails (latest SVN)

2009-08-26 Thread Ryan K
This is where it says the problem is in the template: Template error In template /usr/local/lib/python2.6/dist-packages/django/contrib/ admin/templates/admin/base.html, error at line 30 Caught an exception while rendering: unsupported operand type(s) for +=: 'function' and 'list' 20 21

Re: Strange error while trying to access admin: rendering fails (latest SVN)

2009-08-26 Thread Ryan K
State in admin rendering process when error occurred: /usr/local/lib/python2.6/dist-packages/django/template/debug.py in render_node 74. e.source = node.source 75. raise 76. except Exception, e: 77. from sys import exc_info 78. wrapped = TemplateSyntaxError(u'Caught an exception while

Re: Strange error while trying to access admin: rendering fails (latest SVN)

2009-08-26 Thread Ryan K
Thanks Karen you've been helping me out recently with debugging a few things and have been a really great asset. Cheers, Ryan Kaskel On Aug 26, 7:19 pm, Karen Tracey wrote: > On Wed, Aug 26, 2009 at 3:33 PM, Ryan K wrote: > > > This is where it says the problem i

Re: interaction of django with paypal

2009-08-30 Thread Ryan Kelly
and django-paypal has saved me a *heap* of mucking around. Ryan -- Ryan Kelly http://www.rfk.id.au | This message is digitally signed. Please visit r...@rfk.id.au| http://www.rfk.id.au/ramblings/gpg/ for details signature.asc Description: This is a digitally signed message part

  1   2   3   4   5   6   >