Database schema migration - any tools available?

2008-08-28 Thread Alex
Hi all, I have a migrations tool made by me for an internal project. I couldn't find anything at the time and I made my own. It uses the Command pattern (took the idea from the Rails migrations) and plain MySql queries with a parser made with Antlr ... I know it is not portable but this may be ch

Cannot get user profile working.

2008-09-01 Thread Alex
I have a user profile defined in web.core.models.py and I cannot get this to work at all. I am constantly getting the following: >>> User.objects.get(username="Alex") >>> User.objects.get(username="Alex").get_profile() Traceback (most recent call l

Re: Cannot get user profile working.

2008-09-02 Thread Alex
Thanks, worked perfectly. Not sure if it's just me and my lack of sleep or the docs aren't that clear on this item. I didn't see much regarding this on the Internet so there must not be scores of others making the same mistake. --~--~-~--~~~---~--~~ You received t

Re: ANNOUNCE: Django 1.0 released

2008-09-04 Thread Alex
On Sep 4, 2:07 am, "James Bennett" <[EMAIL PROTECTED]> wrote: > The Django team is pleased to announce the release of Django 1.0 this evening: > > Download:http://www.djangoproject.com/download/ > Release notes:http://docs.djangoproject.com/en/dev/releases/1.0/ > > Have fun with it, and we'll see

Re: Working with inline formsets to created/edit an object

2008-09-19 Thread Alex
I am very interested in this as well. I had to abandon formsets because they were too difficult to get working for creating associated objects at the same time as the original object. I was sure this was a common issue but could find absolutely no information about how to do this reasonably clea

Re: MySQLdb + AMD64

2008-09-23 Thread Alex
Try using Linux then. I just created an Ubuntu dev platform for Django on my AMD64 and everything worked very easily. You can even install Ubuntu from windows using Wubi -- practically a one-click install. Python, MySQL, and all the libs are all ready to go for AMD64, you just install using the

problem with the ImageField using ModelForm

2008-09-26 Thread alex
i use the form i make with ModelForm. Nothing append. I don't understand because i don't customise the form, i just exclude some fields. Is it possible there is a bug in ModelForm.ImageField ?? Thanks Alex --~--~-~--~~~---~--~~ You received this messa

I just tried GEdit and failed

2009-01-07 Thread Alex
I just tried GEdit on the basis of this thread to replace a very good but slow Komodo. GEdit is not good, or should I say, the plugins that let it be a python dev environment are not good. Perhaps I've selected and incompatible set of plugins, because they started off working somewhat decently,

Re: Json Serialization / Form Validation error

2009-01-15 Thread Alex
I ran into this same problem but the code snippets you guys gave weren't working. In case anyone is reading this in the future, here is what you want: dict([(k, [unicode(e) for e in v]) for k,v in errors.items()]) The above line will give a dictionary of field names mapping to lists of errors.

django-registration and django-profiles: common form

2009-07-28 Thread Alex
hello! I'm trying to make registration based on django-registration and django-profiles. What I want is to have initial form for not only with just login- password-email fields but also to add some custom fields from userProfile model. Can anybody help? How can I add additional fields? --~--~-

About forms.ChoiceField()

2009-05-15 Thread Alex
Hello all! First of all sorry for my english. I have made a small form, just 10 fields. now I see that page loads much slower then without this form... I found problem in this part of form: age = forms.ChoiceField(required=True, choices=AGE_CHOICES, initial='18') without this field page loads

About forms.ChoiceField()

2009-05-16 Thread Alex
Hello all! First of all sorry for my bad english:) I have made a small form, only 10 fields. But now I see that page loads more than two times slower! I found problem in this field: age = forms.ChoiceField(required=True, choices=AGE_CHOICES, initial='18') without this field page loads much fast

Re: About forms.ChoiceField()

2009-05-16 Thread Alex
Thanks for reply, Jim. Hmm, just saved full page to disk. Almost the same time... now i think it's just cost of transferring of big select box. I'll make it a bit smaller. Gzip will help me I think) Thanks again. On May 16, 4:44 pm, Jim wrote: > > I have made a small form, only 10 fields. But

unique_together constraint on a ForeignKey field in MySQL

2011-08-20 Thread Alex
I asked this originally on StackOverflow, but I realized you guys might have more experience with these gnarly edge cases: http://stackoverflow.com/questions/7131639/how-can-i-have-a-unique-together-constraint-involving-a-foreignkey-field-in-mysql Thanks for your consideration, -- Alex Ogier

I can't span relationships in list_filter

2011-08-26 Thread Alex
Django 1.3 supposedly supports spanning model relationships in list_filter, but when I try to use this feature, the admin page redirects me to an unfiltered page. For example, I have an admin list page for a class that looks like: class PlayerAdmin(admin.ModelAdmin): model = Player list_f

Model Inheritance and ModelForms

2011-10-28 Thread Alex
r am I just overlooking something simple? Any advice or links to relevant documentation would be *much* appreciated. Thanks! -Alex -- 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: Model Inheritance and ModelForms

2011-10-29 Thread Alex
there something I'm still overlooking? Thanks again, -Alex On Oct 28, 5:53 am, Tom Evans wrote: > On Fri, Oct 28, 2011 at 7:50 AM, Alex wrote: > > I've been scouring Google and the Django documentation and I can't > > figure out how to do this. I'm working on

Re: Is there an example of html template usage?

2009-09-10 Thread alex
http://www.satchmoproject.com/ good luck On Sep 10, 9:07 pm, aftalavera wrote: > Hi there, > > Where can I found sample about real apps usgin html templates with > Django templates? --~--~-~--~~~---~--~~ You received this message because you are subscribed to th

Re: My Django powered website for web based learning

2009-09-28 Thread Alex
Good job! Didn't have much time to check the content but the first 4 or 5 videos seemed very interesting. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to djan

convert NodeList back to string

2009-12-16 Thread Alex
Hi, What would be the best way to convert NodeList created from template back to a string? I'm trying to implement a two-pass rendering. -- 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...@googlegrou

how to use render_to_response, ajax and javascript variables

2010-06-16 Thread Alex
om before the js can act on their values. This seems like a familiar nut that must be well documented somewhere... :) any help, pointers very appreciated. Thanks Alex -- You received this message because you are subscribed to the Google Groups "Django users" gro

Re: how to use render_to_response, ajax and javascript variables

2010-06-16 Thread Alex
nd rendering to that. Keeping the template as html seems like the right thing to do). I was hoping you'd scream 'don't be daft - everyone does this...' :) Alex -- You received this message because you are subscribed to the Google Groups &q

Re: how to use render_to_response, ajax and javascript variables

2010-06-17 Thread Alex
on it' Alex and thanks Matt for that json version info which was confusing 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-us...@googlegroups.com. To unsubscribe from this

reverse relationships and their creation

2010-07-09 Thread Alex
her ideas? Thanks for any thoughts, Alex -- 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...@googlegroups.com. To unsubscribe from thi

Re: reverse relationships and their creation

2010-07-09 Thread Alex
= Othermodel(name="Test") om.save() count = om.reel_set.count() #this causes the error Thanks, Alex -- 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...@

model instances, schema and template variables

2010-07-12 Thread Alex
if this is answered elsewhere but just couldn't find it! Thanks Alex -- 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...@googlegroups.com. To unsubscribe from this group, send e

Django has incorrect time

2010-07-29 Thread Alex
I'm having some strange behavior when using Django and Postgres. My system time zone is EDT and when running datetime.now( ) from a *Python* shell I get the correct time. If I run a Django shell through manage.py it is an hour behind. I similarly have set up a view on a web page to display the t

Re: Django has incorrect time

2010-07-29 Thread Alex
> Works fine here with Django 1.0.2-1+lenny1; which version do you have? Django 1.2.1 (installed manually, not through apt) on Kubuntu 10.04, Python 2.6.5, Postgres 8.4.4. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group,

Re: Django has incorrect time

2010-07-29 Thread Alex
> TIME_ZONE = 'America/Los_Angeles' This actually led to the solution, which was a stupid error on my part. Somehow TIME_ZONE got into my settings.py file twice and I was changing the first instance, which was getting overwritten with the second instance (default Chicago TZ) later. -- You rec

Re: Best OS - VPS environment

2010-08-16 Thread Alex
FreeBSD On Mon, Aug 16, 2010 at 12:39 PM, Kenneth Gonsalves wrote: > On Mon, 2010-08-16 at 01:54 -0700, Dan wrote: > > What do people recommend? > > debian lenny > -- > regards > Kenneth Gonsalves > > -- > You received this message because you are subscribed to the Google Groups > "Django users"

django-registration0.8 args on /activation/complete/

2010-08-20 Thread Alex
I have tried setting a username parameter in the url pattern and view with no success. How should this be done? I need a - oh that's how it works - moment. Any help very appreciated. Alex -- You received this message because you are subscribed to the Google G

Re: Connecting a django-registration signal to a function

2010-08-24 Thread Alex
mport user_activated user_activated.connect(user_profile) I picked this up from this thread : http://stackoverflow.com/questions/3114976/extending-django-registration-using-signals/3124006#3124006 Hope this helps. Alex -- You received this message because you are subscribed to the Go

Multiple authentication sources to one database

2010-09-01 Thread Alex
I am trying to write an application that allows two different kinds of authentication: Users in the wild can register and use the site with a new username, password and email and authenticate as usual, and others can use a single-sign-on solution provided by my university. django- cas (http://code.

terms of service (tos field) validation and error reporting from django registration package

2010-09-08 Thread Alex
Is it anything to do with the tos field being a checkbox? Thanks Alex -- 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...@googlegroups.com. To unsubscribe from this group, send e

Internationalization problems in Django 1.2 (beta 1 SVN-12678)

2010-03-04 Thread Alex
at I did not miss something very obvious :-) Thanks in advance Alex -- 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...@googlegroups.com. To unsubscribe from this group, send email to django

Re: Internationalization problems in Django 1.2 (beta 1 SVN-12678)

2010-03-04 Thread Alex
Posting this question made me rethink the problem... And it was a very small mistake: {% trans "..." %} is not able to mark multilined... Just use one line and everything will work. Hope this helps someone :-) Alex On 5 Mrz., 04:19, Alex wrote: > I've got some very simply

Django SMTP and SPA

2010-04-13 Thread Alex
Hi. Can anybody suggest an idea how to deal with SMTP server with Secure Password Authentication in 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-us...@googlegroups.com. To unsubscribe from t

Re: Django SMTP and SPA

2010-04-14 Thread Alex
No. I've just googled a bit for SPA, SPA+python. But I did not find anything helpfull. On 13 апр, 18:44, Massimiliano della Rovere wrote: > i think the python modules > - smtplib > - email > will help. Have you already tried these ones? > > On Tue, Apr 13, 2010 at 14:

Apache 2.2.1 + Python 2.6.1 + mod_swgi on Windows - Internal Server Error 500

2010-04-30 Thread Alex
3:49 2010] [error] [client 192.168.x.xxx] ImportError: DLL load failed: The specified module could not be found. After some Googling, it turns out the problem was with Python 2.6.1 under Windows. Installing the latest version, 2.6.5, solved this problem immediately for me. Hopefully this will be

Slug auto-complete after save

2010-10-24 Thread Alex
Hi all, Slug autocomplete feature is really cool with: prepopulated_fields = {'slug':('title',)} Is it possible to prepopulating slug field even after save - when I want to change title for example? Actually I use django-multilingual and prepopulating of slug works only for the first language (

Re: Slug auto-complete after save

2010-10-25 Thread Alex
creation in admin. Is there any setting to do it without changing Django internal source code? On 24 Жов, 18:29, Alex wrote: > Hi all, > > Slug autocomplete feature is really cool with: > > prepopulated_fields = {'slug':('title',)} > > Is it possible to prepopu

table namespace hygiene: should I try to rename auth_* tables, or should I use a separate database?

2010-10-30 Thread Alex
rans-database joins, or having trans- database key constraints, vs. within a single database? Does anyone see any other optimal ways to keep my table namespace clean? Thanks Alex -- You received this message because you are subscribed to the Google Groups "Django users" group. To pos

Re: can't open file 'django-admin.py': [Errno 2] No such file or directory'.

2010-10-30 Thread Alex
On Oct 30, 1:00 am, sami nathan wrote: > Whenever I try to execute a python script that is located in the > /usr/local/bin, python gives me the error 'python: can't open file > 'django-admin.py': [Errno 2] No such file or directory'. Please type the following commands (without the $ prompt) and p

Re: table namespace hygiene: should I try to rename auth_* tables, or should I use a separate database?

2010-11-01 Thread Alex
across database boundaries? And/or is there a good way for me to customize the names of the tables created by eg., auth, to dampen my urge to use a different database just for the sake of namespace hygiene? (I'm thinking that the answer to this is "no".) Thanks Alex On Nov 1, 7:58 

Personalise activation from email django registration 0.8

2011-02-04 Thread Alex
Hi, Thanks for the nice sugar of django registration. Has anyone figured out how to get the username of a new user account into the activation email? Personalising the experience is more likely to get activation clicked. Ideas? Thanks in advance, Alex -- You

queryset._clone() in generic views

2011-04-30 Thread Alex
What is 'queryset = queryset._clone()' statement in django.views.generic.list_detail.object_list view used for? Has it something to do with prevention of usage of cached results, to allow QuerySet to reflect changes made to the database? Should I use _clone(), too, if I'm reimplementing this view i

fetching data from intermediate many-to-many table

2011-05-01 Thread Alex
Hello! Assume we have the following models: class Book(models.Model): title = models.CharField() sequences = models.ManyToManyField(Sequence, through='BookSequence') class Sequence(models.Model): name = models.CharField(unique=True) class BookSequence(models.Model): class Meta:

Re: Handling millions of rows + large bulk processing (now 700+ mil rows)

2012-07-22 Thread Alex
Hello! Will you make the video available after the webcast? Thanks. On Saturday, June 30, 2012 7:10:27 PM UTC+4, Cal Leeming [Simplicity Media Ltd] wrote: > > Hi all, > > As some of you know, I did a live webcast last year (July 2011) on our LLG > project, which explained how we overcome some

Re: Python-requests seems to 404 with Django/Tasty-pie?

2012-10-24 Thread Alex
specify a proxies dict for requests. Good luck! Best Alex On Tuesday, October 2, 2012 2:31:52 PM UTC-7, Victor Hooi wrote: > > heya, > > Thanks for the tips - you're probably right, I might need to whip out > wireshark or something and see what exactly is going on. >

prefetch_related - possible to avoid "IN" ?

2013-06-26 Thread Alex
ossible to instruct pretch_related to not use the list of objects but to use the query that produced the list instead? Or to explicitly give pretech_related a query to use? If that is not possible is there another way to go about this? Thanks! --Alex -- You received this message because you are

Django mysql over ssl (2026, 'SSL connection error: Failed to set ciphers to use')

2013-10-31 Thread alex
Hi, Summary: I'm getting this error "(2026, 'SSL connection error: Failed to set ciphers to use')", on the django error page and I don't know what i happening!!! I'm using apache / wsgi and my aplication it's on a virtualenv. The main problem is that I can't connect to a remote mysql ove

Re: MultiValueDictKeyError in Django admin edit inline generic model

2014-07-15 Thread Alex
I am having a similar problem that started when I upgraded from django 1.4.x to 1.6.5 My parent model has a custom pk and the model in my inline is using the default autogenerated id. Here is some snippets from my models and admin: (note I have edited down for simplicity and have not tested the

User form input as variable for form action?

2008-04-15 Thread Alex
", " }}{% endif %} Perhaps this is not the right way to go about this though? If anyone has a solution it would be much appreciated. Thanks Alex --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups

Printing out HTML that doesn't get converted to

2008-05-15 Thread Alex
estions. I'm rather new to Python, so I appreciate all the help I can get :) --Alex --~--~-~--~~~---~--~~ 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: Printing out HTML that doesn't get converted to

2008-05-15 Thread Alex
Wow, that was incredibly simple. Thanks for the help! I have a strong feeling I'm not going back to PHP... --Alex On May 15, 4:47 pm, jonknee <[EMAIL PROTECTED]> wrote: > On May 15, 6:17 pm, Alex <[EMAIL PROTECTED]> wrote: > > > I'm working on my first Djan

Filtering by group

2008-05-16 Thread Alex
ng of something like the following, which obviously doesn't work: queryset = Quote.objects.filter(source=TVEpisode.objects.filter(TVSeries.objects.filter(authors__slug__iexact=slug))) Is there an easy way to filter by groups like this? Thanks, Alex --~--~-~--~~~---~-

Re: Filtering by group

2008-05-16 Thread Alex
I'm not sure if this is any closer, but maybe it is: queryset = Quote.objects.filter(source in series.tvepisode_set.select_related()), There's something wrong with the "source in" part, though... On May 16, 3:39 pm, Alex <[EMAIL PROTECTED]> wrote: > I'm playin

Re: Filtering by group

2008-05-16 Thread Alex
Alright, I think it works now with this: queryset = Quote.objects.select_related(slug) Much simpler than what I was trying... On May 16, 3:55 pm, Alex <[EMAIL PROTECTED]> wrote: > I'm not sure if this is any closer, but maybe it is: > > queryset = Quote.obje

Link to different URLs by Class

2008-05-19 Thread Alex
I'd like to make a link to an item based on which class it is in. I'm creating a quotes database that has quotes from movies, tv shows, etc. Movie, TVShow, etc. are all separate classes, and they have separate URLs for viewing them. I'm trying to create a link to the source based on which subclass

Re: Outside a web server, as a service

2008-06-04 Thread alex
Thanks Karen! alex On Jun 2, 5:18 am, "Karen Tracey" <[EMAIL PROTECTED]> wrote: > On Mon, Jun 2, 2008 at 3:33 AM, Alexandre Parenteau <[EMAIL PROTECTED]> > wrote: > > > > > > > > > Hi, > > > I'm a newbie with Django, and I&

media server implementation - context processor, custom template tag, or custom filter

2008-06-22 Thread alex
I already have {{ MEDIA_URL }} set in html, css, and js templates and that's working great. I would like to start setting far future caching headers on media files based on the git abbreviated commit hash for each file. i can think of three options for implementing this and would appreciate feedba

Formsets or Forms with Subforms

2008-07-11 Thread Alex
I have been trying to find a fairly generic way of creating forms that fill related models similar to the admin method of presenting the main form and then multiple forms for related objects that can be added in batches (ex, the tabular form). This is a common requirement but I haven't been able

How to group by two fields simultaneously.

2008-07-15 Thread Alex
I have the following: Model Person Model Stat Model Stat Value Model Team A Team has a set of Stats relevant to it. A person is on multiple teams, and has stats for his/her performance on that team which are stored as Stat Values. Stat values are unique by Person, Stats, and Team. I want to b

IntegrityError: datatype mismatch

2007-08-26 Thread Alex
and filling in both the start and end date/time forms: "IntegrityError at /admin/reg/workshop/1/ datatype mismatch" I can provide the entire error message if so desired. thanks -Alex --~--~-~--~~~---~--~~ You received this message because you are subscr

Bill Gates thinks Google should be worried!

2007-03-07 Thread alex
Hello Friends, Please go through the text. Bill Gates thinks Google should be worried! --- You must have heard by now about Agloco and how many people think it is going to be bigger than Google... Now Bill Gates is on record saying they have a great busine

Bill Gates thinks Google should be worried!

2007-03-07 Thread alex
Hello Friends, Please go through the text. Bill Gates thinks Google should be worried! --- You must have heard by now about Agloco and how many people think it is going to be bigger than Google... Now Bill Gates is on record saying they have a great busine

All about AGLOCO

2007-03-07 Thread alex
Hi Friends, This note is mainly to offer you a chance to help build AGLOCO - it is a Member-owned Internet community. Here is why I would like you to help. First - it is free. Second - it is quick and easy to join. Third - AGLOCO's purpose is to get its members their share of the money genera

python manage.py sql [myapp] doesn't generate all the needed code ?

2006-05-10 Thread Alex
Hello all, I'm new to Django. :) I'm following the online tutorial. I'm created a application called "browser" and I'm writing my models. And I'm running into a subclassing problem. Here is my code: from django.db import models class BasicContact: contact_name = models.CharField(maxlength=

Listening to a django channel from outside a consumer

2018-03-12 Thread Alex
Hi, The docs explain that it is possible to publish to the channel layer from outside of a consumer: https://channels.readthedocs.io/en/latest/topics/channel_layers.html#using-outside-of-consumers I need to do the opposite. I have a fairly complex python script that reads live data from pu

Widget rendering working as intended?

2008-08-25 Thread Alex G
u' %s="%s"' % (k, escape(v)) for k, v in attrs.items()]) # <-- right there, the escape(v) call... should this be conditional_escape? Since there are a lot of calls to mark_safe scattered through the widget and form-level calls used in rendering, I assume you're meant to b

Re: Widget rendering working as intended?

2008-08-25 Thread Alex G
#x27; the wisp") attrs['normal_string'] = "cat o' nine tails" super(MyWidget, self).__init__(*args, **kwargs) w = MyWidget() w.render("field_name", "") #=> u'' On Aug 25, 1:35 pm, Alex G <[EMAIL PROTECTED]> wrote: &g

How to subclass a model class?

2008-09-05 Thread Alex Chun
something like, redCars = TempCar.objects.filter(color='red') Django gives me a programming error 1146, table myproject.myapp.TempCar doesn't exist. Any help greatly appreciated. Thanks in advance! Alex --~--~-~--~~~---~--~~ You received this

Re: How to subclass a model class?

2008-09-05 Thread Alex Chun
age, along with some calculated information for each "car," which I have called the "comment" field. Thanks again. On Sep 5, 5:11 pm, bruno desthuilliers <[EMAIL PROTECTED]> wrote: > On 6 sep, 01:54, Alex Chun <[EMAIL PROTECTED]> wrote: > > > How can I su

Re: How to subclass a model class?

2008-09-06 Thread Alex Chun
Thanks, Bruno. I will try that first thing Monday. Thanks for helping this newbie out!! On Sep 5, 5:50 pm, bruno desthuilliers <[EMAIL PROTECTED]> wrote: > On 6 sep, 02:19, Alex Chun <[EMAIL PROTECTED]> wrote: > > > Thank you for the response.  I should have said: the

Re: How to subclass a model class?

2008-09-08 Thread Alex Chun
Thank you AmanKow. I will try adding a method to my model to "hold" the additional "field." On Sep 7, 9:57 am, AmanKow <[EMAIL PROTECTED]> wrote: > Monkey patching attributes to the instances would not be the correct > django idiom for adding a calculated field.  There is a simple and > straight

Re: Djangobook Revisions for 1.0 release

2008-09-28 Thread Alex Polite
ut I'm not making any Maybe you could at least put something in the header stating that the book is not up to date? I've been starting out with Django this weekend, using the Djangobook and it took me a while to understand that it's not up to date. Alex -- http://polite.se -

Re: ModelForm and request.POST

2008-09-29 Thread Alex Koshelev
If you what to provide some init state for form - use `initial` param On Sep 30, 2:31 am, globophobe <[EMAIL PROTECTED]> wrote: > I would like to instantiate a modelform with a dictionary to work with > an existing object, e.g. > > a = Article.objects.get(title='Big news') > f = ArticleForm({'tit

Highlight current active page

2008-09-30 Thread Alex Rades
Hi, what kind of pattern do you use to add a class attribute to the current page being viewed? I mean the usual: Home Products FAQ contact us I have this snipped of html defined in the base template and all pages inherit from it. Currently I'm using this templatetag: http://gnuvince.wordpress

dynamic associations?

2008-10-06 Thread Alex G
o specify which attribute I'm after... Does anyone have any suggestions? Thanks in advance, Alex. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send e

Re: Can this be solved without hardcoded SQL?

2008-10-06 Thread Alex Ezell
to replicate GROUP BY functionality in the ORM. A quick search of the documentation seems to reinforce that. I'd love to know if that's no longer correct. I think dropping to raw SQL may be the only option here. /alex --~--~-~--~~~---~--~~ You received

Re: dynamic associations?

2008-10-07 Thread Alex G
'some_relation_or_fk') # but... Traceback (most recent call last): File "", line 1, in File "/Library/Python/2.5/site-packages/django/db/models/fields/ related.py", line 235, in __get__ raise self.field.rel.to.DoesNotExist DoesNotExist So I can't assign

Re: dynamic associations?

2008-10-07 Thread Alex G
I had not, actually, but it seems like it provides for exactly what I'm trying to do. I will look into it further, thank you. On Oct 6, 6:25 pm, bruno desthuilliers <[EMAIL PROTECTED]> wrote: > On 6 oct, 23:53, Alex G <[EMAIL PROTECTED]> wrote:> Dear django-users, >

Re: dynamic associations?

2008-10-08 Thread Alex G
s though its attributes were in the current User table. #To that end, I strapped together a decorator that works like this: @link_model_to(Account, through = 'account') def __init__(self, *args, **kwargs): super(User, self).__init__(*args,**kwargs) I've actually gotten

Re: ManyToManyFieldManager in post_save signal

2008-10-12 Thread Alex Koshelev
There is not way track M2M field change with post_save signal. You can write your own derived M2M field class with needed hooks. On Oct 12, 9:01 pm, Viktor <[EMAIL PROTECTED]> wrote: > Hi, > > I have three simple models Project and Member, where Project.member is > a ManyToManyField to User throu

Re: Highlight current active page

2008-10-13 Thread Alex Rades
rsonally dont' see the needs for loops and extra code. Or is my app to > simple ... :-) > > Regards, > > Gerard. > > Steven Armstrong wrote: >> Alex Rades wrote on 09/30/08 09:03: >>> Hi, >>> what kind of pattern do you use to add a class attribute t

Best practice to build a multilingual site

2008-10-13 Thread Alex Rades
Hi, if we have a model like: class News(models.Model): title = models.CharField(..) content = models.TextField(...) Imagine i want to work with different language (this means adding multilingual content via admin and retrieving it from views/templates) What is the best way to develop thi

Re: why not django's default server?

2008-10-25 Thread Alex Ezell
On Sat, Oct 25, 2008 at 12:27 AM, gniquil <[EMAIL PROTECTED]> wrote: > The reason I don't want to use apache is primarily due to 1. restarts Why not use Apache with mod_wsgi? Then, you just touch a file to reload your new code. No restart

Access the current instance from limit_choices_to?

2008-10-27 Thread Alex Rades
Hi, is there currently a way to have something like: class Mother(models.Model): firstborn = models.ForeignKey('Child', limit_choices_to={'mother':lambda me: me}) class Child(models.Model): mother = models.ForeignKey('Mother', related_name='children') (taken from http://code.djangoproj

Re: Access the current instance from limit_choices_to?

2008-10-27 Thread Alex Rades
tions as a function of the current model instance. " On Mon, Oct 27, 2008 at 1:16 PM, Alex Rades <[EMAIL PROTECTED]> wrote: > Hi, > is there currently a way to have something like: > > class Mother(models.Model): >firstborn = models.ForeignKey('Child', > lim

Adding properties to models at run-time.

2008-10-30 Thread Alex G
et at the information in my derivative class... Does anyone have any ideas/suggestions? Thank you, Alex. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send

Re: Adding properties to models at run-time.

2008-10-30 Thread Alex G
PROFILE_MODULE would have multiple values. Any clues? Thanks, Alex. On Oct 30, 4:33 pm, Daniel Roseman <[EMAIL PROTECTED]> wrote: > On Oct 30, 8:11 pm, Alex G <[EMAIL PROTECTED]> wrote: > > > > > Hi, > > > I've been trying for some time to create a polym

Re: Overriding update in models

2008-11-04 Thread Alex Koshelev
Hi, Antonio. Try to replace `datetime.date.today()` with `datetime.datetime.now()` calls. On Tue, Nov 4, 2008 at 23:58, Antonio Volpon <[EMAIL PROTECTED]>wrote: > > Hello. > > I am very new to Django and I'm having some problems in overriding the > save method for a simple class. In particular,

Re: How to use post_save signal

2008-11-05 Thread Alex Koshelev
Make `update_stock_status` a free function not `Sale` method. On Wed, Nov 5, 2008 at 12:43, Low Kian Seong <[EMAIL PROTECTED]> wrote: > > My code is here > > http://dpaste.com/88831/ > > It's not working I really don't know why the other part of the > post_save is not even being executed > > On W

Re: redirection 2 links back after signing up?

2008-11-05 Thread Alex Koshelev
And how about to ignore `next` param in `create_account` view and explicitly redirect user to his restricted area? On Wed, Nov 5, 2008 at 17:12, [EMAIL PROTECTED] <[EMAIL PROTECTED] > wrote: > > Hello, > > I have the following situation: > > 1) User goes to a restricted area and is offered a cha

Re: Is it possible to output JSON like this?

2008-11-05 Thread Alex Koshelev
With simplejson module (that is part of django distribution) you can covert to JSON any python objects. So create data structure you need and pass it to simplejson dump/dumps functions. On Thu, Nov 6, 2008 at 01:17, Darthmahon <[EMAIL PROTECTED]> wrote: > > Hi, > > Ok I'm using the following cod

Re: Upload Progress Bar

2008-11-06 Thread Alex Koshelev
And what error message do you receive? On Thu, Nov 6, 2008 at 09:46, Pawel Pilitowski <[EMAIL PROTECTED]>wrote: > > Hi all, > > I'm in the process of trying to write an Upload Progress Bar for my app. > > I'm using the latest trunk version of Django, mod_python 3.3.1, > Memcached, Apache 2.2.8 p

Re: i18n strategy

2008-11-06 Thread Alex Koshelev
The is an existing db internalization application - http://code.google.com/p/django-multilingual/. Try to look at it. On Thu, Nov 6, 2008 at 11:20, Brandon Taylor <[EMAIL PROTECTED]>wrote: > > Hi everyone, > > I'm tasked with translating a mostly database-driven site into > Spanish. I'm familiar

Re: Best practice

2008-11-06 Thread Alex Koshelev
> Profile.objects.create(name=name, foo=foo) How do you get this `name` and `foo` variables in `save` method? On Thu, Nov 6, 2008 at 08:20, meppum <[EMAIL PROTECTED]> wrote: > > I've run into a funny case and I'm not sure how to best deal with it. > Basically, I have the following classes. > >

Re: Is it possible to output JSON like this?

2008-11-06 Thread Alex Koshelev
quot;, "dayEvents": [{"id": "1", "location": "1", "title": "Event 1"}, {"id": "2", "location": "1", "title": "Event 2"}]}]' On Thu, Nov 6, 2008 at 12:13, Darthmahon &

Re: Getting a relationship using double underscores

2008-11-06 Thread Alex Koshelev
If you have `serverid` field in database so you can add reference with custom column name [1]. For example: server = models.ForeignKey(Server, db-column="serverid") [1]: http://docs.djangoproject.com/en/dev/ref/models/fields/#db-column On Thu, Nov 6, 2008 at 15:10, gv <[EMAIL PROTECTED]> wrote:

  1   2   3   4   5   6   7   8   9   10   >