Hi all,
I have 2 tables, one is A another is B, and B have one FK which contains
more than 1 field references to A. The table struct is here:
create table A
(
oid int not null,
types varchar(20) not null,
name varchar(30) null,
color varchar(20) null,
constraint PK_A primary key (oi
Hi hollandzwz,
try to change to_field in related_name="entitites"
Example:
class UserFollower(models.Model):
user_id = models.ForeignKey(User,related_name="users")
follower_id = models.ForeignKey(User,related_name="followers")
bye
Dario Concilio
Date: Mon, 10 Aug 2015 02:39:12 -0
Hi again...
I could need to read this
https://code.djangoproject.com/wiki/MultipleColumnPrimaryKeys
Bye
Dario
Date: Mon, 10 Aug 2015 02:39:12 -0700
From: holland...@gmail.com
To: django-users@googlegroups.com
Subject: how to description FK which contains more than 1 field
Hi all,
I have 2
This has bamboozled me for a while. I Have a wonderful little test app I'm
playing with which lists objects (ListView) and next to each object puts an
edit and view link. Sort of like:
- [view] [edit] Object 1
- [view] [edit] Object 2
- [view] [edit] Object 3
The ListView works like a
THANX A LOT
--
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 post to this group, send email to django-users@googleg
I am working on a project which has two different sets of users - Customer
and Merchant. Both of these users should be able to register and login to
their respective profiles. The most obvious choice to implement this that
came to my mind was to make two different models Customer and Merchant
Thank you, Mike, that’s helpful!
On Aug 9, 2015, at 7:42 PM, Mike Dewhirst wrote:
> On Monday, August 10, 2015 at 8:34:28 AM UTC+10, Nan wrote:
> Hi everyone --
>
> I'm building a project that allows users to create mailing lists. In order
> to create a mailing list, you must first create a
Hello all,
I want to to make a facebook like chat application in django.
can you guys suggest me, what technology should I use to make it , or
can you give me some links to learn it
for this I will be very thankful to you guys
with regards
jai
--
You received this message be
This is orthogonal to Django, but I would take a look at TornadIO and
https://github.com/MrJoes/tornadio/tree/master/examples/chatroom
On Mon, Aug 10, 2015 at 8:56 AM, JAI PRAKASH SINGH <
jaiprakashsingh...@gmail.com> wrote:
> Hello all,
>
>
> I want to to make a facebook like chat applicatio
Hi everyone,
Last week I added the RSS Feed to the Django Community Blog which was
approved by the Django Community.
The problem is that I am not seeing any of the current posts of the feed in
the django community blog page.
Does anyone have this issue before?
Thanks,
Luciano
--
You receive
I personally like a profile model, but if you implement two you may have
headaches when doing a reverse relation from user, you would need to check
every time of the request.user is a customer or merchant.
In any case what is the difference between them anyway? Why can't a user be
both?
On Mon, A
No, I didn't, but I just have done and it works. Thanks :)
On Saturday, August 8, 2015 at 10:42:57 PM UTC+2, James Schneider wrote:
>
> Did you complete the following section after changing the urls.conf? The
> URL changes won't work until you modify the views.py file in the next
> section.
>
Hey Andrew,
Thank you for replay, so i just want to know, if i want to implement in
django will it work fine ?
On Monday, August 10, 2015 at 7:38:44 PM UTC+5:30, Andrew Farrell wrote:
>
> This is orthogonal to Django, but I would take a look at TornadIO and
> https://github.com/MrJoes/torn
On Mon, Aug 10, 2015 at 7:46 AM, JAI PRAKASH SINGH
wrote:
> Thank you for replay, so i just want to know, if i want to implement in
> django will it work fine ?
That's not really a question about the language. Developers can do
all sorts of amazing stuff with Django. I was surprised to find
I'm having two model classes Product and Category, on the one hand the
Product class has a ManyToMany field ( product_categories ) which lists all
the categories, a product instance may belong to, on the other hand the
Category class has the category_slug field. The question is - is there any
You surely can use Choice field for either Customer or Merchant in your
custom user class.
On 10 Aug 2015 20:12, "Avraham Serour" wrote:
> I personally like a profile model, but if you implement two you may have
> headaches when doing a reverse relation from user, you would need to check
> every
Hello Ankit,
On 08/10/2015 09:38 AM, Ankit Agrawal wrote:
> I am working on a project which has two different sets of users -
> |Customer| and |Merchant|. Both of these users should be able to
> register and login to their respective profiles. The most obvious choice
> to implement this that came
If you want to avoid MT inheritance, look at inheriting from
AbstractBaseUser using a custom abstract class where you can add your extra
custom fields. Your two types of users (inheriting from your new abstract
class) would then be standard, separate models.
-James
On Aug 10, 2015 9:24 AM, "Robin
Hello,
I'm trying to move a fairly large site from Django 1.6.5 to Django 1.8.3.
I'm also moving from sqlite3 to postgreSQL at the same time and I'm having
trouble with the migrations. Here's what I've done so far:
- Installed Django 1.8.3, removed south, and installed psycopg 2.6.1
- In
In Django, requests should not wait, since the threads are relatively
heavyweight in python, and need to be a limited resource. The alternative
is a large number of processes, which is also expensive.
So you must design a scheme in which the client polls for a result, meaning
that you cannot expe
Thank you for your input. I appreciate you trying to steer my away from
potentially terrible design, however, I am still interested in someone
addressing my main questions. Some level of service calls is inevitable in
any interesting web application—even a call to an in-memory cache, like
Redis
@James: Even if I implement a Custom abstract class inheriting from
AbstractBaseUser, the Custom Abstract Class would have a explicit
OneToOneField to the AbstractBaseUser, which essentially would mean having
overheads due to JOINs as in MTI.
Ankit Agrawal,
IIT Bombay.
On Mon, Aug 10, 2015 at 10
Hi
Specifically addressing your questions:
- I would look at using shared memory to store data that you can share across
processes, plenty of resources on the web that talk about this.
- You might want to use a small file to store data and fcntl.flock() to control
access so you are not reading
> 1. What’s the most global, persisting, shared-across-requests type of
data I can read & write to memory?
Don't complicate your life, just store data in the database
> 2. However I can do this, does this require using `threading.Lock()`?
(looking around `dispatch.Signal` I see some use of it)
If
That is an incorrect assumption. Abstract model classes do not generate any
database tables, and are specifically designed for inheritance purposes
(otherwise they are pretty much useless). It is impossible for a OneToOne
field to exist that points to an abstract class.
https://docs.djangoproject.
On 08/10/2015 09:53 AM, TheBeardedTemplar wrote:
Hello,
I'm trying to move a fairly large site from Django 1.6.5 to Django
1.8.3. I'm also moving from sqlite3 to postgreSQL at the same time and
I'm having trouble with the migrations. Here's what I've done so far:
* Installed Django 1.8.3,
Hi Richard,
On 08/01/2015 06:27 PM, Richard Brockie wrote:
> Can someone please explain the implications of this note about squashing
> migrations in the documentation?
>
> From: https://docs.djangoproject.com/en/1.7/topics/migrations/
>
> "Once you’ve squashed a migration, you should not th
Hi Carl,
Thanks for pointing this out - it's right there! I don't know how I missed
it...
Thanks again,
R.
On Mon, Aug 10, 2015 at 11:12 AM, Carl Meyer wrote:
> Hi Richard,
>
> On 08/01/2015 06:27 PM, Richard Brockie wrote:
> > Can someone please explain the implications of this note about squ
If you have your heart set on a circuit breaker pattern (patterns are
overrated, see http://www.paulgraham.com/icad.html), consider implementing
it in the client.
If you need a long poll solution, note that you can serve some urls from
uwsgi/Django and others from tornado or twisted.
If you are w
Hi James,
Correct me if I am wrong but if I understood you correctly, I should
be able to implement it this way -
class User(AbstractBaseUser, PermissionsMixin):
common_fields_go_her = ...
objects = CustomUserManager()
class Meta:
abstract = True
class Customer(User):
TL;DR; How do you modify cache settings during testing? Specifically,
enable/disable (by making TIMEOUT zero or non-zero).
Full question:
I had some code that looked like this:
from django.core.cache import cache
data = cache.get(key, {})
etc.
Now it looks like this:
from django.core.cache im
*Aim to achieve* - Get call stacks where specific model classes are used.
(Example - MyModel.objects.save(), MyModel.objects.filter(), etc)
*My Approach - *
Add this in order to override *Save* and *Delete*.
Class MyModelClass(CallStackMixin, models.Model)
In order to override *get_query_set
Dear All,
My aim is to obtain all unique call stacks where model classes are
accessed.
To implement it, I thought of overriding save(), delete(), and
get_query_set() methods, as follows -
class MyModelClass(CallStackMixin, models.Model) # Mixin to override save,
and delete
objects =
Thanks for the settings.py suggestion Gary - I did make various changes
there prior to this post. I ended up resolving the issue by running
makemigrations for every app individually, then migrating.
Unfortunately I'm now running into trouble with my tests - I'm hitting the
same errors for my te
Hi, It is a good practice to add or edit an object in the same view or is
it better to separate?
*For example:*
def add_edit(request, id=None):
form = MyForm(request.POST or None)
if request.method == 'POST':
if form.is_valid():
form.save()
return HttpResp
On Mon, Aug 10, 2015 at 12:11 PM, Ankit Agrawal
wrote:
> Hi James,
>
> Correct me if I am wrong but if I understood you correctly, I should
> be able to implement it this way -
>
> class User(AbstractBaseUser, PermissionsMixin):
> common_fields_go_her = ...
>
> objects = CustomUserMa
How access verbose_name of a field in template?
I have an object:
p = Person.objects.get(pk=1)
and I wanna access same verbose_name in template like it:
{{ p.name.__verbose_name }}: {{ p.name }}
{{ p.birth_date.__verbose_name }}: {{ p.birth_date }}
*result:*
Name: Maria
Birth date: 1990-04-0
Thank you for the pointed response, François. I was thinking about
accessing some shared memory vs just doing something simpler and just being
per-process. The prior sounds more thorough, but the nature of what I’d
like to use it for is already OK with separate clients across machines, so
maybe
On Tuesday, August 11, 2015 at 2:31:11 AM UTC+5:30, James Schneider wrote:
>
> On Mon, Aug 10, 2015 at 12:11 PM, Ankit Agrawal > wrote:
>
>> Hi James,
>>
>> Correct me if I am wrong but if I understood you correctly, I should
>> be able to implement it this way -
>>
>> class User(AbstractB
On 11/08/2015 10:51 AM, Neto wrote:
How access verbose_name of a field in template?
I would write a view which collects the verbose names and other wanted
info and put it all into a single object or dict and pass that into the
template, like ...
obj.name_verbose_name
obj.name
obj.birth_date
hi
i have this on my model.admin
class MyDomainAdmin(admin.ModelAdmin):
list_display = ('domain', 'enabled', 'avscan', 'spamassassin',
'max_accounts')
list_filter = ('enabled',)
exclude = ('uid', 'gid', 'maildir')
# this part is my pseudo-code logic I want but i can't solved.
if
If is to do that way, I prefer to do manually. I would like to access the
direct verbose_name the template. Is possible that the "Django developers"
could do this?
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To unsubscribe from this group
On 11/08/2015 7:25 AM, Tony Peña wrote:
hi
i have this on my model.admin
class MyDomainAdmin(admin.ModelAdmin):
  list_display = ('domain', 'enabled', 'avscan', 'spamassassin',
'max_accounts')
  list_filter = ('enabled',)
  exclude = ('uid', 'gid', 'maildir')
# this part is my pseu
You could write up a simple template tag (or even a template filter) to do
this.
https://docs.djangoproject.com/en/1.8/howto/custom-template-tags/#simple-tags
Something along these lines would probably work:
# templatetags.py
register = template.Library()
@register.simple_tag
def verbose_name_t
44 matches
Mail list logo