I am working with django and having a hard time grasping how to do complex queries
Here is my model
class TankJournal(models.Model):
user = models.ForeignKey(User)
tank = models.ForeignKey(TankProfile)
ts = models.DateTimeField(auto_now=True)
title = models.CharField(max_length=50)
body = models.TextField()
cla...
hi
why cant we have static method in an inner class
and if i make inner class static it works why so
...
Maybe I'm going about it the wrong way. Here is what I'm trying to do and my problem.
I have 3 tables.
assets (a computer, network device, etc)
ports (a port on the computer, network device, etc)
port_connections (has a port_id_a and port_id_b field and links each port and therefor each asset together)
It's really just a way to track v...
Hi All,
In my page im using gridview to display records. Each row having record in the inner grid.
i want to display row number for the inner grid, for each row inner grid row number should start with 1.pls help me
It's a Web application (.NET 2008 , .NET 3.5 + C#)
...
I'm trying to create an expression tree dynamicly.
Let asume that I have two simple classes:
class CustomerType
{
public int Id { get; set; }
public string Name { get; set; }
public OrderType[] Orders { get; set; }
}
class OrderType
{
public int Id { get; set; }
public DateTime Date { get; set; }
public decimal Pric...
I have 2 tables. One is items and another is votes for those items.
Items table has: |item_id|name|post_date
Votes table has: |votes_id|item_id|answer|total_yes|total_no
What I want to do is show all items based on post_date and show the answer in the votes table with the HIGHEST total_yes. So I want to show only a SINGLE answer from ...
I'm pretty new to Java and I don't understand what is this structure. I know what is an interface and how is defined, but in this case, I really don't know. Could you tell what is about?
public interface WebConstants {
public interface Framework {
String ACTION = "action";
}
public interface Look {
String LI...
Suppose I have
@someDecorator
def func():
'''this function does something'''
print 1
Now, the object func is an instance of someDecorator. Is there some way I can access the function it holds, i.e something like func.getInnerFunction().
For instance, if I need to retrieve the doc string of func().
...
i have sql query
select * from "Roles" Join "Users" On "Roles".Role="Users".RoleId
it return error column Roles.role does not exist
query
select * from "Roles" Join "Users" On Roles.Role=Users.RoleId
return error missing FROM-clause entry for table "roles"
how can i solve this problem?
i aways work with ms sql
...
Hello,
I'm using document.nodeName.innerHTML to change the content of a particular node. It is not working in my case. Can someone please let me know where I've went wrong.Thanks in advance. Please find the below code. On click of a link, I need to change the text of that link.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//E...
I am trying to setup a simple database in which I have a user and store both their residential and postal address. I have 2 tables
Users
id (Primary Key)
name (Varchar 255)
residential_id (foreign key)
postal_id (foreign key)
Address
id (primary key)
type (enum of R and P)
street (varchar 255)
suburb (varchar 255)
I am tring ...
Im trying to understand scope in nested classes in python. Here is my example code :
class OuterClass:
outer_var = 1
class InnerClass:
inner_var = outer_var
The creation of class does not complete and I get the error :
<type 'exceptions.NameError'>: name 'outer_var' is not defined
trying inner_var = Outerclass...
I observed that Outer classes can access inner classes private instance variables. How is this possible? A sample code demonstrating the same is explained below::
class ABC{
class XYZ{
private int x=10;
}
public static void main(String... args){
ABC.XYZ xx = new ABC().new XYZ();
System.out.println("H...
Im trying to join a user table to retrieve the users login name.
I wish to have TWO INNER joins one for CreatedByUser_loginname and ModifiedByUser_loginname
But at the moment Im just trying to get the SQL query string syntax right.
BUT, When I change the name of the INNER JOIN with an AS 'name' I get an exception thrown when sqlreader()...
I've got the following sql statement and need to know how to write it in linq, but i can't figure out how to write the multiple inner joins
SELECT Zugehörigkeiten.PK_Dept_ID
FROM mitarbeiter
INNER JOIN (abteilungen
INNER JOIN Zugehoerigkeiten
ON abteilungen.PK_Dept_ID = Zugehoerigkeiten.PK_Dept_ID)
ON mitarbeiter...
Hi,
Basically I am trying to understand and learn the 'this' keyword's working principle in JavaScript.
As far as I understand 'this' refers to the object (function) that it is inside at that moment.
So, by believing this, I wanted to test the output of the simple code below:
<body>
<input type="button" value="Add Age" onclick="Ou...
I want to do something similar to Photoshops inner shadow effect in Core Graphics. If I draw/fill a path with this effect, I want get something similar to the following:
...
I've have 2 tables CampaignCoverage and Coverage
CampaignCoverage has a CoverageID column. Coverage has a column DateX.
Basically I've not specified in the code that CampaignCoverage.CoverageID = Coverage.ID like you would to in SQL. How does this work at all????!!!!
CampaignCoverageCollection campaignCoverages =
new Select()
...
Hi, I have the following java class:
class Outer
{
private Integer a;
private Long b;
class Inner
{
public void foo()
{
System.out.println("a and b are " + a + " " + b);
}
}
}
when I run javap on Outer and Outer$Inner, I get the following:
C:\test>javap Outer
Compiled from "Ou...
Can we create the object of inner class in the constructor of outer class?
...