Damnit, my port was wrong above, here goes, with list for content and
dict for attributes as arguments instead of using *args, **kwargs:
if not request.user.is_authenticated:
content.append(
Li(
[A([_('Log in')], dict(href=reverse('crudlfap:
Better for perspective to port the first example in second syntax to compare:
if not request.user.is_authenticated:
content.append(
Li(
A([_('Log in')], dict(href=reverse('crudlfap:login'))),
dict(cls='no-padding'),
Hi all,
We're running some experiments replacing templates by Components
(which support channels based data-binding amongst other niceties) in
Python, i would like to run an opinion survey about two syntaxes
before moving on. Syntax 0 is what seems more "pythonic" but requires
a less strict call s
I think you are on the right track. I am doing something similar with
photos and gps tracks uploaded by users and the celery/redis combo makes it
easy to run a compute intensive task without blocking the site.
I'm not sure if the celery-signals approach is strictly necessary,
however. I am foll
I am building a django 2.x site to:
* upload documents (images, pdfs, and videos)
* apply metadata to the documents (JSON metadata field)
* transform the documents (thumbnails, OCR, language translations, image
conversion, facial recognition, image blurring, etc.) based on some of the
metadata fiel
On Sun, Jun 25, 2017 at 6:56 PM, Constantine Covtushenko <
constantine@gmail.com> wrote:
> Hi Mark,
>
> I have some questions to you.
> 1. Does any of MetaData have predefined list of MetaDataValues?
>
No, I want to add them in real time as Documents are uploaded.
> 2. Can MetaDataValue be
Hi Mark,
I have some questions to you.
1. Does any of MetaData have predefined list of MetaDataValues?
2. Can MetaDataValue be assigned to many Documents or it is specific to
particular Document?
Regards,
Constantine C.
On Sun, Jun 25, 2017 at 6:20 PM, Mark Phillips
wrote:
> I have a class Doc
I have a class Document that uploads a document. I have a class MetaData
that is the name for some metadata for that document. Since a MetaData can
have one or more values, there is another class called MetaDataValue that
has a ForeignKey to MetaData. Finally, there is a class
DocumentMetaDataValue
On Sat, Aug 1, 2015 at 4:53 AM, James Schneider wrote:
> If you are talking about potentially having enough rows to extend past the
> AutoPK limits, you should consider instead using a UUID field as the PK:
note that this is only good advice if your DB handles it natively. if
not, Django will us
If you are talking about potentially having enough rows to extend past the
AutoPK limits, you should consider instead using a UUID field as the PK:
https://docs.djangoproject.com/en/1.8/ref/models/fields/#uuidfield
The example in the docs uses UUID4. They index nicely and there are 2^128
(~3.4 x
Why not use a BigIntegerField?
On Sat, Aug 1, 2015 at 12:06 AM, jordi collell wrote:
> Hi all!
>
> I have to store spreadsheet info on a db. Some kind of quotes where the
> user can store distinct prices for every zone.
>
> After modeling the data, i have a Cell like row. (related to a zone, and
Hi all!
I have to store spreadsheet info on a db. Some kind of quotes where the
user can store distinct prices for every zone.
After modeling the data, i have a Cell like row. (related to a zone, and
with a quantity field).. something like:
zone1 1 100
zone1 2 99
zone1 3 98
Every zone
On Fri, Feb 20, 2015 at 4:23 PM, Gergely Polonkai
wrote:
> Hello,
>
> I’m currently implementing a finite state machine in my application using
> Django FSM[1]. In the Usage section of the README the author said that
> “This function may contain side-effects, like updating caches, notifying
> use
I'm not sure if there's an official stance on that, but I believe that
since Django is a "MVT" framework, that kind of logic does not seem to be
appropiate neither for templates nor views, so models seem like the logical
choice.
That way you can also make sure that the side-effect that you want to
Hello,
I’m currently implementing a finite state machine in my application using
Django FSM[1]. In the Usage section of the README the author said that
“This function may contain side-effects, like updating caches, notifying
users, etc.”
Opposing this statement, the Symfony PHP framework’s aut
Hi Alex,
I'm still new to Django and Python, but I have experience in other
frameworks. Here is my opinion regarding your three points:
*(1) An app for each role.* I think the approach of having one app for each
role is the worst thing to do. In this case, you would have too much
duplicated code
On Mon, Feb 11, 2013 at 7:13 AM, Ajinkya Gadewar <
ajinkya.gade...@ishareitall.com> wrote:
> Hi Alex,
>
> I already have a education system developed. We run a software company in
> India. Let me know if you need more details on it.
>
> Regards,
> Ajinkya Gadewar
>
> Sent from my iPhone
>
> On 11-
Hi Alex,
I already have a education system developed. We run a software company in
India. Let me know if you need more details on it.
Regards,
Ajinkya Gadewar
Sent from my iPhone
On 11-Feb-2013, at 2:17 PM, "alexandre...@gmail.com"
wrote:
> Hi
> I'm starting a big app on Django for Shool ma
Hi
I'm starting a big app on Django for Shool management, to replace a Win32
app.
I've roles like teachers, students, admin stuff, ... that have diferent
access.
How should it be developded?
1- an app for each role?
2- some logic in templates?
3- any other
what is the correct aporach to get bi
Mike, Anssi,
Thank you for your replies. I will give this a shot and see if I can get
it to work.
Sam
On Thursday, May 17, 2012 9:59:40 PM UTC-7, akaariai wrote:
>
> On May 18, 5:25 am, oneroler wrote:
> > Thanks Mike, that is what I was originally planning to do but realized
> > there woul
On May 18, 5:25 am, oneroler wrote:
> Thanks Mike, that is what I was originally planning to do but realized
> there would be situations where that wouldn't do exactly what I wanted.
> For example, if there is a business that only has the strategy 'wholesale'
> assigned, using ForeignKey would sti
On 18/05/2012 12:25pm, oneroler wrote:
Thanks Mike, that is what I was originally planning to do but realized
there would be situations where that wouldn't do exactly what I
wanted. For example, if there is a business that only has the
strategy 'wholesale' assigned, using ForeignKey would stil
Thanks Mike, that is what I was originally planning to do but realized
there would be situations where that wouldn't do exactly what I wanted.
For example, if there is a business that only has the strategy 'wholesale'
assigned, using ForeignKey would still allow me to assign a different
strate
On 18/05/2012 7:02am, oneroler wrote:
I'm trying to setup my first app and I'm trying to figure out the best
way to have constraints on a particular field (strategy for class
Division noted below). Below is the basic model structure. What I
would like is for the strategy under a Division to b
I'm trying to setup my first app and I'm trying to figure out the best way
to have constraints on a particular field (strategy for class Division
noted below). Below is the basic model structure. What I would like is
for the strategy under a Division to be constrained to the strategies
select
11 at 8:06 PM, youpsla wrote:
> > > Hi,
> > > before getting more in depth in writing my project I ask you a general
> > > design question. My Django knowledge is not BIG enough for me to be
> > > able to have a clear answer (with for and cons) on my question.
&g
eith-Magee wrote:
> On Mon, Nov 7, 2011 at 8:06 PM, youpsla wrote:
> > Hi,
> > before getting more in depth in writing my project I ask you a general
> > design question. My Django knowledge is not BIG enough for me to be
> > able to have a clear answer (with for and con
On Mon, Nov 7, 2011 at 8:06 PM, youpsla wrote:
> Hi,
> before getting more in depth in writing my project I ask you a general
> design question. My Django knowledge is not BIG enough for me to be
> able to have a clear answer (with for and cons) on my question.
>
> Here are the
Hi,
before getting more in depth in writing my project I ask you a general
design question. My Django knowledge is not BIG enough for me to be
able to have a clear answer (with for and cons) on my question.
Here are the main guidelines of my project :
- I've two kind of users : Shop owner
Thank you very much!
I choose the first option for now.
If I have any problems, I will write them here
On Oct 17, 2:51 pm, Stuart wrote:
> Hello Omer --
>
> I believe you have two options. You could use the AttributeValue
> approach I described earlier. You could add features to take care of
> 'd
Hello Omer --
I believe you have two options. You could use the AttributeValue
approach I described earlier. You could add features to take care of
'data types' and the like. The work may be quite tedious, but it has
the advantage of not being clever. In other words, you would do the
work to imple
I should also mention that one AttributeValue table for all the
registrations isn't good for my purpose, because it says that the
Value column must have a specific type field. I want that every detail
(Atrribute) will have the option to be from any field type
(CharField,DateTimeField, etc).
On Oct
Thank you for the response.
As stuart wrote, i should give more details about the website.
Currently let's suppose I have 2 interesting tables (I'm not sure that
the relationship between these 2 tables is well designed):
1. Details, that contains all the possible information that should be
provid
Hello omerd --
If you give some concrete examples of what you are trying to do,
including providing your current models.py code, it will make it
easier for us to help you.
Since you have Registration and Details models, I am assuming you want
the user to be able to create/define these items, rath
Hello everybody,
I am writing my first web application with Django.
I want to create a web of registration for many subjects.
However, each subject require different set of details to be supplied
so I don't know which models should I have in the database.
Currently I have two models:
Registration
On Thu, Jul 21, 2011 at 5:35 PM, Marc Aymerich wrote:
>
> ups, I think it should be:
> contract.products.filter(id=Y).values_list('rebate_pct', flat=True)
> product.contractproduct_set.filter(id=X).values_list('rebate_pct',
> flat=True)
Thanks. The first one does not work since rebate_pct is in t
On Thu, Jul 21, 2011 at 11:33 PM, Marc Aymerich wrote:
>
>
> On Thu, Jul 21, 2011 at 11:11 PM, nixlists wrote:
>
>> On Thu, Jul 21, 2011 at 4:30 PM, Jani Tiainen wrote:
>> > ContractProduct.objects.all()
>> > Following might work also (not sure, but is easy to test in shell for
>> > example):
>
On Thu, Jul 21, 2011 at 11:11 PM, nixlists wrote:
> On Thu, Jul 21, 2011 at 4:30 PM, Jani Tiainen wrote:
> > ContractProduct.objects.all()
> > Following might work also (not sure, but is easy to test in shell for
> > example):
> > for c in Contract.objects.all():
> > for cp in c.contractprod
On Thu, Jul 21, 2011 at 4:30 PM, Jani Tiainen wrote:
> ContractProduct.objects.all()
> Following might work also (not sure, but is easy to test in shell for
> example):
> for c in Contract.objects.all():
> for cp in c.contractproduct_set.all():
> print c, cp.product, cp.rebate_pct
> --
On Thu, Jul 21, 2011 at 10:50 PM, nixlists wrote:
> On Thu, Jul 21, 2011 at 2:17 PM, Jani Tiainen wrote:
> > Hi,
> > So you want to tie Contract with Product(s) with rebate_pct? You then
> need
> > custom intermediary m2m table say "ContractProduct"
> > https://docs.djangoproject.com/en/1.3/top
On Thu, Jul 21, 2011 at 2:17 PM, Jani Tiainen wrote:
> Hi,
> So you want to tie Contract with Product(s) with rebate_pct? You then need
> custom intermediary m2m table say "ContractProduct"
> https://docs.djangoproject.com/en/1.3/topics/db/models/#intermediary-manytomany>
> for more. So in the end
Hi,
So you want to tie Contract with Product(s) with rebate_pct? You then need
custom intermediary m2m table say "ContractProduct" https://docs.djangoproject.com/en/1.3/topics/db/models/#intermediary-manytomany>
for more. So in the end your models would probably look a alike following:
class Cont
Sorry about formatting. Also the there is a mistake.
"I'd like to define the Product model..." should be
"I'd like to define the Contract model...
Thanks.
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to dja
Hi. I have a question about writing normalized models. I began writing
an app that has non-normalized tables, and would like to rewrite it
with a normalized design.
I have non-normalized legacy tables like this without foreign keys or
many-to-many relationships, which I would like to have.
Contra
Hello everyone I just started with django and was wondering how to do
the following behaivor in my models:
class Game(models.Model)
characters_count = models.IntegerField(default=1) #basically i set
to a choice of 1-3
class Match(models.Model)
video=models.ForeignKey(Game)
p1char1 = models.Fo
Excellent advice!
With this I'm down to less than 0.02 secs for the 13x13 map rendering!
Regards,
Lars
On Nov 2, 9:45 pm, Knut Ivar Nesheim wrote:
> I would suggest rewriting the loop in your template as a templatetag.
> Something like this
>
> @register.simple_tag
> def render_locations(locati
I would suggest rewriting the loop in your template as a templatetag.
Something like this
@register.simple_tag
def render_locations(locations):
html = u""" html %(x)s stuff %(y)s here %(link)s """
return '\n'.join([html % { 'x': loc.x, 'y': loc.y', 'link':
loc.link } for loc in locations])
Ok, thanks for the suggestion, Javier.
I implemented this and it showed:
I'm spending about
0.2 secs for the queries,
but 1.5 secs for t.render(c) !
So rendering the template seems to take a significant amount of time!
As you can see, my template code iterates over about 13*13=169 objects
that hav
On Tue, Nov 2, 2010 at 3:35 AM, Lars Ruoff wrote:
> Ok, so having excluded SQLite and the static served files, I'd like to
> test if the server matters. What would be a minimum Apache install and
> config to run Django locally (on Windows)?
again, that's _very_ unlikely to be the cause. why not
On Tue, 2010-11-02 at 01:35 -0700, Lars Ruoff wrote:
> Ok, so having excluded SQLite and the static served files, I'd like to
> test if the server matters. What would be a minimum Apache install and
> config to run Django locally (on Windows)?
try nginx+fcgi/tornado/your favourite webserver
--
r
Ok, so having excluded SQLite and the static served files, I'd like to
test if the server matters. What would be a minimum Apache install and
config to run Django locally (on Windows)?
On Nov 1, 7:30 pm, Lars Ruoff wrote:
> Ok, thanks all,
>
> So following Bill's advice, i did:>python manage.py
Ok, thanks all,
So following Bill's advice, i did:
>python manage.py shell
>>> import game.models
>>> list(game.models.Location.objects.filter( \
... x__gte=34, \
... x__lte=46, \
... y__gte=24, \
... y__lte=36))
...and the result showed up instantly!
So it seems DB is not the issue.
Will
My experience with Django debug toolbar is that it makes things
slow all by itself.
I have done a couple of apps that use the equivalent query, using PostgreSQL,
without noticing a performance issue, with everything running on a Linux server.
1. Have you tried timing the query by hand? That is,
On Mon, Nov 1, 2010 at 5:55 AM, Cal Leeming [Simplicity Media Ltd]
wrote:
> 9 out of 10 times, the bottleneck is usually the database
true, but 8.7 of those 9 are about how the database is used, and not
about the engine choice. simply changing SQLite won't improve
significantly the one-user case
Hi Lukasz,
see my answer to Daniel. Replacing images by text didn't speed up
things much.
Is there any other test/profiling that i should do?
Would taking the systime before and after the query give me some
hints? I'll try this later...
On Nov 1, 12:39 pm, Łukasz Rekucki wrote:
> On 1 November 20
On 1 November 2010 10:59, Lars Ruoff wrote:
> Hello,
>
> first of all, these are my first steps with Django, and i only have
> limited experience with Python, so please be patient.
>
> I'm using it for what is intended to be a browser game in the future.
> The main part of the game is a zoom view
Hi Daniel,
you are right that images are being loaded.
But i gave it a try and replaced the images by text.
Still the page takes about 3 seconds to load.
Lars
On Nov 1, 12:30 pm, Daniel Roseman wrote:
> It's a bit hard to tell without knowing how the slowness appears. What
> exactly is slow?
>
Ok, but that said, the database isn't that big here. (Well, i guess)
There are currently 4800 entries in the "Location" table.
Is this too much for SQLite already?
May it be the query in
locations = Location.objects.filter( \
x__gte=center_location.x-half_x, \
x__lte=center_loc
On Nov 1, 9:59 am, Lars Ruoff wrote:
> Hello,
>
> first of all, these are my first steps with Django, and i only have
> limited experience with Python, so please be patient.
>
> I'm using it for what is intended to be a browser game in the future.
> The main part of the game is a zoom view on a tw
Hi Lars,
Unless you are doing some *really* intense Python code in your business
logic, then 9 out of 10 times, the bottleneck is usually the database,
especially if you are using Python.
Cal
On Mon, Nov 1, 2010 at 9:59 AM, Lars Ruoff wrote:
> Hello,
>
> first of all, these are my first steps
Hello,
first of all, these are my first steps with Django, and i only have
limited experience with Python, so please be patient.
I'm using it for what is intended to be a browser game in the future.
The main part of the game is a zoom view on a two-dimensional map of
fields.
I'm currently using
The sample type table is only needed to generate a form for new samples.
> > The attribute table could be broken up by data type if necessary as well.
>
> > Sent from my Verizon Wireless BlackBerry
>
> > -Original Message-
> > From: llanitedave
> > Da
t;
> Sent from my Verizon Wireless BlackBerry
>
> -Original Message-
> From: llanitedave
> Date: Fri, 18 Jun 2010 23:27:55
> To: Django users
> Subject: Re: Database Design Question
>
> Thanks for the response, Venkatraman. You're right that I don't
> ant
Sent from my Verizon Wireless BlackBerry
-Original Message-
From: llanitedave
Date: Fri, 18 Jun 2010 23:27:55
To: Django users
Subject: Re: Database Design Question
Thanks for the response, Venkatraman. You're right that I don't
anticipate a huge number of records here -- a few
Hallöchen!
llanitedave writes:
> [...]
>
> I guess it's mostly a normalization question.
>
> And while I was typing out a long explanatory discussion to
> enlarge on the problem, I stumbled across the answer.
>
> I'll need to use a separate table for each sample type to store
> its unique set of
Thanks for the response, Venkatraman. You're right that I don't
anticipate a huge number of records here -- a few hundred thousand at
the extreme high end. Sharding isn't something I considered, and I
don't think it would be necessary.
I guess it's mostly a normalization question.
And while I w
On Sat, Jun 19, 2010 at 10:12 AM, Venkatraman S wrote:
> Prefer a table like follows (tblname:samples): sampleid, samplename ,
> sampledesc etc etc
>
Ok - i missed explaining why i would recommend this:
In most of the applications, maintainence is a bigger pain than development.
In your case,
On Sat, Jun 19, 2010 at 4:28 AM, llanitedave wrote:
> I'm putting together a system to track scientific samples of various
> types. The "various types" is what's making me scratch my head at the
> moment.
>
Prefer a table like follows (tblname:samples): sampleid, samplename ,
sampledesc etc e
I'm putting together a system to track scientific samples of various
types. The "various types" is what's making me scratch my head at the
moment.
Each sample type has a particular set of attributes, some of which are
unique, others are shared with other sample types.
For example, a fluid sample
On Jun 6, 5:23 am, Jason Beaudoin wrote:
>
> - I've got a model that defines "submissions", which are incoming
> messages from HTML forms on various websites and are fielded by admins
> - each submission has a bunch of basic information related to the
> submission (where, when, etc), as well a
In the SQL world, you would probably store each form field value for
each submission as a row (or the entire form submission in a single
field, serialized to some known form; some DBs natively have an XML
field which might be useful).
In the noSQL world, however, this kind of situation is easier (
On Sunday, June 6, 2010, Jason Beaudoin wrote:
> On Fri, Jun 4, 2010 at 2:42 AM, Russell Keith-Magee
> wrote:
>> On Fri, Jun 4, 2010 at 12:03 PM, Jason Beaudoin
>> wrote:
>>> Silence usually implies some key piece of documentation was missed, or
>>> was this just lost amongst more interesting p
On Fri, Jun 4, 2010 at 2:42 AM, Russell Keith-Magee
wrote:
> On Fri, Jun 4, 2010 at 12:03 PM, Jason Beaudoin
> wrote:
>> Silence usually implies some key piece of documentation was missed, or
>> was this just lost amongst more interesting posts? :)
>
> You've missed two important alternatives:
>
On Fri, Jun 4, 2010 at 12:03 PM, Jason Beaudoin wrote:
> Silence usually implies some key piece of documentation was missed, or
> was this just lost amongst more interesting posts? :)
You've missed two important alternatives:
* The people who can answer your question are busy
* Nobody can under
Silence usually implies some key piece of documentation was missed, or
was this just lost amongst more interesting posts? :)
On Tue, Jun 1, 2010 at 9:54 PM, Jason Beaudoin wrote:
> Hi,
>
> I've a situation where the following functionality is desirable..
>
> - one central model is used and inte
Hi,
I've a situation where the following functionality is desirable..
- one central model is used and interacted with by users
- forms (multiple on multiple sites, pick a number for each.. 5 or
50, doesn't matter) are submitted by anonymous users and associated
with this central model.. so thes
you could create a template module where you put in the logic to dipslay
the content of the post:
Hello,
>
> I'm writing some simple webblog, just for self teaching, and I have a
> question how to do better. Here is the situation, I have base.html, I
> have blog.html which extends base. Now i
Hello,
I'm writing some simple webblog, just for self teaching, and I have a
question how to do better. Here is the situation, I have base.html, I
have blog.html which extends base. Now in that blog I would like to
put posts, full text posts, without comments, and link to the post
only with commen
Hi,
I have different models A,B,C which all will have exactly on Address.
If I query instances of A,B,C I usually will also need the related
address. I also want to query all instances of A,B,C which have a
certain zip code for example. What's the best and most efficient way
to model that in djang
On Mon, Jan 11, 2010 at 12:00 PM, Igor wrote:
> Thanks a lot - I didn't know about generic relations, and will
> definitely look at them - right now :).
I start thinking about extending models (and other DRY mode/db
methods) when I see myself repetitively typing out too many fields.
~J
--
You r
Thanks a lot - I didn't know about generic relations, and will
definitely look at them - right now :).
The minimal subset - and that's where I'm trying to follow DRY - boils
down to a Title, a slug, Content HTML of the entry, maybe a couple
more things - all are very much like what you would expe
My instinct is that you may be trying to be too generic. Without knowing
more details, a "generic Entry" sounds a lot like .. a database record. :)
Django's model.Model base class already does a great job at being easily
extensible.
Is there a specific minimal-but-interesting set of database fiel
Hi all,
This is a general question for whoever is good with best practices for
Django design (software design that is).
I'd like to implement (well, kinda have implemented), a generic Entry
object that would be good for several uses. For example, an Event
(such as, say, a website presentation) is
It sounds like, for auditing purposes, there should be a model for storing each
"hours worked" entry.
Also, the hours estimated should not be reduced in the database -- there should
be a method of your model which returns the remaining hours by subtracting the
sum of the worked hours from the e
Hi,
I have a Model which tracks tasks for a project. This model should
have
- hours estimated
- hours worked
on it.
Everytime someone updates one of those fields, the hours worked should
be increased and should also be stored to be used for time reporting.
e.g. hours worked: 12.21.09 2 hours, 1
Even though it is outside the scope, I'd say start simple and build
slowly with related tables, those are easy to add to a system. I'd
probably find the attributes you'd like to capture in the 'extra
details' and start putting them in a table. Determine what the
purpose of these attributes are, s
This /is/ outside the scope of Django.
"Database normalization" and "Database design" are the google query
you're looking for to learn more about this, though. Here are some
links that may steer you in the right direction:
http://en.wikipedia.org/wiki/Database_normalization
http://databases.about
This is probably outside Django. But I am checking out since I am building
it with Django.
I am building a specialized closed group social networking web site for
special set of medical practitioners. Idea for my client is to be a mini-
LinkedIn of sorts for this small community.
We want to captu
It's a trade-off. Loose coupling allows you to modify the structure of
your program easier, but doing so in this case is going to lead to a
performance hit.
That said, this isn't crazy coupling we're suggesting. It's not like
we need to know anything about the user model to do this or that
anythi
So the tighter coupling implied by each entry knowing about the user
profile shouldn't be a subject of concern?
On Sep 23, 11:05 pm, Brian McKeever wrote:
> I remember a quote from either headfirst java or design patterns that
> said something like:
> "The key to inheritance is to abstract func
I remember a quote from either headfirst java or design patterns that
said something like:
"The key to inheritance is to abstract functionality."
I realize we're not talking about inheritance, but I think it still
applies.
It may make logical sense that a user object has a blog that has
entries,
There's a pattern I keep running into, and I've been wondering if
anyone who's encountered it before has an opinion on how best to deal
with it:
Imagine you have an app that could theoretically stand on its own --
for now let's say a schedule, but it could be anything (an image
gallery, a blog, e
The user model, because the model defined by AUTH_PROFILE_MODULE is
intended to be an extension to the actual user model. Namely the
profile.
Why would you bind something to a user's profile, instead of the user
itsself? If you want to "allow records of people without Users", then
use blank=True
I`d go with the first. It`s easier to get the current logged in user and all
other pluggable apps use User, so it's a common thing to do and you can
integrate things easily .
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Gr
I'm still making my first site with django so I don't how much weight my
opinion has, but I used a seperate profile for ForeignKeys. I don't know
why, it just seemed logical at the time. It is easer as you can refer to
whats in a users profile easier. You can put things like {{
song.profile.user.us
Hi all!
While reevaluating my own historically old models I came to a dilemma
to which model it is better to set the ForeignKey when you want to
define ManyToOne relationship to a person. Should the ForeignKey point
to django.contrib.auth.models.User or to the one which is defined in
AUTH_PROFILE
Validation turns out to be well-nigh impossible using parent / child
aliases, but pretty easy with parent / child accounts. Here's what
I've ended up with:
class Account(models.Model):
user = models.ForeignKey(User, unique=True, null=True, blank=True)
alias = models.CharField(ma
I'm not asking as a Django / foreign key thing. I'm having a lot of
trouble referencing each model from the other's save method for
validation purposes, because there's always going to be one that's
declared after the other.
On Aug 19, 10:35 am, Joshua Russo wrote:
> You can, it just creates
You can, it just creates headaches. At least one of the ForeignKeys needs to
not be required (I believe that's the default anyway).
On Wed, Aug 19, 2009 at 1:27 PM, ringemup wrote:
>
>
> Is having two classes that reference one another just simply something
> that can't be done in Python?
>
>
>
Is having two classes that reference one another just simply something
that can't be done in Python?
On Aug 19, 4:36 am, Joshua Russo wrote:
> On Tue, Aug 18, 2009 at 11:04 PM, ringemup wrote:
>
> > Well, I'm trying to implement parent / child aliases, but I'm running
> > into problems with
1 - 100 of 198 matches
Mail list logo