Joining two unrelated tables via the ORM with m-to-m relationship?

2020-12-14 Thread Sam Clark
I have a design/approach question, I think it boils down to needing to join two tables on multiple fields, where the tables are not linked via a foreignkey. However I'm open to any suggestions on rethinking the overall approach to it. Here's what I'm trying to accomplish. I have a model with fie

Re: m

2020-10-11 Thread Dvs Khamele
Hi do you hire contract based python/django freelancer? We can help you in this and related tasks at fair prices. Reply or send email to divy...@pythonmate.com Best Regards, Divyesh Khamele, Pythonmate On Fri, 9 Oct 2020, 6:05 pm Suhaib Ali, wrote: > hello > > -- > You received this message bec

m

2020-10-09 Thread Suhaib Ali
hello -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.

Re: PROBLEM WITH ACCESING MY APP WITH -m django runserver WITH DJANGO!!

2019-10-09 Thread Clara Daia
nge path and tried to work on a virtual env but > nothing work . > also launch mysql and apache with xampp but this what the terminal say: > PS Microsoft.PowerShell.Core\FileSystem::\\nas30-001\10 Support > Engineering\06-PHTF USERS\PHT Toulouse\Ismael\IODA\Application IODA\IODA>

PROBLEM WITH ACCESING MY APP WITH -m django runserver WITH DJANGO!!

2019-10-09 Thread Ismael Martinez
al say: PS Microsoft.PowerShell.Core\FileSystem::\\nas30-001\10 Support Engineering\06-PHTF USERS\PHT Toulouse\Ismael\IODA\Application IODA\IODA> py -m django runserver Traceback (most recent call last): File "C:\Users\ima7363\AppData\Local\Programs\Python\Python37\lib\runpy.py", line 193,

Re: “python -m django --version” 1.11.18 Cannot update to 2.1

2019-02-10 Thread sachin thakur
the system at-large. > > You can search on pip and virtualenvwrapper to get an an idea on what each > of these does. > > On Sun, Feb 10, 2019 at 8:44 PM Dom Delbuco wrote: > >> I'm new to Python and Django, I watched a tutorial that requires me to >> have Dj

Re: “python -m django --version” 1.11.18 Cannot update to 2.1

2019-02-10 Thread JP Smith
M Dom Delbuco wrote: > I'm new to Python and Django, I watched a tutorial that requires me to > have Django 2.1. When I type in "python -m django --version" - my Ubuntu > terminal says 1.11.18 But, when I type "django-admin --version" - terminal > says 2.1 This

“python -m django --version” 1.11.18 Cannot update to 2.1

2019-02-10 Thread Dom Delbuco
I'm new to Python and Django, I watched a tutorial that requires me to have Django 2.1. When I type in "python -m django --version" - my Ubuntu terminal says 1.11.18 But, when I type "django-admin --version" - terminal says 2.1 This didn't bother me until I reac

Template filter {{ value|date:"M" }} in Python

2018-11-06 Thread Carsten Fuchs
Hello, complementing template filters, sometimes it is necessary to format dates also in Python code, that is, achieve the equivalent to {{ value|date:"M" }} For this, I'm using from django.utils import dateformat dateformat.format(value, "M") (This wor

Re: How to edit model.py and serializer so I can recieve contact":{"name":"asdf","email":"m...@email.com","phone":"1111111111"}}

2018-10-31 Thread Krishnasagar Subhedarpage
> *What gets forwarded to my backend?* > > {"id":189267,"name":"asdf","address":"asdf","description":"asdf","totalSpots":"0","spotsTaken":"0","location":"0,0&q

How to edit model.py and serializer so I can recieve contact":{"name":"asdf","email":"m...@email.com","phone":"1111111111"}}

2018-10-31 Thread Tim Vogt
: string; } *What gets forwarded to my backend?* {"id":189267,"name":"asdf","address":"asdf","description":"asdf","totalSpots":"0","spotsTaken":"0","location":"0,0",&q

Re: python -m django --version

2018-08-22 Thread Franklin Sarmiento
Sarmiento ( franklinit...@gmail.com )* *E-mail: franklinit...@gmail.com * *Teléfono(s): +57 320 490.79.64 / +58 426 273.8103 ( whatsapp )* El mié., 22 ago. 2018 a las 7:09, Jason () escribió: > basic python command line arg. you can see it when executing `python > --help` in the terminal. >

Re: python -m django --version

2018-08-22 Thread Jason
basic python command line arg. you can see it when executing `python --help` in the terminal. -m mod : run library module as a script (terminates option list) -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this

python -m django --version

2018-08-22 Thread Basavaraj Halgali
Hi What is usage of -m command in this command line "python -m django --version". Regards, Basav -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send

Web App for M. Tech Dissertation

2016-03-04 Thread Haruna Yakubu
Hello friends, Please suggest me a simple project on Python and Django to do as my M. Tech dissertation. thanks -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an

Re:Re: self.publish.strftime('%m')

2016-01-31 Thread 林攀
;, args=[self.publish.year, self.publish.strftime('%m'), self.publish.strftime('%d'), self.slug]) url(r'^(?P\d{4})/(?P\d{2})/(?P\d{2})/(?P[-\w]+)/$', view

Re: self.publish.strftime('%m')

2016-01-30 Thread Peter of the Norse
. With the year, you don’t have to worry about that, so it gets skipped. > On Jan 26, 2016, at 6:30 AM, 林攀 <18610710...@163.com> wrote: > > return reverse('blog:post_detail', args=[self.publish.year, >

Re: self.publish.strftime('%m')

2016-01-26 Thread James Schneider
On Tue, Jan 26, 2016 at 5:30 AM, 林攀 <18610710...@163.com> wrote: > return reverse('blog:post_detail', args=[self.publish.year, > self.publish.strftime('%m'), >

self.publish.strftime('%m')

2016-01-26 Thread 林攀
return reverse('blog:post_detail', args=[self.publish.year, self.publish.strftime('%m'), self.publish.strftime('%d'), self.slug]) url(r'^(?

Django 1.1 - comments - ‘render_comment_for m’ returns TemplateSyntaxError

2009-12-09 Thread Kenny Meyer
Hello, I want to simply render a built-in comment form in a template, using Django's builtin commenting module, but this returns a TemplateSyntaxError Exception. I need help debugging this error, please, because after googling and using the Django API reference, I'm still not getting any farther.

Re: '%d-%m-%Y' format for DateTimefield in django

2009-08-31 Thread zayatzz
t; I am trying to add the '%d-%m-%Y' format in DateTimefield. As django > > does not support this format so when I add different date formats, it > > gives "invalid date/time" error in django console.This error occurs > > because the form is not valid(form.is_vali

Re: '%d-%m-%Y' format for DateTimefield in django

2009-08-28 Thread Karen Tracey
On Aug 28, 3:19 am, Jigar wrote: > Hi All, > > I am trying to add the '%d-%m-%Y' format in DateTimefield. As django > does not support this format so when I add different date formats, it > gives "invalid date/time" error in django console.This error occ

'%d-%m-%Y' format for DateTimefield in django

2009-08-28 Thread Jigar
Hi All, I am trying to add the '%d-%m-%Y' format in DateTimefield. As django does not support this format so when I add different date formats, it gives "invalid date/time" error in django console.This error occurs because the form is not valid(form.is_valid()) as above ment

Re: remove ^M: project moved from window to linux

2008-01-13 Thread Brett Parker
On 13 Jan 11:20, Jonathan Ballet wrote: > You're right, Unix based systems use only the line feed (LF) control > character (which is represented by "\r" in Vim, BTW). > You might want to read this [1] for further explanations. Actually, LF is \n, CR is \r (\r being "return", short for carriage re

Re: remove ^M: project moved from window to linux

2008-01-13 Thread Jonathan Ballet
Hi, Le Sat, 12 Jan 2008 20:30:25 -0800 (PST), ocgstyles <[EMAIL PROTECTED]> a écrit : > I need to do that often at work when Windows files are moved over to > AIX. I just use vi. The key sequence is: > > :%s/^M// If you want to mimic dos2unix, you should use

Re: remove ^M: project moved from window to linux

2008-01-12 Thread ocgstyles
I need to do that often at work when Windows files are moved over to AIX. I just use vi. The key sequence is: :%s/^M// To create the ^M character, press Ctrl+V, then M. I'm not sure what that character is (never bothered to look), but I think may be that extra control character that Wi

Re: remove ^M: project moved from window to linux

2008-01-12 Thread Kenneth Gonsalves
On 12-Jan-08, at 10:12 PM, crybaby wrote: > What is the fastest way to remove ^M from every files in main project > folder and apps folders. Doing it by hand seems time consuming. Is > there a simple script take care of this? if I just leave the ^M in > python code, would it ca

Re: remove ^M: project moved from window to linux

2008-01-12 Thread Brett Parker
On 12 Jan 17:47, Lars Stavholm wrote: > > crybaby wrote: > > What is the fastest way to remove ^M from every files in main project > > folder and apps folders. Doing it by hand seems time consuming. Is > > there a simple script take care of this? if I just leave t

Re: remove ^M: project moved from window to linux

2008-01-12 Thread Lars Stavholm
crybaby wrote: > What is the fastest way to remove ^M from every files in main project > folder and apps folders. Doing it by hand seems time consuming. Is > there a simple script take care of this? if I just leave the ^M in > python code, would it cause problems? If you'

remove ^M: project moved from window to linux

2008-01-12 Thread crybaby
What is the fastest way to remove ^M from every files in main project folder and apps folders. Doing it by hand seems time consuming. Is there a simple script take care of this? if I just leave the ^M in python code, would it cause problems

Re: anyone see this problem in psycopg2 i m unable to debug this

2006-09-30 Thread Eric Walstad
On Friday 29 September 2006 07:31 pm, a wrote: > this sounds serious how do we implement rollbacks > i use postgres 8.1 > thanks > Anil --~--~-~--~~~---~--~~ You received this messag

Re: anyone see this problem in psycopg2 i m unable to debug this

2006-09-29 Thread James Bennett
On 9/29/06, a <[EMAIL PROTECTED]> wrote: > this sounds serious how do we implement rollbacks from django.db import connection connection._rollback() This behavior, by the way, is a *good* thing; rather than try to sort things out and go on, PostgreSQL is saying, "An error happened, and I'm going

Re: anyone see this problem in psycopg2 i m unable to debug this

2006-09-29 Thread a
this sounds serious how do we implement rollbacks i use postgres 8.1 thanks Anil Eric Walstad wrote: > anil wrote: > > psycopg2.ProgrammingError : current transaction is aborted, commands > > ignored until end of transaction block > > Anil, > > I get these errors when a call to psycopg fails and t

Re: anyone see this problem in psycopg2 i m unable to debug this

2006-09-29 Thread Eric Walstad
anil wrote: > psycopg2.ProgrammingError : current transaction is aborted, commands > ignored until end of transaction block Anil, I get these errors when a call to psycopg fails and the transaction in which it failed is not rolled back. All further database actions will fail until you roll ba

Re: anyone see this problem in psycopg2 i m unable to debug this

2006-09-29 Thread Rafael SDM Sierra
Hi anil, with this message we can't see what error is happen, you need say if you create some manual query, or if you edit something...What steps you follow?On 9/29/06, anil <[EMAIL PROTECTED]> wrote: psycopg2.ProgrammingError : current transaction is aborted, commandsignored until end of transacti

anyone see this problem in psycopg2 i m unable to debug this

2006-09-29 Thread anil
psycopg2.ProgrammingError : current transaction is aborted, commands ignored until end of transaction block --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to

Re: M-R / ImageField / file upload / custom manipulator

2006-06-15 Thread [EMAIL PROTECTED]
Hello. I'm wondering if you've found a solution to this or if anyone else knows what the problem might be. I'm having the same problem as you, and my code is nearly identical. Thanks, Julia --~--~-~--~~~---~--~~ You received this message because you are subscri

M-R / ImageField / file upload / custom manipulator

2006-05-30 Thread funk
Hi there, i am experiencing problems with the use of ImageField (model) in M-R, revision 3007. MySQL gets sql errors when saving. It seems to be wanting to save the uploaded image without quotes or something. This does not belong to mysql code i think since i want to save my file at MEDIA_ROOT

admin "page not found" after m-r migration

2006-05-29 Thread frank h.
Hello, I recently migrated to trunk and all seems great except that I cannot change the admin user when logged in as admin user... the error message in the browser is: Page not found (404) Request Method: GET Request URL:http://127.0.0.1:8000/admin/auth/user/1/ can anyone shed some l

Re: admin app doesnt work after m-r migration

2006-05-16 Thread frank h.
thanks malcolm, I had prepared the necessary database changes in a script a while ago turns out the documentation has changed since then... :-) following the steps in the updated http://code.djangoproject.com/wiki/RemovingTheMagic#Databasechangesyoullneedtomake and everything works!! thanks, -fr

Re: admin app doesnt work after m-r migration

2006-05-16 Thread Malcolm Tredinnick
On Tue, 2006-05-16 at 00:21 -0700, frank h. wrote: > Hi I just migrated to magic-removal and everything seems fine (my views > work etc) When you say you "migrated to magic-removal", did you also follow the database change insructions on this page: http://code.djangoproject.com/wiki/RemovingTheM

admin app doesnt work after m-r migration

2006-05-16 Thread frank h.
Hi I just migrated to magic-removal and everything seems fine (my views work etc) ...except that when I try to login into the admin app, I get an error about OperationalError at /admin/ (1054, "Unknown column 'django_content_type.model' in 'field list'") Request Method: GET Request URL:

Re: extend User in m-r

2006-05-04 Thread Dagur
Has this problem been solved? I've been fighting this problem forever. Everything seems to work but no matter what i do the data in the new class never gets saved. I would really love to see some instructions in the documentation. --~--~-~--~~~---~--~~ You receive

Re: M-R DB API Usage Question: How to order_by with extra field?

2006-05-02 Thread Adrian Holovaty
On 4/25/06, FX <[EMAIL PROTECTED]> wrote: > Seems to me it looks like a bug in the m-r branch. > django/db/models/query.py, line 430: > > was: > if "." not in col_name and col_name not in [k[0] for k in (self._select > or ())]: > > should be: > if "

Re: [M-R] order by on custom SELECT column

2006-05-02 Thread Adrian Holovaty
On 5/1/06, Cheng Zhang <[EMAIL PROTECTED]> wrote: > I use a custom SELECT column as: > select = { > 'choices': 'SELECT COUNT(*) FROM polls_choice WHERE > poll_id=polls_poll.id', > } > p = Poll.objects.extra(select=select).order_by('choices') > > By trying this, I found out a bug in the ORM layer w

[M-R] order by on custom SELECT column

2006-05-01 Thread Cheng Zhang
On the models of tutorial 1, I want to get a list of Poll, order by how many choices it has. class Poll(models.Model): question = models.CharField(maxlength=200) pub_date = models.DateTimeField('date published') class Choice(models.Model): poll = models.ForeignKey(Poll) cho

Re: [M-R] lookup like Article.objects.filter(id__in = []) will fail

2006-04-30 Thread Adrian Holovaty
On 4/30/06, Cheng Zhang <[EMAIL PROTECTED]> wrote: > I tried lookup like Article.objects.filter(id__in = []), which will > have SQL statement whose where clause is something like 'WHERE > ("poll_article"."id" IN ())'. Such SQL statement is ok with SQLite > but invalid for PostgreSQL. > > I work ar

Re: [M-R] lookup like Article.objects.filter(id__in = []) will fail

2006-04-30 Thread Cheng Zhang
On Apr 30, 2006, at 1:31 PM, Ivan Sagalaev wrote: > > Cheng Zhang wrote: > >> I tried lookup like Article.objects.filter(id__in = []), which will >> have SQL statement whose where clause is something like 'WHERE >> ("poll_article"."id" IN ())'. Such SQL statement is ok with SQLite >> but invalid

Re: simon's AbstractSearching still working with m-r branch?

2006-04-29 Thread FX
it shell work with this patch attached: Patch: Index: stuff/branches/magic-removal/json.py === --- stuff/branches/magic-removal/json.py(revision 1002) +++ stuff/branches/magic-removal/json.py(working copy) @@ -2,7 +2,

Re: [M-R] lookup like Article.objects.filter(id__in = []) will fail

2006-04-29 Thread Ivan Sagalaev
Cheng Zhang wrote: >I tried lookup like Article.objects.filter(id__in = []), which will >have SQL statement whose where clause is something like 'WHERE >("poll_article"."id" IN ())'. Such SQL statement is ok with SQLite >but invalid for PostgreSQL. > >I work around this problem with code li

[M-R] lookup like Article.objects.filter(id__in = []) will fail

2006-04-29 Thread Cheng Zhang
Hi, folks I tried lookup like Article.objects.filter(id__in = []), which will have SQL statement whose where clause is something like 'WHERE ("poll_article"."id" IN ())'. Such SQL statement is ok with SQLite but invalid for PostgreSQL. I work around this problem with code like: if len(id_l

Re: [M-R] __repr__ or __str__?

2006-04-29 Thread Malcolm Tredinnick
On Sat, 2006-04-29 at 14:49 +0200, Petar Marić wrote: > Looking through some recent changes I noticed that some M-R code uses > __repr__ and some new checkins use __str__ > > Is there anything we need to know? Short answer: You need to know that Django is coming around to the Pyt

[M-R] __repr__ or __str__?

2006-04-29 Thread Petar Marić
Looking through some recent changes I noticed that some M-R code uses __repr__ and some new checkins use __str__ Is there anything we need to know? -- Petar Marić *e-mail: [EMAIL PROTECTED] *mobile: +381 (64) 6122467 *icq: 224720322 *skype: petar_maric *web: http://www.petarmaric.com

Re: Validators in a model's validator_list (m-r)

2006-04-26 Thread Christian Schneider
Good morning,On 4/25/06, Michael Radziej <[EMAIL PROTECTED]> wrote: I don't know what you mean with "stop". I think each validator will beexecuted, but they will take into account whether record_type has theright value.Anyway, I personally give up :-( You can try to find out what's happening:- crea

simon's AbstractSearching still working with m-r branch?

2006-04-25 Thread nkeric
hi all, I would like to know if simon's AbstractSearching still working with the django m-r branch? https://simon.bofh.ms/cgi-bin/trac-django-projects.cgi/wiki/AbstractSearching Regards, - Eric --~--~-~--~~~---~--~~ You received this message because yo

Re: M-R DB API Usage Question: How to order_by with extra field?

2006-04-25 Thread FX
Seems to me it looks like a bug in the m-r branch. django/db/models/query.py, line 430: was: if "." not in col_name and col_name not in [k[0] for k in (self._select or ())]: should be: if "." not in col_name and col_name not in [k for k in (self._select or ())]: for k[

M-R DB API Usage Question: How to order_by with extra field?

2006-04-25 Thread FX
Hi there! Finally got some part of the site working under M-R. It's a major edit due to our large code base, complex models and many custom template tags... :( I will try to post some of the things I learned along the way when I get this done... Here is the problem I'm having with righ

Re: Validators in a model's validator_list (m-r)

2006-04-25 Thread Christian Schneider
On 4/25/06, Michael Radziej <[EMAIL PROTECTED]> wrote: Christian Schneider wrote:> On 4/25/06, Michael Radziej <[EMAIL PROTECTED]> wrote: Christian Schneider wrote:>>> Michael,>>> >>> I'm still using a generic view. I played with some custom functions>> before>>> and they were called so I'd hop

Re: Validators in a model's validator_list (m-r)

2006-04-25 Thread Michael Radziej
Christian Schneider wrote: > On 4/25/06, Michael Radziej <[EMAIL PROTECTED]> wrote: >> >> Christian Schneider wrote: >>> Michael, >>> >>> I'm still using a generic view. I played with some custom functions >> before >>> and they were called so I'd hoped that it would work with the validator >>> ob

Re: Validators in a model's validator_list (m-r)

2006-04-25 Thread Christian Schneider
On 4/25/06, Michael Radziej <[EMAIL PROTECTED]> wrote: Christian Schneider wrote:> Michael,>> I'm still using a generic view. I played with some custom functions before> and they were called so I'd hoped that it would work with the validator > objects as well.I looked in the source. Aha! First para

Re: Validators in a model's validator_list (m-r)

2006-04-25 Thread Michael Radziej
Christian Schneider wrote: > Michael, > > I'm still using a generic view. I played with some custom functions before > and they were called so I'd hoped that it would work with the validator > objects as well. I looked in the source. Aha! First parameter to RequiredIfOtherField is the *name* of

Re: Validators in a model's validator_list (m-r)

2006-04-25 Thread Christian Schneider
Michael,I'm still using a generic view. I played with some custom functions before and they were called so I'd hoped that it would work with the validator objects as well.Regardschris On 4/25/06, Michael Radziej <[EMAIL PROTECTED]> wrote: Christian Schneider wrote:> However, no matter what value re

Re: Validators in a model's validator_list (m-r)

2006-04-25 Thread Michael Radziej
Christian Schneider wrote: > However, no matter what value recording_type has, the validator is not > called. What I find funny is that the validator's __call__ method takes > three values (self, field_data, all_data) while custom validator functions > specified with validator_list take only field

Validators in a model's validator_list (m-r)

2006-04-25 Thread Christian Schneider
Hi all,I want to specify some dependencies in my model (magic removal) and want to use django.core.validators.RequiredIfOtherFieldEquals for that.My model contains the following code:from django.core import validatorsrecording_type = models.IntegerField(    choices=RECORDING_TYPE_CHOICES, 

Re: ImageField/FileField in M/R

2006-04-25 Thread Nebojsa Djordjevic
Denis wrote: > If so, then it (the file) shouldn't be deleted when you delete() > the object? Also, M/R branch seems has no methods like > _pre_save/_post_save, > instead you can subclass save/delete methods. There are some references > in db.models.signals, dont know how to

Re: Typo in M-R page

2006-04-24 Thread Russell Keith-Magee
On 4/25/06, Todd O'Bryan <[EMAIL PROTECTED]> wrote: > > Should that be get_article_list() and article_set instead? Well spotted. I've fixed the wiki. Russ Magee --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Djan

Typo in M-R page

2006-04-24 Thread Todd O'Bryan
In the section of the M-R wiki where it talks about changes in the database API, the last line (under Many-to-many related lookup) says that old: site_obj.get_reporter_list() should be new: site.reporter_set.all() but I don't see any relationship between reporter and site. Should th

Re: adding Many-to-one objects in m-r

2006-04-24 Thread Russell Keith-Magee
On 4/25/06, Adam <[EMAIL PROTECTED]> wrote: > > I searched the ticket system and discovered that the first version > works as: > > reporter_obj.article_set.create(headline='Foo') > > Was it intended to have two different methods for this? "add" for using > a preexisting object and "create" for usi

adding Many-to-one objects in m-r

2006-04-24 Thread Adam
I just started porting an app over to magic-removal and ran across this. The documentation (http://code.djangoproject.com/wiki/RemovingTheMagic#Descriptorfields) says that you can add a ForeignKey related object with either of: reporter_obj.article_set.add(headline='Foo') reporter_obj.article_set

Re: ExtendedUserModel in m-r branch?

2006-04-23 Thread FX
thank you guys for the response... I guess we will have to go back using one-to-one till the inheritance is there... best regards, --FX --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post

Re: ExtendedUserModel in m-r branch?

2006-04-20 Thread James Bennett
On 4/20/06, FX <[EMAIL PROTECTED]> wrote: > Our application (we believe it's the first public launched web site > powered by django in China, http://www.ifaxian.com/) makes use of the > Extended User Model as described in the wiki, but I can't find the > "replace

Re: ExtendedUserModel in m-r branch?

2006-04-20 Thread Ivan Sagalaev
FX wrote: >Hi Folks, >Our application (we believe it's the first public launched web site >powered by django in China, http://www.ifaxian.com/) makes use of the >Extended User Model as described in the wiki, but I can't find the >"replaces_module" option anymor

Re: ImageField/FileField in M/R

2006-04-20 Thread Clint Ecker
This was discussed 8 months ago.  This is the ticket: http://code.djangoproject.com/ticket/369.  Feel free to add anything you think relevant. On 4/20/06, Denis <[EMAIL PROTECTED]> wrote: If so, then it (the file) shouldn't be deleted when you delete()the object? Also, M/R branch s

Re: ImageField/FileField in M/R

2006-04-20 Thread Denis
If so, then it (the file) shouldn't be deleted when you delete() the object? Also, M/R branch seems has no methods like _pre_save/_post_save, instead you can subclass save/delete methods. There are some references in db.models.signals, dont know how to use them though Clint Ecker написав: &

Re: ImageField/FileField in M/R

2006-04-20 Thread Clint Ecker
if i change the object like the 1 below and upload new filevia admin interface, old file remains in the directory, though nothing refers to it :-/class Picture(models.Model):fullsize = models.ImageField(upload_to='%Y/%m/%d')...-- ---Clint Ecker[EMAIL PROTEC

ImageField/FileField in M/R

2006-04-20 Thread Denis
Field(upload_to='%Y/%m/%d') ... --~--~-~--~~~---~--~~ 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 gr

ExtendedUserModel in m-r branch?

2006-04-20 Thread FX
Hi Folks, Our application (we believe it's the first public launched web site powered by django in China, http://www.ifaxian.com/) makes use of the Extended User Model as described in the wiki, but I can't find the "replaces_module" option anymore in the m-r branch. Could it s

Re: querying for an empty set in m-r?

2006-04-18 Thread akaihola
I vaguely remember an advice to use __isnull in a similar situation. Maybe one of these discussions turns up something useful: http://simon.bofh.ms/logger/django/search/?q=isnull --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Go

Re: Some help on edit_inline outside admin in M-R

2006-04-16 Thread Rudolph
I solved it myself, no help needed. Rudolph --~--~-~--~~~---~--~~ 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, s

Some help on edit_inline outside admin in M-R

2006-04-15 Thread Rudolph
Hi, I'm not abled to get edit_inline outside the admin to work on Magic Removal. Inside admin it works really great, even in M-R. It must be possible because it was introduced in this changeset: http://code.djangoproject.com/changeset/1434 and I can see the edit_inline argument i

Re: querying for an empty set in m-r?

2006-04-15 Thread Ian Clelland
On 4/12/06, Max Battcher <[EMAIL PROTECTED]> wrote: > Oh, right. You could do: > > tags = [tag for tag in Tag.objects.all() if tag.article_set.count() == 0] > > n queries for n tags, but it is "pretty" Python. Doing db-cleanup > shouldn't happen all that often, so you probably don't need the bes

Re: querying for an empty set in m-r?

2006-04-12 Thread Brian Elliott
but it means querying the DB again for every > tag. > >>> Each Article can be associated with multiple Tags and vice versa. >>> How can I query the Tag model to obtain all Tags with no associated >>> articles? (m-r) I basically want to delete unused tags.

Re: querying for an empty set in m-r?

2006-04-12 Thread Brian Elliott
Max, Just wanted to thank you for responding to my question. You are correct that the list comprehension is pythonic, though I was ideally looking for a efficient method from a database perspective. Thanks, Brian On Apr 12, 2006, at 2:16 AM, Max Battcher wrote: > > Russell Cloran wrote: >

Re: querying for an empty set in m-r?

2006-04-12 Thread Max Battcher
Russell Cloran wrote: > Hi, > > On Tue, 2006-04-11 at 21:20 -0400, Max Battcher wrote: >> if sometag.article_set.count() == 0: >> pass # your code here > > This will test if one tag has an empty article_set. AFAICT, the question > is on how to find all tags which have an empty article_set. Y

Re: querying for an empty set in m-r?

2006-04-11 Thread Russell Cloran
y, but it means querying the DB again for every tag. > > Each Article can be associated with multiple Tags and vice versa. > > How can I query the Tag model to obtain all Tags with no associated > > articles? (m-r) I basically want to delete unused tags. Unfortunately, it seems

Re: querying for an empty set in m-r?

2006-04-11 Thread Max Battcher
dels.Model): > tags = models.ManyToManyField(Tag) > > > Each Article can be associated with multiple Tags and vice versa. > How can I query the Tag model to obtain all Tags with no associated > articles? (m-r) I basically want to delete unused tags. > > T

querying for an empty set in m-r?

2006-04-11 Thread Brian Elliott
obtain all Tags with no associated articles? (m-r) I basically want to delete unused tags. Thanks, Brian --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, sen

Re: Model module naming in m-r

2006-04-11 Thread Adrian Holovaty
On 4/11/06, Fawad Halim <[EMAIL PROTECTED]> wrote: > Awesome. Good to know I'm not going crazy. Would anyone mind me adding > this to the RemovingTheMagic page (until the issue is resolved)? It might > save others hours of digging inside the Django code. Note that the issue was resolved yesterday

Re: Model module naming in m-r

2006-04-11 Thread Fawad Halim
On Mon, April 10, 2006 16:53, Luke Plant wrote: > > On Monday 10 April 2006 14:37, Fawad Halim wrote: > > >> I was trying to port an existing (0.91) app to the m-r branch, and >> found that apparently, the m-r branch requires the models to reside in >> models.py di

Re: Model module naming in m-r

2006-04-10 Thread Luke Plant
On Monday 10 April 2006 14:37, Fawad Halim wrote: > I was trying to port an existing (0.91) app to the m-r branch, and > found that apparently, the m-r branch requires the models to reside > in models.py directly under the app directory > (django.db.models.base.ModelBase explicitl

Re: Model module naming in m-r

2006-04-10 Thread Waylan Limberg
On 4/10/06, Fawad Halim <[EMAIL PROTECTED]> wrote: > > In db/models/base.py, there is a check that goes like > > if re.sub('\.models$', '', mod) not in settings.INSTALLED_APPS: > > That kinda indicates that the models module name should end in .models. > > Regards > -fawad > Per python (oversimpli

Re: Model module naming in m-r

2006-04-10 Thread Fawad Halim
On Mon, April 10, 2006 09:01, James Bennett wrote: > > On 4/10/06, Fawad Halim <[EMAIL PROTECTED]> wrote: > >> I was trying to port an existing (0.91) app to the m-r branch, and >> found that apparently, the m-r branch requires the models to reside in >>

Re: Model module naming in m-r

2006-04-10 Thread James Bennett
On 4/10/06, Fawad Halim <[EMAIL PROTECTED]> wrote: > I was trying to port an existing (0.91) app to the m-r branch, and found > that apparently, the m-r branch requires the models to reside in > models.py directly under the app directory The only restriction I'm aware of is

Model module naming in m-r

2006-04-10 Thread Fawad Halim
Hi all, I was trying to port an existing (0.91) app to the m-r branch, and found that apparently, the m-r branch requires the models to reside in models.py directly under the app directory (django.db.models.base.ModelBase explicitly checks for the model module name ending in .models). Is this a

Re: extend User in m-r

2006-04-10 Thread olive
Bryan, this won't work either, because when you try to save the user using admin you will have this kind of error: Request Method: POST Request URL:http://localhost:8000/admin/auth/user/40/ Exception Type: TypeError Exception Value:Cannot resolve keyword 'name' into f

Re: How to make the module name translatable in M-R

2006-04-07 Thread Rudolph
All seems okay (the app name appears in the .po file), but it doesn't get translated (the model names get translated!). I guess one should make a small change to contrib/admin/templatetags/adminapplist.py to make it happen... Or does someone get this working with current M-R branch? Ru

Re: extend User in m-r

2006-04-06 Thread Bryan Chow
You can extend the user model in m-r using a ForeignKey with edit_inline, num_in_admin=1, max_num_in_admin=1, and unique=True. This is what my dev team uses to add additional fields to users. Conceptually, a OneToOneField would probably make more sense, but it seems that OneToOneField is still

Re: extend User in m-r

2006-04-06 Thread Michael
Hi Arthur,If I will use OneToOne then in admin it wolud be not possible to edit users, which is not in 'myusers' ( using edit_inline) and if disable edit_inline then I sholud edit 'myusers' in to places one in 'users' and then in 'myusers'. in that case better to use 'ForeignKey' or may be it is ex

Re: extend User in m-r

2006-04-06 Thread arthur debert
hi michael. inheritance is not working yet in magic-removal. the confusing thing about it is you can create the class and the table does get created, but when you access the same class later in your python code, it will be treated as the super class (User in your case). Extending User is a very

extend User in m-r

2006-04-06 Thread [EMAIL PROTECTED]
Hi all! What would be the best way to extend User class? subclassing makes another table and wiki -> http://www.djangoproject.com/documentation/models/subclassing/ different from m-r. remove_fileds dosen't work and in admin it is possible to add info to new class but not to modify i

  1   2   >